Skip to content
Myr

contributing.md

This file

Path

docs/contributing.md

116 lines · 2.7 KiB · Markdown

Last changed by

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

History of this file

Take it

Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33

lines 1–2why, one step back
1# Contributing
2

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 3–4why, one step back
3Thank 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 back
5

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 6–27why, one step back
6- 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 traceback27

Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33

lines 28–29why, one step back
28## Development
29

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 30–31why, one step back
30To start developing HTTPX create a **fork** of the
31[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 back
32
33Then clone your fork with the following command replacing `YOUR-USERNAME` with34your GitHub username:3536```shell37$ git clone https://github.com/YOUR-USERNAME/httpx38```39

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 40–42why, one step back
40With the repository cloned you can access its folder, set up the
41virtual 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 back
43

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 44–50why, one step back
44```shell
45$ 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 back
51

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 52–54why, one step back
52!!! note
53 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 back
55

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 56–63why, one step back
56## Testing and Linting
5758We 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:63

Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33

lines 64–67why, one step back
64```shell
65$ python3 -m pip install --user nox66```67

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

lines 68–69why, one step back
68Alternatively, use [pipx](https://github.com/pipxproject/pipx) if you prefer
69to keep it into an isolated environment:

Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33

lines 70–74why, one step back
70
71```shell72$ pipx install nox73```74

Add additional info to Contributing Guide (#213)Humberto Rochabefore adoption7156c36

line 75why, one step back
75Now, with nox installed run the complete pipeline with:

Create a Contributing page in the documentation (#190)Humberto Rochabefore adoption079ab33

lines 76–83why, one step back
76
77```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 back
84
85To 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```