-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: detail a bit more
add
possibilities
- Loading branch information
1 parent
53374df
commit 51c975d
Showing
1 changed file
with
16 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,18 +288,28 @@ poetry will choose a suitable one based on the available package versions. | |
poetry add requests pendulum | ||
``` | ||
|
||
You also can specify a constraint when adding a package, like so: | ||
You can also specify a constraint when adding a package: | ||
|
||
```bash | ||
# Allow >=2.0.5, <3.0.0 versions | ||
poetry add pendulum@^2.0.5 | ||
|
||
# Allow >=2.0.5, <2.1.0 versions | ||
poetry add pendulum@~2.0.5 | ||
|
||
# Allow >=2.0.5 versions, without upper bound | ||
poetry add "pendulum>=2.0.5" | ||
poetry add "pendulum==2.0.5" | ||
|
||
# Allow only 2.0.5 version | ||
poetry add pendulum==2.0.5 | ||
``` | ||
|
||
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 | ||
by using the specified constraint. If you want to get the latest version of an already | ||
present dependency you can use the special `latest` constraint: | ||
by using the specified constraint. | ||
|
||
If you want to get the latest version of an already | ||
present dependency, you can use the special `latest` constraint: | ||
|
||
```bash | ||
poetry add pendulum@latest | ||
|
@@ -320,8 +330,7 @@ or use ssh instead of https: | |
```bash | ||
poetry add git+ssh://[email protected]/sdispater/pendulum.git | ||
|
||
or alternatively: | ||
|
||
# or alternatively: | ||
poetry add git+ssh://[email protected]:sdispater/pendulum.git | ||
``` | ||
|
||
|
@@ -332,8 +341,7 @@ you can specify it when using `add`: | |
poetry add git+https://github.com/sdispater/pendulum.git#develop | ||
poetry add git+https://github.com/sdispater/pendulum.git#2.0.5 | ||
|
||
or using SSH instead: | ||
|
||
# or using SSH instead: | ||
poetry add git+ssh://github.com/sdispater/pendulum.git#develop | ||
poetry add git+ssh://github.com/sdispater/pendulum.git#2.0.5 | ||
``` | ||
|