Thanks for taking the time to contribute to
aiohttp-client-middlewares! This page explains how to set up a
development environment, run the checks, and submit your change.
Fork and clone the GitHub repository, then install the package in editable mode together with the development requirements:
$ pip install -e . -r requirements/test.txt -r requirements/lint.txt -r requirements/doc.txtThis installs the runtime dependencies plus everything needed to run the tests, the linters, and to build the documentation.
The test suite uses pytest:
$ pytestTo measure coverage the same way CI does:
$ pytest --cov=aiohttp_client_middlewares --cov-report=xml --cov-report=termAll style checks run through pre-commit, and types are verified with mypy:
$ pre-commit run --all-files
$ mypyCode is formatted with black (88 columns) and imports are sorted with isort, both enforced by pre-commit, so there is no need to format by hand.
$ sphinx-build -b html docs docs/_build/htmlWe use towncrier to manage the changelog. Every user-visible change
needs a news fragment in the CHANGES/ directory. Name the file
####.type.rst where #### is the issue or pull request number and
type is one of the eight categories below:
bugfix: A bug fix for undesired behavior that got corrected.feature: A new behavior or public API.deprecation: A declaration of future API removals or behavior changes.breaking: When something public gets removed in a breaking way.doc: Notable updates to the documentation or its build process.packaging: Notes for downstreams about tooling, packaging, or runtime assumptions.contrib: Changes that affect the contributor experience (tests, docs build, development setup).misc: Changes that do not fit any of the categories above.
Write the fragment in the past tense using reStructuredText, and sign it
with -- by :user:`your-github-handle`. If a single pull request needs
more than one fragment of the same type, add a sequence number:
####.feature.rst and ####.feature.1.rst. See CHANGES/README.rst
for more detail and examples.
- Create a branch for your change.
- Make the change and add a test that covers it.
- Make sure
pytest,pre-commit run --all-filesandmypyall pass. - Add a news fragment under
CHANGES/. - Open a pull request against the
masterbranch.