Skip to content

Commit

Permalink
Install: option to skip current project package
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Seleem committed Mar 7, 2019
1 parent 75e3bba commit 1ff6a95
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,28 @@ poetry install --extras "mysql 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

* `--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).

### update
Expand Down
19 changes: 19 additions & 0 deletions docs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,28 @@ poetry install --extras "mysql 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

* `--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).

## update
Expand Down
4 changes: 4 additions & 0 deletions poetry/console/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class InstallCommand(EnvCommand):
install
{ --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
(implicitly enables --verbose). }
{ --E|extras=* : Extra sets of dependencies to install. }
Expand Down Expand Up @@ -55,6 +56,9 @@ def handle(self):
if return_code != 0:
return return_code

if not self.option("no-root"):
return 0

try:
builder = SdistBuilder(self.poetry, NullEnv(), NullIO())
except ModuleOrPackageNotFound:
Expand Down

0 comments on commit 1ff6a95

Please sign in to comment.