-
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.
Update documentation for the add command
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 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 |
---|---|---|
|
@@ -182,12 +182,35 @@ 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: | ||
|
||
```bash | ||
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: | ||
|
||
```bash | ||
poetry add pendulum@latest | ||
``` | ||
|
||
You can also add `git` dependencies: | ||
|
||
```bash | ||
poetry add git+https://github.com/sdispater/pendulum.git | ||
``` | ||
|
||
If you need to checkout a specific branch, tag or revision, | ||
you can specify it when using `add`: | ||
|
||
```bash | ||
poetry add git+https://github.com/sdispater/pendulum.git@develop | ||
poetry add git+https://github.com/sdispater/[email protected] | ||
``` | ||
|
||
or make them point to a local directory or file: | ||
|
||
```bash | ||
|