Skip to content

Commit 160fc37

Browse files
authored
FIX: Dependency documentation with double quotes where required (#9946)
## Summary Documentation steps resulted in errors due to single quotes when adding project dependencies: ``` shell >uv add 'httpx>0.1.0' error: Failed to parse: `'httpx` Caused by: Expected package name starting with an alphanumeric character, found `'` 'httpx ^ ``` ``` shell >uv add 'PyQt5; sys_platform == "windows" error: Failed to parse: `'PyQt5;` Caused by: Expected package name starting with an alphanumeric character, found `'` 'PyQt5; ^ ``` ## Testing Steps - Follow new documentation steps Tested on: - [x] Windows
1 parent 4091cce commit 160fc37

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/concepts/projects/dependencies.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The dependency will include a constraint, e.g., `>=0.27.2`, for the most recent,
4444
of the package. An alternative constraint can be provided:
4545

4646
```console
47-
$ uv add 'httpx>=0.20'
47+
$ uv add "httpx>=0.20"
4848
```
4949

5050
When adding a dependency from a source other than a package registry, uv will add an entry in the
@@ -71,7 +71,7 @@ httpx = { git = "https://github.com/encode/httpx" }
7171
If a dependency cannot be used, uv will display an error.:
7272

7373
```console
74-
$ uv add 'httpx>9999'
74+
$ uv add "httpx>9999"
7575
× No solution found when resolving dependencies:
7676
╰─▶ Because only httpx<=1.0.0b0 is available and your project depends on httpx>9999,
7777
we can conclude that your project's requirements are unsatisfiable.
@@ -96,7 +96,7 @@ references to the dependency, it will also be removed.
9696
To change an existing dependency, e.g., to use a different constraint for `httpx`:
9797

9898
```console
99-
$ uv add 'httpx>0.1.0'
99+
$ uv add "httpx>0.1.0"
100100
```
101101

102102
!!! note
@@ -106,7 +106,7 @@ $ uv add 'httpx>0.1.0'
106106
constraints. To force the package version to update to the latest within the constraints, use `--upgrade-package <name>`, e.g.:
107107

108108
```console
109-
$ uv add 'httpx>0.1.0' --upgrade-package httpx
109+
$ uv add "httpx>0.1.0" --upgrade-package httpx
110110
```
111111

112112
See the [lockfile](./sync.md#upgrading-locked-package-versions) documentation for more details
@@ -127,7 +127,7 @@ use [environment markers](https://peps.python.org/pep-0508/#environment-markers)
127127
For example, to install `jax` on Linux, but not on Windows or macOS:
128128

129129
```console
130-
$ uv add 'jax; sys_platform == "linux"'
130+
$ uv add "jax; sys_platform == 'linux'"
131131
```
132132

133133
The resulting `pyproject.toml` will then include the environment marker in the dependency
@@ -144,7 +144,7 @@ dependencies = ["jax; sys_platform == 'linux'"]
144144
Similarly, to include `numpy` on Python 3.11 and later:
145145

146146
```console
147-
$ uv add 'numpy; python_version >= "3.11"'
147+
$ uv add "numpy; python_version >= '3.11'"
148148
```
149149

150150
See Python's [environment marker](https://peps.python.org/pep-0508/#environment-markers)

0 commit comments

Comments
 (0)