Thanks for your interest in improving this project! These guidelines attempt to make the process easier and more enjoyable.
Everyone interacting with this project is expected to follow the Code of Conduct.
Submit questions, bug reports, and feature requests in the issue tracker. Please be as descriptive as you can. For bug reports, please include information about your local environment, the steps to reproduce the bug, and any relevant command-line output.
Submit improvements to code and documentation via pull requests. Unless it’s a small/quick fix, pull requests should reference an open issue that’s been discussed. This helps ensure that your contribution is aligned with the goals of this project.
During development, use the provided tools to check for consistent style, coding errors, and test coverage. These checks and the tests are run automatically on every pull request via Travis, AppVeyor, and Codecov. In general, only pull requests with passing tests and checks will be merged.
-
Fork and clone this repository
-
Create and activate a virtual environment
$ cd pytest-quarantine $ python3 -m venv venv $ source venv/bin/activate
-
Install this package and its dependencies for development
$ pip install -e .[dev] $ pre-commit install --install-hooks
This will install:
- pytest and coverage.py to run the tests
- black to format the code
- flake8 to identify coding errors and check code style
- pydocstyle to check docstring style
- pre-commit to run the formatters and linters on every commit
- tox to run common development tasks
-
Activate your virtual environment
$ source venv/bin/activate
-
Run the tests
$ pytest
-
Run the tests and generate a coverage report
$ tox -e py,coverage
Please add or update tests to ensure the coverage doesn’t drop.
-
Run the formatters and linters
$ tox -e check
These checks are also run on every commit via pre-commit hooks. Please fix any failures before committing.
-
Run the tests in all supported Python versions, generate a coverage report, and run the checks
$ tox
This requires having multiple versions of Python installed on your system (see the tox configuration for the list); pyenv is a good tool for that. However, this is also run for every pull request via continuous integration, so it’s okay to skip it.
This project adheres to Semantic Versioning and PEP 440, and uses setuptools_scm to manage versions via git
tags.
-
If the Travis and AppVeyor builds are passing, checkout and update
master
$ git checkout master $ git pull upstream master
-
Pick a version number (e.g.
0.0.3
)$ python setup.py --version 0.0.3.dev1+g0ccd866 $ version=0.0.3
-
Update the changelog
-
Commit the changes, tag the release, and push upstream
$ git commit -a -m "Release $version" $ git tag -s -m "Release $version" $version $ git push upstream master $version
-
If the Travis and AppVeyor builds pass, run the release pipeline to upload to TestPyPI
$ tox -e release
-
If it looks good on TestPyPI, run the release pipeline to upload to PyPI
$ tox -e release pypi
-
Using the GitHub CLI, create a new GitHub Release, with the version number as the title, the changelog as the description, and the distribution packages as assets
$ hub release create -m $version -e $(find dist/* -exec echo "-a {}" \;) $version
Add the
-p
flag for pre-releases. -
🚀 🎉