Skip to content
Myr

contributing.md

This file

Path

docs/contributing.md

164 lines · 4.6 KiB · Markdown

Last changed by

✏️ Fix typo in `docs/contributing.md` (#947)Sebastián Ramírezbefore adoptioncb196cf

History of this file

Take it

The walk stopped after 200 commits: lines older than fececf5 point at it.

🔧 Update MkDocs to have titles in Markdown files instead of config (#913)Sebastián Ramírezbefore adoption6b264ac

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

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 3–6why, one step back
3First, you might want to see the basic ways to [help Typer and get help](help-typer.md){.internal-link target=_blank}.
45## Developing6

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 7why, one step back
7If you already cloned the <a href="https://github.com/fastapi/typer" class="external-link" target="_blank">typer repository</a> and you want to deep dive in the code, here are some guidelines to set up your environment.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 8why, one step back
8

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 9why, one step back
9### Virtual Environment

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 10why, one step back
10

✏️ Fix typo in `docs/contributing.md` (#947)Sebastián Ramírezbefore adoptioncb196cf

line 11why, one step back
11Follow the instructions to create and activate a [virtual environment](virtual-environments.md){.internal-link target=_blank} for the internal code of `typer`.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 12why, one step back
12

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 13why, one step back
13### Install Requirements Using `pip`

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 14why, one step back
14

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 15why, one step back
15After activating the environment, install the required packages:

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 16why, one step back
16

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 17why, one step back
17<div class="termy">

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 18why, one step back
18

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 19why, one step back
19```console

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

lines 20–22why, one step back
20$ pip install -r requirements.txt
2122---> 100%

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 23why, one step back
23```

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 24why, one step back
24

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 25why, one step back
25</div>

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 26why, one step back
26

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 27why, one step back
27It will install all the dependencies and your local Typer in your local environment.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 28why, one step back
28

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 29why, one step back
29### Using your Local Typer

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 30why, one step back
30

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 31why, one step back
31If you create a Python file that imports and uses Typer, and run it with the Python from your local environment, it will use your cloned local Typer source code.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 32why, one step back
32

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 33why, one step back
33And if you update that local Typer source code when you run that Python file again, it will use the fresh version of Typer you just edited.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 34why, one step back
34

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 35why, one step back
35That way, you don't have to "install" your local version to be able to test every change.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 36why, one step back
36

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 37why, one step back
37/// note | "Technical Details"

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 38why, one step back
38

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 39why, one step back
39This only happens when you install using this included `requirements.txt` instead of running `pip install typer` directly.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 40why, one step back
40

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 41why, one step back
41That is because inside the `requirements.txt` file, the local version of Typer is marked to be installed in "editable" mode, with the `-e` option.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 42why, one step back
42

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 43why, one step back
43///

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 44why, one step back
44

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 45why, one step back
45### Format

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 46why, one step back
46

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 47why, one step back
47There is a script that you can run that will format and clean all your code:

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

lines 48–49why, one step back
48
49<div class="termy">

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 50why, one step back
50

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 51why, one step back
51```console

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 52why, one step back
52$ bash scripts/format.sh

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 53why, one step back
53```

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 54why, one step back
54

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 55why, one step back
55</div>

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 56why, one step back
56

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 57why, one step back
57It will also auto-sort all your imports.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 58why, one step back
58

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 59why, one step back
59## Tests

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 60why, one step back
60

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

lines 61–62why, one step back
61There is a script that you can run locally to test all the code and generate coverage reports in HTML:
62

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 63why, one step back
63<div class="termy">

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 64why, one step back
64

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 65why, one step back
65```console

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 66why, one step back
66$ bash scripts/test-cov-html.sh

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 67why, one step back
67```

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 68why, one step back
68

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

lines 69–70why, one step back
69</div>
70

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 71why, one step back
71This command generates a directory `./htmlcov/`, if you open the file `./htmlcov/index.html` in your browser, you can explore interactively the regions of code that are covered by the tests, and notice if there is any region missing.

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 72why, one step back
72

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 73why, one step back
73## Docs

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 74why, one step back
74

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 75why, one step back
75First, make sure you set up your environment as described above, that will install all the requirements.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 76why, one step back
76

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 77why, one step back
77### Docs live

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 78why, one step back
78

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 79why, one step back
79During local development, there is a script that builds the site and checks for any changes, live-reloading:

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 80why, one step back
80

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 81–83why, one step back
81<div class="termy">
8283```console

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 84why, one step back
84$ python ./scripts/docs.py live

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 85why, one step back
85

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

lines 86–88why, one step back
86<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
87<span style="color: green;">[INFO]</span> Start watching changes88<span style="color: green;">[INFO]</span> Start detecting changes

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 89–92why, one step back
89```
9091</div>92

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 93why, one step back
93It will serve the documentation on `http://127.0.0.1:8008`.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 94why, one step back
94

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 95why, one step back
95That way, you can edit the documentation/source files and see the changes live.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 96why, one step back
96

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 97why, one step back
97/// tip

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 98why, one step back
98

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 99why, one step back
99Alternatively, you can perform the same steps that scripts does manually.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 100why, one step back
100

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 101why, one step back
101Go into the docs director at `docs/`:

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 102why, one step back
102

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

lines 103–104why, one step back
103```console
104$ cd docs/

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 105why, one step back
105```

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 106why, one step back
106

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 107why, one step back
107Then run `mkdocs` in that directory:

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 108why, one step back
108

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 109why, one step back
109```console

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 110why, one step back
110$ mkdocs serve --dev-addr 8008

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

lines 111–112why, one step back
111```
112

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 113why, one step back
113///

🔧 Update tabs and admonitions with new syntax and new MkDocs features (#906)Sebastián Ramírezbefore adoption289b230

line 114why, one step back
114

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 115why, one step back
115#### Typer CLI (optional)

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 116why, one step back
116

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 117why, one step back
117The instructions here show you how to use the script at `./scripts/docs.py` with the `python` program directly.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 118why, one step back
118

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 119why, one step back
119But you can also use <a href="https://typer.tiangolo.com/typer-cli/" class="external-link" target="_blank">Typer CLI</a>, and you will get autocompletion in your terminal for the commands after installing completion.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 120why, one step back
120

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 121why, one step back
121If you install Typer CLI, you can install completion with:

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 122–125why, one step back
122
123<div class="termy">124125```console

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

lines 126–129why, one step back
126$ typer --install-completion
127128zsh completion installed in /home/user/.bashrc.129Completion will take effect once you restart the terminal.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 130–133why, one step back
130```
131132</div>133

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 134why, one step back
134### Docs Structure

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 135why, one step back
135

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 136why, one step back
136The documentation uses <a href="https://www.mkdocs.org/" class="external-link" target="_blank">MkDocs</a>.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 137why, one step back
137

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 138why, one step back
138And there are extra tools/scripts in place in `./scripts/docs.py`.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 139why, one step back
139

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 140why, one step back
140/// tip

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 141why, one step back
141

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 142why, one step back
142You don't need to see the code in `./scripts/docs.py`, you just use it in the command line.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 143why, one step back
143

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 144why, one step back
144///

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 145–155why, one step back
145
146All the documentation is in Markdown format in the directory `./docs`.147148Many of the tutorials have blocks of code.149150In most of the cases, these blocks of code are actual complete applications that can be run as is.151152In fact, those blocks of code are not written inside the Markdown, they are Python files in the `./docs_src/` directory.153154And those Python files are included/injected in the documentation when generating the site.155

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 156why, one step back
156### Docs for Tests

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 157–159why, one step back
157
158Most of the tests actually run against the example source files in the documentation.159

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 160why, one step back
160This helps to make sure that:

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

line 161why, one step back
161

📝 Add docs for virtual environments, environment variables, and update contributing (#946)Sebastián Ramírezbefore adoption73b9698

line 162why, one step back
162* The documentation is up-to-date.

✏ Fix typo in `docs/tutorial/arguments/optional.md` (#602)Tadas Gedgaudasbefore adoptionfececf5

lines 163–164why, one step back
163* The documentation examples can be run as is.
164* Most of the features are covered by the documentation, ensured by test coverage.