Commit 37ec1447 by Mohamed Seleem Committed by Sébastien Eustace

Install: option to skip current project package (#757)

parent 75e3bbae
...@@ -340,9 +340,28 @@ poetry install --extras "mysql pgsql" ...@@ -340,9 +340,28 @@ poetry install --extras "mysql pgsql"
poetry install -E mysql -E pgsql poetry install -E mysql -E pgsql
``` ```
By default `poetry` will install your project's package everytime you run `install`:
```bash
$ poetry install
Installing dependencies from lock file
Nothing to install or update
- Installing <your-package-name> (x.x.x)
```
If you want to skip this installation, use the `--no-root` option.
```bash
poetry install --no-root
```
#### Options #### Options
* `--no-dev`: Do not install dev dependencies. * `--no-dev`: Do not install dev dependencies.
* `--no-root`: Do not install the root package (your project).
* `-E|--extras`: Features to install (multiple values allowed). * `-E|--extras`: Features to install (multiple values allowed).
### update ### update
......
...@@ -124,9 +124,28 @@ poetry install --extras "mysql pgsql" ...@@ -124,9 +124,28 @@ poetry install --extras "mysql pgsql"
poetry install -E mysql -E pgsql poetry install -E mysql -E pgsql
``` ```
By default `poetry` will install your project's package everytime you run `install`:
```bash
$ poetry install
Installing dependencies from lock file
Nothing to install or update
- Installing <your-package-name> (x.x.x)
```
If you want to skip this installation, use the `--no-root` option.
```bash
poetry install --no-root
```
### Options ### Options
* `--no-dev`: Do not install dev dependencies. * `--no-dev`: Do not install dev dependencies.
* `--no-root`: Do not install the root package (your project).
* `--extras (-E)`: Features to install (multiple values allowed). * `--extras (-E)`: Features to install (multiple values allowed).
## update ## update
......
...@@ -9,6 +9,7 @@ class InstallCommand(EnvCommand): ...@@ -9,6 +9,7 @@ class InstallCommand(EnvCommand):
install install
{ --no-dev : Do not install dev dependencies. } { --no-dev : Do not install dev dependencies. }
{ --no-root : Do not install the root package (your project). }
{ --dry-run : Outputs the operations but will not execute anything { --dry-run : Outputs the operations but will not execute anything
(implicitly enables --verbose). } (implicitly enables --verbose). }
{ --E|extras=* : Extra sets of dependencies to install. } { --E|extras=* : Extra sets of dependencies to install. }
...@@ -55,6 +56,9 @@ exist it will look for <comment>pyproject.toml</> and do the same. ...@@ -55,6 +56,9 @@ exist it will look for <comment>pyproject.toml</> and do the same.
if return_code != 0: if return_code != 0:
return return_code return return_code
if not self.option("no-root"):
return 0
try: try:
builder = SdistBuilder(self.poetry, NullEnv(), NullIO()) builder = SdistBuilder(self.poetry, NullEnv(), NullIO())
except ModuleOrPackageNotFound: except ModuleOrPackageNotFound:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment