contributing.md
This file
Path
docs/contributing.md
130 lines · 3.6 KiB · Markdown
Last changed by
Allow serving docs via nox (#450)Florimond Mancabefore adoption65b8593
History of this fileTake it
Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33
lines 1–2why, one step back1# Contributing2Fix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5
lines 3–4why, one step back3Thank you for being interested in contributing to HTTPX.4There are many ways you can contribute to 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–61why, 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.61Fix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5
line 62why, one step back62Install `nox` with:Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
line 63why, one step back63Create 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```74Fix typos, spelling issues, and grammar in docs (#426)Kyle Galbraithbefore adoptionb65bce5
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–104why, 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## Documenting104Allow serving docs via nox (#450)Florimond Mancabefore adoption65b8593
line 105why, one step back105Documentation pages are located under the `docs/` folder.Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
line 106why, one step back106Allow serving docs via nox (#450)Florimond Mancabefore adoption65b8593
line 107why, one step back107To run the documentation site locally (useful for previewing changes), use:Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
lines 108–109why, one step back108109```shellAllow serving docs via nox (#450)Florimond Mancabefore adoption65b8593
line 110why, one step back110$ nox -s serveAdd additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36
line 111why, one step back111```Document the release process (#363)Florimond Mancabefore adoption1275246
lines 112–130why, one step back112113## Releasing114115*This section is targeted at HTTPX maintainers.*116117Before releasing a new version, create a pull request that includes:118119- **An update to the changelog**:120 - We follow the format from [keepachangelog](https://keepachangelog.com/en/1.0.0/).121 - [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:122 - Things that **must** go in the changelog: added, changed, deprecated or removed features, and bug fixes.123 - Things that **should not** go in the changelog: changes to documentation, tests or tooling.124 - Try sorting entries in descending order of impact / importance.125 - Keep it concise and to-the-point. 🎯126- **A version bump**: see `__version__.py`.127128For an example, see [#362](https://github.com/encode/httpx/pull/362).129130Once the release PR is merged, run `$ scripts/publish` to publish the new release to PyPI.