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
Copy file name to clipboardExpand all lines: package-structure-code/declare-dependencies.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,35 @@ Specifying dependencies in your `pyproject.toml` file ensures that your package
37
37
Users automatically get the packages your code needs to run. For instance, if your package requires Pandas to run properly, Pandas will be installed into the users' environment when they install your package using uv, pip or conda, if you specify it as a dependency in your pyproject.toml file.
38
38
39
39
:::{tip}
40
-
You can control which versions of dependencies are compatible with your package using specifiers. You will learn more about dependency specifiers below.
40
+
You can control which versions of dependencies are compatible with your package using specifiers. You will learn more about dependency specifiers in the sections below.
41
+
:::
42
+
43
+
## Version specifiers
44
+
45
+
Version specifiers control which versions of a dependency work with your
46
+
package. Use them to specify minimum versions, exclude buggy releases, or
47
+
set version ranges.
48
+
49
+
### Common operators
50
+
51
+
-**`>=`** - Minimum version set: `numpy>=1.20` (This is the most common approach and is recommended)
52
+
-**`==`** - Exact version: `requests==2.28.0` (Avoid pinning dependencies like this unless absolutely necessary)
0 commit comments