You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MkDocs](https://github.com/mkdocs/mkdocs) is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file.
40
+
If you are only developing vLLM's Python code, install vLLM using:
41
41
42
-
#### Install MkDocs and Plugins
42
+
```bash
43
+
VLLM_USE_PRECOMPILED=1 uv pip install -e .
44
+
```
43
45
44
-
Install MkDocs along with the [plugins](https://github.com/vllm-project/vllm/blob/main/mkdocs.yaml) used in the vLLM documentation, as well as required dependencies:
46
+
If you are developing vLLM's Python and CUDA/C++ code, install vLLM using:
45
47
46
48
```bash
47
-
uv pip install -r requirements/docs.txt
49
+
uv pip install -e .
48
50
```
49
51
50
-
!!! note
51
-
Ensure that your Python version is compatible with the plugins (e.g., `mkdocs-awesome-nav` requires Python 3.10+)
52
+
For more details about installing from source and installing for other hardware, check out the [installation instructions](../getting_started/installation/README.md) for your hardware and head to the "Build wheel from source" section.
52
53
53
-
#### Verify Installation
54
+
For an optimized workflow when iterating on C++/CUDA kernels, see the [Incremental Compilation Workflow](./incremental_build.md) for recommendations.
54
55
55
-
Confirm that MkDocs is correctly installed:
56
+
!!! tip
57
+
vLLM is compatible with Python versions 3.9 to 3.12. However, vLLM's default [Dockerfile](gh-file:docker/Dockerfile) ships with Python 3.12 and tests in CI (except `mypy`) are run with Python 3.12.
56
58
57
-
```bash
58
-
mkdocs --version
59
-
```
59
+
Therefore, we recommend developing with Python 3.12 to minimise the chance of your local environment clashing with our CI environment.
60
60
61
-
Example output:
61
+
### Linting
62
62
63
-
```console
64
-
mkdocs, version 1.6.1 from /opt/miniconda3/envs/mkdoc/lib/python3.10/site-packages/mkdocs (Python 3.10)
65
-
```
66
-
67
-
#### Clone the `vLLM` repository
63
+
vLLM uses `pre-commit` to lint and format the codebase. See <https://pre-commit.com/#usage> if `pre-commit` is new to you. Setting up `pre-commit` is as easy as:
vLLM's `pre-commit` hooks will now run automatically every time you commit.
75
71
76
-
MkDocs comes with a built-in dev-server that lets you preview your documentation as you work on it. Make sure you're in the same directory as the `mkdocs.yml` configuration file, and then start the server by running the `mkdocs serve` command:
72
+
!!! tip "Tips"
73
+
You can manually run the `pre-commit` hooks using:
77
74
78
-
```bash
79
-
mkdocs serve
80
-
```
75
+
```bash
76
+
pre-commit run # runs on staged files
77
+
pre-commit run -a # runs on all files (short for --all-files)
78
+
```
81
79
82
-
Example output:
80
+
---
83
81
84
-
```console
85
-
INFO - Documentation built in 106.83 seconds
86
-
INFO - [22:02:02] Watching paths for changes: 'docs', 'mkdocs.yaml'
87
-
INFO - [22:02:02] Serving on http://127.0.0.1:8000/
88
-
```
82
+
Some `pre-commit` hooks only run in CI. If you need to, you can run them locally with:
89
83
90
-
#### View in Your Browser
84
+
```bash
85
+
pre-commit run --hook-stage manual markdownlint
86
+
pre-commit run --hook-stage manual mypy-3.9
87
+
```
91
88
92
-
Open up [http://127.0.0.1:8000/](http://127.0.0.1:8000/) in your browser to see a live preview:.
89
+
### Documentation
93
90
94
-
#### Learn More
91
+
MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file, <gh-file:mkdocs.yaml>.
95
92
96
-
For additional features and advanced configurations, refer to the official [MkDocs Documentation](https://www.mkdocs.org/).
93
+
Get started with:
97
94
98
-
## Testing
95
+
```bash
96
+
uv pip install -r requirements/docs.txt
97
+
```
99
98
100
-
??? console "Commands"
99
+
!!! tip
100
+
Ensure that your Python version is compatible with the plugins
# Install some common test dependencies (hardware agnostic)
128
+
uv pip install pytest pytest-asyncio
129
+
130
+
# Run all tests
131
+
pytest tests/
127
132
128
-
!!! note "Install python3-dev if Python.h is missing"
133
+
# Run tests for a single test file with detailed output
134
+
pytest -s -v tests/test_logger.py
135
+
```
136
+
137
+
!!! tip "Install python3-dev if Python.h is missing"
129
138
If any of the above commands fails with `Python.h: No such file or directory`, install
130
139
`python3-dev` with `sudo apt install python3-dev`.
131
140
132
-
!!! note
141
+
!!! warning "Warnings"
133
142
Currently, the repository is not fully checked by `mypy`.
134
143
135
-
!!! note
144
+
---
145
+
136
146
Currently, not all unit tests pass when run on CPU platforms. If you don't have access to a GPU
137
147
platform to run unit tests locally, rely on the continuous integration system to run the tests for
138
148
now.
@@ -194,8 +204,7 @@ appropriately to indicate the type of change. Please use one of the following:
194
204
The PR needs to meet the following code quality standards:
195
205
196
206
- We adhere to [Google Python style guide](https://google.github.io/styleguide/pyguide.html) and [Google C++ style guide](https://google.github.io/styleguide/cppguide.html).
197
-
- Pass all linter checks. Please use `pre-commit` to format your code. See
198
-
<https://pre-commit.com/#usage> if `pre-commit` is new to you.
207
+
- Pass all linter checks.
199
208
- The code needs to be well-documented to ensure future contributors can easily
200
209
understand the code.
201
210
- Include sufficient tests to ensure the project stays correct and robust. This
Copy file name to clipboardExpand all lines: docs/getting_started/installation/python_env_setup.inc.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
It's recommended to use [uv](https://docs.astral.sh/uv/), a very fast Python environment manager, to create and manage Python environments. Please follow the [documentation](https://docs.astral.sh/uv/#getting-started) to install `uv`. After installing `uv`, you can create a new Python environment and install vLLM using the following commands:
1
+
It's recommended to use [uv](https://docs.astral.sh/uv/), a very fast Python environment manager, to create and manage Python environments. Please follow the [documentation](https://docs.astral.sh/uv/#getting-started) to install `uv`. After installing `uv`, you can create a new Python environment using the following commands:
0 commit comments