Miguel Sánchez de León Peque
2019-10-04
Objetivo: aprender
(a contribuir y compartir)
venv
)pytest
y Travis?master
master
Flujos:
rebase
o no rebase
Esa es la cuestión…
venv
[other]$ python --version
Python 2.7.16
[other]$ python3 -m venv .venv
[other]$ source .venv/bin/activate
(.venv) [other]$ python --version
Python 3.6.9
requirements.txt
También con rangos y condiciones
(.venv) [other]$ pip install -r requirements.txt
(.venv) [other]$ pytest --version
pytest
?test_mymodule.py
mymodule.py
-v
-x
-k nombre
--pdb
requirements.txt
code/pytest-pdb/
.travis.yml
flake8
requirements.txt
Uso:
requirements.txt
Uso:
.travis.yml
flake8-isort
requirements.txt
> Separate source and build directories (y/n) [n]: y
> Project name: My Project
> Author name(s): My Name
> Project release []: 0.0.1
> Project language [en]: en
docs/
make.bat
Makefile
build/
source/
index.rst
conf.py
_static/
_templates/
docs/Makefile
docs/source/
docs/build
! (.gitignore
)???
.readthedocs.yml
.readthedocs.yml
Instalación:
Uso:
tox.ini
.travis.yml
tox.ini
.travis.yml
workshop/
docs/
source/
...
Makefile
mypackage/
__init__.py
mymodule.py
tests/
test_mymodule.py
setup.py
LICENSE
README.md
setup.py
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="mypackage-username",
version="0.0.1",
author="My Full Name",
author_email="me@mydomain.com",
description="A small example package",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/myuser/workshop",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)
Construir:
Publicar:
pytest
fixture
(scopes)mark.parametrize
mark.skipif
conftest.py