Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
8546dd68
Commit
8546dd68
authored
Sep 06, 2022
by
Mark Forrer
Committed by
Bjorn Neergaard
Sep 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify removal for non-installed extras & optional groups (#6229)
parent
6ae844bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
5 deletions
+21
-5
docs/cli.md
+7
-1
docs/managing-dependencies.md
+9
-3
docs/pyproject.md
+5
-1
No files found.
docs/cli.md
View file @
8546dd68
...
...
@@ -144,7 +144,7 @@ This ensures that everyone using the library will get the same versions of the d
If there is no
`poetry.lock`
file, Poetry will create one after dependency resolution.
If you want to exclude one or more dependency group for the installation, you can use
If you want to exclude one or more dependency group
s
for the installation, you can use
the
`--without`
option.
```
bash
...
...
@@ -201,6 +201,12 @@ poetry install -E mysql -E pgsql
poetry install
--all-extras
```
Extras are not sensitive to
`--sync`
. Any extras not specified will always be removed.
```
bash
poetry install
--extras
"A B"
# C is removed
```
By default
`poetry`
will install your project's package every time you run
`install`
:
```
bash
...
...
docs/managing-dependencies.md
View file @
8546dd68
...
...
@@ -184,10 +184,9 @@ to remove packages from a specific group:
poetry remove mkdocs
--group
docs
```
## Synchronizing dependencies
Poetry supports what's called dependency synchronization.
What this does is ensuring
Poetry supports what's called dependency synchronization.
Dependency synchronization ensures
that the locked dependencies in the
`poetry.lock`
file are the only ones present
in the environment, removing anything that's not necessary.
...
...
@@ -198,7 +197,8 @@ poetry install --sync
```
The
`--sync`
option can be combined with any
[
dependency groups
](
{{
<
relref
"#
dependency-groups
"
>
}}) related options
to synchronize the environment with specific groups.
to synchronize the environment with specific groups. Note that extras are separate. Any
extras not selected for install are always removed, regardless of
`--sync`
.
```
bash
poetry install
--without
dev
--sync
...
...
@@ -209,3 +209,9 @@ poetry install --only dev
{{% note %}}
The
`--sync`
option replaces the
`--remove-untracked`
option which is now deprecated.
{{% /note %}}
## Layering optional groups
When you omit the
`--sync`
option, you can install any subset of optional groups without removing
those that are already installed. This is very useful, for example, in multi-stage
Docker builds, where you run
`poetry install`
multiple times in different build stages.
docs/pyproject.md
View file @
8546dd68
...
...
@@ -385,7 +385,11 @@ poetry install --extras "mysql pgsql"
poetry install
-E
mysql
-E
pgsql
```
Or, you can install all extras with the
`--all-extras`
option:
Any extras you don't specify will be removed. Note this behavior is different from
[
optional dependency groups
](
{{
<
relref
"
managing-dependencies
#
optional-groups
"
>
}}) not
selected for install, e.g. those not specified via
`install --with`
.
You can install all extras with the
`--all-extras`
option:
```
bash
poetry install
--all-extras
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment