contributing.md
This file
Path
docs/contributing.md
135 lines · 3.7 KiB · Markdown
Last changed by
Document the release process (#363)Florimond Mancabefore adoption1275246
History of this fileTake it
Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 1–2why, one step back1# Contributing2Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 3–4why, one step back3Thank you for being interested in contributing with HTTPX.4There are many ways you can contribute with the project:Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
line 5why, one step back5Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 6–27why, one step back6- Try HTTPX and [report bugs/issues you find](https://github.com/encode/httpx/issues/new)7- [Implement new features](https://github.com/encode/httpx/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)8- [Review Pull Requests of others](https://github.com/encode/httpx/pulls)9- Write documentation10- Participate in discussions1112## Reporting Bugs or Other Issues1314Found something that HTTPX should support?15Stumbled upon some unexpected behavior?1617Feel free to open an issue at the18[issue tracker](https://github.com/encode/httpx/issues).19Try to be more descriptive as you can and in case of a bug report,20provide as much information as possible like:2122- OS platform23- Python version24- Installed dependencies and versions (`python -m pip freeze`)25- Code snippet26- Error traceback27Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 28–29why, one step back28## Development29Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 30–31why, one step back30To start developing HTTPX create a **fork** of the31[HTTPX repository](https://github.com/encode/httpx) on GitHub.Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 32–39why, one step back3233Then clone your fork with the following command replacing `YOUR-USERNAME` with34your GitHub username:3536```shell37$ git clone https://github.com/YOUR-USERNAME/httpx38```39Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 40–42why, one step back40With the repository cloned you can access its folder, set up the41virtual environment, install the project requirements,42and then install HTTPX on edit mode:Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
line 43why, one step back43Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 44–50why, one step back44```shell45$ cd httpx46$ python3 -m venv venv47$ source venv/bin/activate48$ pip install -r test-requirements.txt49$ pip install -e .50```Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
line 51why, one step back51Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 52–54why, one step back52!!! note53 Feel free to replace this step with your development environment setup54 (pyenv, pipenv, virtualenvwrapper, docker, etc).Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
line 55why, one step back55Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 56–63why, one step back56## Testing and Linting5758We use [nox](https://nox.thea.codes/en/stable/) to automate testing, linting,59and documentation building workflow. Make sure you have it installed60at your system before starting.6162Install nox with:63Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 64–67why, one step back64```shell65$ python3 -m pip install --user nox66```67Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 68–69why, one step back68Alternatively, use [pipx](https://github.com/pipxproject/pipx) if you prefer69to keep it into an isolated environment:Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 70–74why, one step back7071```shell72$ pipx install nox73```74Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
line 75why, one step back75Now, with nox installed run the complete pipeline with:Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 76–83why, one step back7677```shell78$ nox79```8081!!! warning82 The test suite spawns a testing server at the port **8000**.83 Make sure this isn't being used, so the tests can run properly.Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 84–116why, one step back8485To run the code auto-formatting separately:8687```shell88$ nox -s lint89```9091Also, if you need to run the tests only:9293```shell94$ nox -s test95```9697You can also run a single test script like this:9899```shell100$ nox -s test -- tests/test_multipart.py101```102103## Documenting104105To work with the documentation, make sure you have `mkdocs` and106`mkdocs-material` installed on your environment:107108```shell109$ pip install mkdocs mkdocs-material110```111112To spawn the docs server run:113114```shell115$ mkdocs serve116```Document the release process (#363)Florimond Mancabefore adoption1275246
lines 117–135why, one step back117118## Releasing119120*This section is targeted at HTTPX maintainers.*121122Before releasing a new version, create a pull request that includes:123124- **An update to the changelog**:125 - We follow the format from [keepachangelog](https://keepachangelog.com/en/1.0.0/).126 - [Compare](https://github.com/encode/httpx/compare/) `master` with the tag of the latest release, and list all entries that are of interest to our users:127 - Things that **must** go in the changelog: added, changed, deprecated or removed features, and bug fixes.128 - Things that **should not** go in the changelog: changes to documentation, tests or tooling.129 - Try sorting entries in descending order of impact / importance.130 - Keep it concise and to-the-point. 🎯131- **A version bump**: see `__version__.py`.132133For an example, see [#362](https://github.com/encode/httpx/pull/362).134135Once the release PR is merged, run `$ scripts/publish` to publish the new release to PyPI.