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: docs/dependency-specification.md
+13-13
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ to [PEP 508](https://peps.python.org/pep-0508/).
41
41
In many cases, `tool.poetry.dependencies` can be replaced with `project.dependencies`.
42
42
However, there are some cases where you might still need to use `tool.poetry.dependencies`.
43
43
For example, if you want to define additional information that is not required for building
44
-
but only for locking (for example an explicit source), you can enrich dependency
44
+
but only for locking (for example, an explicit source), you can enrich dependency
45
45
information in the `tool.poetry` section.
46
46
47
47
```toml
@@ -99,7 +99,7 @@ If you only specify a major, and minor version, then minor- and patch-level chan
99
99
100
100
### Wildcard requirements
101
101
102
-
**Wildcard requirements** allow for the latest (dependencydependent) version where the wildcard is positioned.
102
+
**Wildcard requirements** allow for the latest (dependency-dependent) version where the wildcard is positioned.
103
103
104
104
`*`, `1.*` and `1.2.*` are examples of wildcard requirements.
105
105
@@ -133,7 +133,7 @@ You can specify the exact version of a package.
133
133
`1.2.3` is an example of an exact version specification.
134
134
135
135
This will tell Poetry to install this version and this version only.
136
-
If other dependencies require a different version, the solver will ultimately fail and abort any install or update procedures.
136
+
If other dependencies require a different version, the solver will ultimately fail and abort any installation or update procedures.
137
137
138
138
Exact versions can also be specified with `==` according to [PEP 440](https://peps.python.org/pep-0440/).
139
139
@@ -147,7 +147,7 @@ Not supported in `project.dependencies`.
147
147
When using `poetry add` such constraints are automatically converted into an equivalent constraint.
148
148
{{% /warning %}}
149
149
150
-
**Caret requirements** allow [SemVer](https://semver.org/) compatible updates to a specified version. An update is allowed if the new version number does not modify the left-most non-zero digit in the major, minor, patch grouping. For instance, if we previously ran `poetry add requests@^2.13.0` and wanted to update the library and ran `poetry update requests`, poetry would update us to version `2.14.0` if it was available, but would not update us to `3.0.0`. If instead we had specified the version string as `^0.1.13`, poetry would update to `0.1.14` but not `0.2.0`. `0.0.x` is not considered compatible with any other version.
150
+
**Caret requirements** allow [SemVer](https://semver.org/) compatible updates to a specified version. An update is allowed if the new version number does not modify the left-most non-zero digit in the major, minor, patch grouping. For instance, if we previously ran `poetry add requests@^2.13.0` and wanted to update the library and ran `poetry update requests`, poetry would update us to version `2.14.0` if it was available, but would not update us to `3.0.0`. If instead, we had specified the version string as `^0.1.13`, poetry would update to `0.1.14` but not `0.2.0`. `0.0.x` is not considered compatible with any other version.
151
151
152
152
Here are some more examples of caret requirements and the versions that would be allowed with them:
153
153
@@ -281,7 +281,7 @@ Since we haven’t specified any other information,
281
281
Poetry assumes that we intend to use the latest commit on the `main` branch
282
282
to build our project.
283
283
284
-
You can explicit specify which branch, commit hash or tagged ref should be usd:
284
+
You can explicitly specify which branch, commit hash or tagged ref should be usd:
Copy file name to clipboardExpand all lines: docs/faq.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -14,17 +14,17 @@ menu:
14
14
### Why is the dependency resolution process slow?
15
15
16
16
While the dependency resolver at the heart of Poetry is highly optimized and
17
-
should be fast enough for most cases, with certain sets of dependencies
17
+
should be fast enough for most cases, with certain sets of dependencies,
18
18
it can take time to find a valid solution.
19
19
20
20
This is due to the fact that not all libraries on PyPI have properly declared their metadata
21
21
and, as such, they are not available via the PyPI JSON API. At this point, Poetry has no choice
22
22
but to download the packages and inspect them to get the necessary information. This is an expensive
23
23
operation, both in bandwidth and time, which is why it seems this is a long process.
24
24
25
-
At the moment there is no way around it. However, if you notice that Poetry
25
+
At the moment, there is no way around it. However, if you notice that Poetry
26
26
is downloading many versions of a single package, you can lessen the workload
27
-
by constraining that one package in your pyproject.toml more narrowly. That way
27
+
by constraining that one package in your pyproject.toml more narrowly. That way,
28
28
Poetry does not have to sift through so many versions of it, which may speed up
29
29
the locking process considerably in some cases.
30
30
@@ -40,7 +40,7 @@ Poetry uses "major.minor.micro" version identifiers as mentioned in
40
40
41
41
Version bumps are done similar to Python's versioning:
42
42
* A major version bump (incrementing the first number) is only done for breaking changes
43
-
if a deprecation cycle is not possible and many users have to perform some manual steps
43
+
if a deprecation cycle is not possible, and many users have to perform some manual steps
44
44
to migrate from one version to the next one.
45
45
* A minor version bump (incrementing the second number) may include new features as well
46
46
as new deprecations and drop features deprecated in an earlier minor release.
@@ -64,22 +64,22 @@ Once a release of your package is published, you cannot tweak its dependencies a
64
64
– you have to do a new release but the previous one stays broken.
65
65
(Users can still work around the broken dependency by restricting it by themselves.)
66
66
67
-
To avoid such issues you can define an upper bound on your constraints,
67
+
To avoid such issues, you can define an upper bound on your constraints,
68
68
which you can increase in a new release after testing that your package is compatible
69
69
with the new major version of your dependency.
70
70
71
-
For example instead of using `>=3.4` you can use `^3.4` which allows all versions `<4.0`.
71
+
For example, instead of using `>=3.4` you can use `^3.4` which allows all versions `<4.0`.
72
72
The `^` operator works very well with libraries following [semantic versioning](https://semver.org).
73
73
74
74
However, when defining an upper bound, users of your package are not able to update
75
75
a dependency beyond the upper bound even if it does not break anything
76
76
and is fully compatible with your package.
77
-
You have to release a new version of your package with an increased upperbound first.
77
+
You have to release a new version of your package with an increased upper-bound first.
78
78
79
-
If your package will be used as a library in other packages, it might be better to avoid
79
+
If your package is used as a library in other packages, it might be better to avoid
80
80
upper bounds and thus unnecessary dependency conflicts (unless you already know for sure
81
81
that the next release of the dependency will break your package).
82
-
If your package will be used as an application, it might be worth to define an upper bound.
82
+
If your package is used as an application, it might be worth defining an upper bound.
83
83
84
84
### Is tox supported?
85
85
@@ -125,7 +125,7 @@ commands =
125
125
```
126
126
127
127
`tox` will create an `sdist` package of the project and uses `pip` to install it in a fresh environment.
128
-
Thus, dependencies are resolved by `pip` in the first place. But afterward we run Poetry,
128
+
Thus, dependencies are resolved by `pip` in the first place. But afterward, we run Poetry,
129
129
which will install the locked dependencies into the environment.
130
130
131
131
#### Use case #3
@@ -171,7 +171,7 @@ dependencies specified in `poetry.lock` into [Nox](https://nox.thea.codes/en/sta
171
171
### I don't want Poetry to manage my virtual environments. Can I disable it?
172
172
173
173
While Poetry automatically creates virtual environments to always work isolated
174
-
from the global Python installation, there are rare scenarios where the use a Poetry managed
174
+
from the global Python installation, there are rare scenarios where the use of a Poetry managed
175
175
virtual environment is not possible or preferred.
176
176
177
177
In this case, you can disable this feature by setting the `virtualenvs.create` setting to `false`:
@@ -189,7 +189,7 @@ The Poetry team strongly encourages the use of a virtual environment.
189
189
190
190
### Why is Poetry telling me that the current project's supported Python range is not compatible with one or more packages' Python requirements?
191
191
192
-
Unlike `pip`, Poetry doesn't resolve for just the Python in the current environment. Instead it makes sure that a dependency
192
+
Unlike `pip`, Poetry doesn't resolve for just the Python in the current environment. Instead, it makes sure that a dependency
193
193
is resolvable within the given Python version range in `pyproject.toml`.
194
194
195
195
Assume you have the following `pyproject.toml`:
@@ -200,15 +200,15 @@ python = "^3.7"
200
200
```
201
201
202
202
This means your project aims to be compatible with any Python version >=3.7,<4.0. Whenever you try to add a dependency
203
-
whose Python requirement doesn't match the whole range Poetry will tell you this, e.g.:
203
+
whose Python requirement doesn't match the whole range, Poetry will tell you this, e.g.:
204
204
205
205
```
206
206
The current project's supported Python range (>=3.7.0,<4.0.0) is not compatible with some of the required packages Python requirement:
207
207
- scipy requires Python >=3.7,<3.11, so it will not be installable for Python >=3.11,<4.0.0
208
208
```
209
209
210
210
Usually you will want to match the supported Python range of your project with the upper bound of the failing dependency.
211
-
Alternatively you can tell Poetry to install this dependency [only for a specific range of Python versions]({{< relref "dependency-specification#multiple-constraints-dependencies" >}}),
211
+
Alternatively, you can tell Poetry to install this dependency [only for a specific range of Python versions]({{< relref "dependency-specification#multiple-constraints-dependencies" >}}),
212
212
if you know that it's not needed in all versions.
213
213
214
214
If you do not want to set an upper bound in the metadata when building your project,
@@ -228,7 +228,7 @@ python = ">=3.7,<3.11" # used for locking dependencies
228
228
229
229
This is done to be compliant with the broader Python ecosystem.
230
230
231
-
For example, if Poetry builds a distribution for a project that uses a version that is not valid according to
231
+
For example, if Poetry builds a distribution for a project that uses a version that is not valid, according to
232
232
[PEP 440](https://peps.python.org/pep-0440), third party tools will be unable to parse the version correctly.
0 commit comments