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
a3aafa84
Unverified
Commit
a3aafa84
authored
Jun 20, 2022
by
Bartosz Sokorski
Committed by
GitHub
Jun 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: Add paragraph about @ operator (#5822)
Co-authored-by: Bjorn Neergaard <bjorn@neersighted.com>
parent
bf9e9cf8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
docs/cli.md
+4
-0
docs/dependency-specification.md
+33
-0
No files found.
docs/cli.md
View file @
a3aafa84
...
@@ -304,6 +304,10 @@ poetry add "pendulum>=2.0.5"
...
@@ -304,6 +304,10 @@ poetry add "pendulum>=2.0.5"
poetry add
pendulum
==
2.0.5
poetry add
pendulum
==
2.0.5
```
```
{{% note %}}
See the
[
Dependency specification
](
{{
<
relref
"
dependency-specification
#
using-the--operator
"
>
}}) page for more information about the
`@`
operator.
{{% /note %}}
If you try to add a package that is already present, you will get an error.
If you try to add a package that is already present, you will get an error.
However, if you specify a constraint, like above, the dependency will be updated
However, if you specify a constraint, like above, the dependency will be updated
by using the specified constraint.
by using the specified constraint.
...
...
docs/dependency-specification.md
View file @
a3aafa84
...
@@ -84,6 +84,39 @@ You can specify the exact version of a package.
...
@@ -84,6 +84,39 @@ You can specify the exact version of a package.
This will tell Poetry to install this version and this version only.
This will tell Poetry to install this version and this version only.
If other dependencies require a different version, the solver will ultimately fail and abort any install or update procedures.
If other dependencies require a different version, the solver will ultimately fail and abort any install or update procedures.
### Using the `@` operator
When adding dependencies via
`poetry add`
, you can use the
`@`
operator.
This is understood similarly to the
`==`
syntax, but also allows prefixing any
specifiers that are valid in
`pyproject.toml`
. For example:
```
shell
poetry add django@^4.0.0
```
The above would translate to the following entry in
`pyproject.toml`
:
```
toml
Django
=
"^4.0.0"
```
The special keyword
`latest`
is also understood by the
`@`
operator:
```
shell
poetry add django@latest
```
The above would translate to the following entry in
`pyproject.toml`
, assuming the latest release of
`django`
is
`4.0.5`
:
```
toml
Django
=
"^4.0.5"
```
#### Extras
Extras and
`@`
can be combined as one might expect (
`package[extra]@version`
):
```
shell
poetry add django[bcrypt]@^4.0.0
```
## `git` dependencies
## `git` dependencies
To depend on a library located in a
`git`
repository,
To depend on a library located in a
`git`
repository,
...
...
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