Skip to content

Commit d700f9e

Browse files
2 parents a0a6150 + a8987e3 commit d700f9e

26 files changed

+467
-354
lines changed

Diff for: .pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ repos:
2020
- id: debug-statements
2121
- id: check-docstring-first
2222

23-
- repo: https://github.com/psf/black
24-
rev: 23.7.0
23+
- repo: https://github.com/psf/black-pre-commit-mirror
24+
rev: 23.9.0
2525
hooks:
2626
- id: black
2727

2828
- repo: https://github.com/pre-commit/pre-commit
29-
rev: v3.3.3
29+
rev: v3.4.0
3030
hooks:
3131
- id: validate_manifest
3232

3333
- repo: https://github.com/astral-sh/ruff-pre-commit
34-
rev: v0.0.286
34+
rev: v0.0.287
3535
hooks:
3636
- id: ruff

Diff for: docs/_index.md

+95-97
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,85 @@ on Linux, macOS and Windows.
2323

2424
## Installation
2525

26+
{{% warning %}}
27+
Poetry should always be installed in a dedicated virtual environment to isolate it from the rest of your system.
28+
In no case, it should be installed in the environment of the project that is to be managed by Poetry.
29+
This ensures that Poetry's own dependencies will not be accidentally upgraded or uninstalled.
30+
(Each of the following installation methods ensures that Poetry is installed into an isolated environment.)
31+
{{% /warning %}}
32+
2633
{{% note %}}
2734
If you are viewing documentation for the development branch, you may wish to install a preview or development version of Poetry.
2835
See the **advanced** installation instructions to use a preview or alternate version of Poetry.
2936
{{% /note %}}
3037

31-
{{< tabs tabTotal="4" tabID1="installing-with-the-official-installer" tabID2="installing-with-pipx" tabID3="installing-manually" tabID4="ci-recommendations" tabName1="With the official installer" tabName2="With pipx" tabName3="Manually (advanced)" tabName4="CI recommendations">}}
38+
{{< tabs tabTotal="4" tabID1="installing-with-pipx" tabID2="installing-with-the-official-installer" tabID3="installing-manually" tabID4="ci-recommendations" tabName1="With pipx" tabName2="With the official installer" tabName3="Manually (advanced)" tabName4="CI recommendations">}}
39+
40+
{{< tab tabID="installing-with-pipx" >}}
41+
42+
[`pipx`](https://github.com/pypa/pipx) is used to install Python CLI applications globally while still isolating them in virtual environments.
43+
`pipx` will manage upgrades and uninstalls when used to install Poetry.
44+
45+
{{< steps >}}
46+
{{< step >}}
47+
**Install Poetry**
48+
49+
```bash
50+
pipx install poetry
51+
```
52+
{{< /step >}}
53+
{{< step >}}
54+
**Install Poetry (advanced)**
55+
56+
`pipx` can install different versions of Poetry, using the same syntax as pip:
57+
58+
```bash
59+
pipx install poetry==1.2.0
60+
```
61+
62+
`pipx` can also install versions of Poetry in parallel, which allows for easy testing of alternate or prerelease
63+
versions. Each version is given a unique, user-specified suffix, which will be used to create a unique binary name:
64+
65+
```bash
66+
pipx install [email protected] poetry==1.2.0
67+
68+
```
69+
70+
```bash
71+
pipx install --suffix=@preview --pip-args=--pre poetry
72+
poetry@preview --version
73+
```
74+
75+
Finally, `pipx` can install any valid [pip requirement spec](https://pip.pypa.io/en/stable/cli/pip_install/), which
76+
allows for installations of the development version from `git`, or even for local testing of pull requests:
77+
78+
```bash
79+
pipx install --suffix @master git+https://github.com/python-poetry/poetry.git@master
80+
pipx install --suffix @pr1234 git+https://github.com/python-poetry/poetry.git@refs/pull/1234/head
81+
```
82+
83+
{{< /step >}}
84+
{{< step >}}
85+
**Update Poetry**
86+
87+
```bash
88+
pipx upgrade poetry
89+
```
90+
{{< /step >}}
91+
{{< step >}}
92+
**Uninstall Poetry**
93+
94+
```bash
95+
pipx uninstall poetry
96+
```
97+
{{< /step >}}
98+
{{< /steps >}}
3299

100+
{{< /tab >}}
33101
{{< tab tabID="installing-with-the-official-installer" >}}
34102

35-
We provide a custom installer that will install Poetry in a new virtual environment to isolate it
36-
from the rest of your system. This ensures that dependencies will not be accidentally upgraded or
37-
uninstalled, and allows Poetry to manage its own environment.
103+
We provide a custom installer that will install Poetry in a new virtual environment
104+
and allows Poetry to manage its own environment.
38105

39106
{{< steps >}}
40107
{{< step >}}
@@ -145,6 +212,11 @@ If you see something like `Poetry (version 1.2.0)`, your install is ready to use
145212

146213
Poetry is able to update itself when installed using the official installer.
147214

215+
{{% warning %}}
216+
Especially on Windows, `self update` may be problematic
217+
so that a re-install with the installer should be preferred.
218+
{{% /warning %}}
219+
148220
```bash
149221
poetry self update
150222
```
@@ -193,69 +265,6 @@ Also remove ~/.poetry/bin from your `$PATH` in your shell configuration, if it i
193265
{{< /step >}}
194266
{{< /steps >}}
195267
196-
{{< /tab >}}
197-
{{< tab tabID="installing-with-pipx" >}}
198-
199-
Using [`pipx`](https://github.com/pypa/pipx) to install Poetry is also possible and fully supported.
200-
201-
`pipx` is used to install Python CLI applications globally while still isolating them in virtual environments.
202-
`pipx` will manage upgrades and uninstalls when used to install Poetry.
203-
204-
{{< steps >}}
205-
{{< step >}}
206-
**Install Poetry**
207-
208-
```bash
209-
pipx install poetry
210-
```
211-
{{< /step >}}
212-
{{< step >}}
213-
**Install Poetry (advanced)**
214-
215-
`pipx` can be install different versions of Poetry, using the same syntax as pip:
216-
217-
```bash
218-
pipx install poetry==1.2.0
219-
```
220-
221-
`pipx` can also install versions of Poetry in parallel, which allows for easy testing of alternate or prerelease
222-
versions. Each version is given a unique, user-specified suffix, which will be used to create a unique binary name:
223-
224-
```bash
225-
pipx install [email protected] poetry==1.2.0
226-
227-
```
228-
229-
```bash
230-
pipx install --suffix=@preview --pip-args=--pre poetry
231-
poetry@preview --version
232-
```
233-
234-
Finally, `pipx` can install any valid [pip requirement spec](https://pip.pypa.io/en/stable/cli/pip_install/), which
235-
allows for installations of the development version from `git`, or even for local testing of pull requests:
236-
237-
```bash
238-
pipx install --suffix @master git+https://github.com/python-poetry/poetry.git@master
239-
pipx install --suffix @pr1234 git+https://github.com/python-poetry/poetry.git@refs/pull/1234/head
240-
```
241-
242-
{{< /step >}}
243-
{{< step >}}
244-
**Update Poetry**
245-
246-
```bash
247-
pipx upgrade poetry
248-
```
249-
{{< /step >}}
250-
{{< step >}}
251-
**Uninstall Poetry**
252-
253-
```bash
254-
pipx uninstall poetry
255-
```
256-
{{< /step >}}
257-
{{< /steps >}}
258-
259268
{{< /tab >}}
260269
{{< tab tabID="installing-manually" >}}
261270
@@ -280,19 +289,34 @@ To uninstall Poetry, simply delete the entire `$VENV_PATH` directory.
280289
Unlike development environments, where making use of the latest tools is desirable, in a CI environment reproducibility
281290
should be made the priority. Here are some suggestions for installing Poetry in such an environment.
282291
283-
**Installation method**
292+
**Version pinning**
293+
294+
Whatever method you use, it is highly recommended to explicitly control the version of Poetry used, so that you are able
295+
to upgrade after performing your own validation. Each install method has a different syntax for setting the version that
296+
is used in the following examples.
297+
298+
**Using pipx**
299+
300+
Just as `pipx` is a powerful tool for development use, it is equally useful in a CI environment
301+
and should be one of your top choices for use of Poetry in CI.
302+
303+
```bash
304+
pipx install poetry==1.2.0
305+
```
306+
307+
**Using install.python-poetry.org**
284308
309+
{{% note %}}
285310
The official installer script ([install.python-poetry.org](https://install.python-poetry.org)) offers a streamlined and
286311
simplified installation of Poetry, sufficient for developer use or for simple pipelines. However, in a CI environment
287312
the other two supported installation methods (pipx and manual) should be seriously considered.
288-
289-
**Using install.python-poetry.org**
313+
{{% /note %}}
290314
291315
Downloading a copy of the installer script to a place accessible by your CI pipelines (or maintaining a copy of the
292316
[repository](https://github.com/python-poetry/install.python-poetry.org)) is strongly suggested, to ensure your
293317
pipeline's stability and to maintain control over what code is executed.
294318

295-
By default the installer will install to a user-specific directory. In more complex pipelines that may make accessing
319+
By default, the installer will install to a user-specific directory. In more complex pipelines that may make accessing
296320
Poetry difficult (especially in cases like multi-stage container builds). It is highly suggested to make use of
297321
`$POETRY_HOME` when using the official installer in CI, as that way the exact paths can be controlled.
298322

@@ -302,17 +326,6 @@ python3 install-poetry.py --version 1.2.0
302326
$POETRY_HOME/bin/poetry --version
303327
```
304328

305-
**Using pipx**
306-
307-
Just as `pipx` is a powerful tool for development use, it is equally useful in a CI environment. It takes the same steps
308-
the installer does to safely install Poetry isolated from the rest of your system, but is generic and able to do this
309-
for any Python package, with a syntax/usage that is similar to `pip`. `pipx` should be considered equally supported in
310-
comparison to the official installer, and should be one of your top choices for use of Poetry in CI.
311-
312-
```bash
313-
pipx install poetry==1.2.0
314-
```
315-
316329
**Using pip (aka manually)**
317330

318331
For maximum control in your CI environment, installation with `pip` is fully supported and something you should
@@ -332,21 +345,6 @@ as the target environment managed by Poetry. If Poetry and your project are inst
332345
is likely to upgrade or uninstall its own dependencies (causing hard-to-debug and understand errors).
333346
{{% /note %}}
334347

335-
**Version pinning**
336-
337-
Whatever method you use, it is highly recommended to explicitly control the version of Poetry used, so that you are able
338-
to upgrade after performing your own validation. Each install method has a different syntax for setting the version --
339-
the following are some simple examples:
340-
341-
```bash
342-
curl -sSL https://install.python-poetry.org | python3 - --version 1.2.0
343-
# or
344-
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.2.0 python3 -
345-
346-
pipx install poetry==1.2.0
347-
348-
/path/to/venv/bin/pip install poetry==1.2.0
349-
```
350348
{{< /tab >}}
351349
{{< /tabs >}}
352350

Diff for: docs/cli.md

+16
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,17 @@ The table below illustrates the effect of these rules with concrete examples.
698698
| prerelease | 1.0.3a0 | 1.0.3a1 |
699699
| prerelease | 1.0.3b0 | 1.0.3b1 |
700700

701+
The option `--next-phase` allows the increment of prerelease phase versions.
702+
703+
| rule | before | after |
704+
|-------------------------|----------|----------|
705+
| prerelease --next-phase | 1.0.3a0 | 1.0.3b0 |
706+
| prerelease --next-phase | 1.0.3b0 | 1.0.3rc0 |
707+
| prerelease --next-phase | 1.0.3rc0 | 1.0.3 |
708+
701709
### Options
702710

711+
* `--next-phase`: Increment the phase of the current version.
703712
* `--short (-s)`: Output the version number only.
704713
* `--dry-run`: Do not update pyproject.toml file.
705714

@@ -880,6 +889,13 @@ Use of these commands will create the required `pyproject.toml` and `poetry.lock
880889
[configuration directory]({{< relref "configuration" >}}).
881890
{{% /note %}}
882891

892+
{{% warning %}}
893+
Especially on Windows, `self` commands that update or remove packages may be problematic
894+
so that other methods for installing plugins and updating Poetry are recommended.
895+
See [Using plugins]({{< relref "plugins#using-plugins" >}}) and
896+
[Installing Poetry]({{< relref "docs#installation" >}}) for more information.
897+
{{% /warning %}}
898+
883899
### self add
884900

885901
The `self add` command installs Poetry plugins and make them available at runtime. Additionally, it can

Diff for: docs/faq.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ In this case, you can disable this feature by setting the `virtualenvs.create` s
163163
poetry config virtualenvs.create false
164164
```
165165

166-
### Why is Poetry telling me that the current project's Python requirement is not compatible with one or more packages' Python requirements?
166+
### Why is Poetry telling me that the current project's supported Python range is not compatible with one or more packages' Python requirements?
167167

168168
Unlike `pip`, Poetry doesn't resolve for just the Python in the current environment. Instead it makes sure that a dependency
169169
is resolvable within the given Python version range in `pyproject.toml`.
@@ -179,18 +179,18 @@ This means your project aims to be compatible with any Python version >=3.7,<4.0
179179
whose Python requirement doesn't match the whole range Poetry will tell you this, e.g.:
180180

181181
```
182-
The current project's Python requirement (>=3.7.0,<4.0.0) is not compatible with some of the required packages Python requirement:
182+
The current project's supported Python range (>=3.7.0,<4.0.0) is not compatible with some of the required packages Python requirement:
183183
- scipy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.11,<4.0.0
184184
```
185185

186-
Usually you will want to match the Python requirement of your project with the upper bound of the failing dependency.
187-
Alternative you can tell Poetry to install this dependency [only for a specific range of Python versions]({{< relref "dependency-specification#multiple-constraints-dependencies" >}}),
186+
Usually you will want to match the supported Python range of your project with the upper bound of the failing dependency.
187+
Alternatively you can tell Poetry to install this dependency [only for a specific range of Python versions]({{< relref "dependency-specification#multiple-constraints-dependencies" >}}),
188188
if you know that it's not needed in all versions.
189189

190190

191191
### Why does Poetry enforce PEP 440 versions?
192192

193-
This is done so to be compliant with the broader Python ecosystem.
193+
This is done to be compliant with the broader Python ecosystem.
194194

195195
For example, if Poetry builds a distribution for a project that uses a version that is not valid according to
196196
[PEP 440](https://peps.python.org/pep-0440), third party tools will be unable to parse the version correctly.

Diff for: docs/managing-environments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ By default, Poetry will try to use the Python version used during Poetry's insta
2222
to create the virtual environment for the current project.
2323

2424
However, for various reasons, this Python version might not be compatible
25-
with the `python` requirement of the project. In this case, Poetry will try
25+
with the `python` range supported by the project. In this case, Poetry will try
2626
to find one that is and use it. If it's unable to do so then you will be prompted
2727
to activate one explicitly, see [Switching environments](#switching-between-environments).
2828

0 commit comments

Comments
 (0)