diff --git a/.gitignore b/.gitignore index 36dcc72..88a9cc1 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ var/ *.egg .eggs/ .pytest_cache/ +.ipynb_checkpoints/ # source dirs have to be explicitly added src/ diff --git a/.travis.yml b/.travis.yml index e1c98ec..04f637b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,18 +47,20 @@ script: # dependencies separately. - python -m pip install $(cat requirements.txt) - python -m pip install $(cat requirements-test.txt) + # lint - python -m flake8 src/pycalver/ - MYPYPATH=stubs/ python -m mypy src/pycalver/ + # doc - rst2html5 --strict README.rst > /dev/null - rst2html5 --strict CHANGELOG.rst > /dev/null - + # test repo src/ - PYTHONPATH=src/:$PYTHONPATH python -m pytest --cov=pycalver test/ - codecov - + # build wheel - python -m pip install lib3to6 - python setup.py bdist_wheel --python-tag=py2.py3 - ls -l dist/* - + # test wheel - conda activate cpy27 - python --version - python -m pip install $(cat requirements-test.txt) diff --git a/requirements-dev.txt b/requirements-dev.txt index 822131f..5e63e42 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,5 @@ pip twine ipython pudb +py-spy +snakeviz diff --git a/requirements-test.txt b/requirements-test.txt index ca32388..deccc16 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,4 +1,5 @@ flake8 +flake8-bugbear mypy typing-extensions rst2html5 diff --git a/setup.cfg b/setup.cfg index 3851d2f..3a186ff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,25 @@ [flake8] -ignore = E203,W504 -max-line-length = 110 +ignore = + # No whitespace after paren open "(" + E201, + # No whitespace before paren ")" + E202, + # No whitespace before ":" + E203, + # Multiple spaces before operator + E221 + # Multiple spaces before keyword + E272, + # Spaces around keyword/parameter equals + E251 + # Line too long (B950 is used instead) + E501, + # Line break before binary op + W503, + # Line break after binary op + W504 +select = C,E,F,W,B,B901,B950 +max-line-length = 100 exclude = .git,__pycache__,.eggs/,dist/,.mypy_cache [mypy] @@ -9,6 +28,13 @@ disallow_untyped_calls = True follow_imports = silent strict_optional = True +[aliases] +test=pytest + +[tool:pytest] +addopts = --verbose +python_files = test/*.py + [bdist_wheel] universal = 1 diff --git a/setup.py b/setup.py index 0916d9a..432c4d1 100644 --- a/setup.py +++ b/setup.py @@ -43,15 +43,21 @@ setuptools.setup( url="https://github.com/mbarkhau/pycalver", version="201809.2b0", + keywords="version versioning bumpversion calver", description="CalVer versioning for python projects", long_description=long_description, - long_description_content_type="text/x-rst", packages=packages, package_dir=package_dir, zip_safe=True, - install_requires=["typing", "click", "setuptools"], - setup_requires=["lib3to6==v201809.0017-alpha"], + install_requires=["typing", "click"], + setup_requires=[ + "lib3to6==v201809.0017-alpha", + "pytest-runner", + ], + tests_require=[ + "pytest", + ], entry_points=''' [console_scripts] pycalver=pycalver.__main__:cli