Skip to content

Commit 776fcb8

Browse files
authored
Change docs to use --only main syntax, and add missing argument to Dockerfile example (#8921)
Swap --only main and --without dev examples
1 parent 3cad429 commit 776fcb8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/cli.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ poetry install --without test,docs
153153
```
154154

155155
{{% note %}}
156-
The `--no-dev` option is now deprecated. You should use the `--without dev` notation instead.
156+
The `--no-dev` option is now deprecated. You should use the `--only main` or `--without dev` notation instead.
157157
{{% /note %}}
158158

159159
You can also select optional dependency groups with the `--with` option.
@@ -262,7 +262,7 @@ is set to `false` because the old installer always compiles source files to byte
262262
* `--extras (-E)`: Features to install (multiple values allowed).
263263
* `--all-extras`: Install all extra features (conflicts with --extras).
264264
* `--compile`: Compile Python source files to bytecode.
265-
* `--no-dev`: Do not install dev dependencies. (**Deprecated**, use `--without dev` or `--only main` instead)
265+
* `--no-dev`: Do not install dev dependencies. (**Deprecated**, use `--only main` or `--without dev` instead)
266266
* `--remove-untracked`: Remove dependencies not presented in the lock file. (**Deprecated**, use `--sync` instead)
267267

268268
{{% note %}}
@@ -301,7 +301,7 @@ You can do this using the `add` command.
301301
* `--with`: The optional dependency groups to include.
302302
* `--only`: The only dependency groups to include.
303303
* `--dry-run` : Outputs the operations but will not execute anything (implicitly enables --verbose).
304-
* `--no-dev` : Do not update the development dependencies. (**Deprecated**, use `--without dev` or `--only main` instead)
304+
* `--no-dev` : Do not update the development dependencies. (**Deprecated**, use `--only main` or `--without dev` instead)
305305
* `--lock` : Do not perform install (only update the lockfile).
306306

307307
{{% note %}}
@@ -509,7 +509,7 @@ required by
509509
* `--why`: When showing the full list, or a `--tree` for a single package, display whether they are a direct dependency or required by other packages.
510510
* `--with`: The optional dependency groups to include.
511511
* `--only`: The only dependency groups to include.
512-
* `--no-dev`: Do not list the dev dependencies. (**Deprecated**, use `--without dev` or `--only main` instead)
512+
* `--no-dev`: Do not list the dev dependencies. (**Deprecated**, use `--only main` or `--without dev` instead)
513513
* `--tree`: List the dependencies as a tree.
514514
* `--latest (-l)`: Show the latest version.
515515
* `--outdated (-o)`: Show the latest version but only for packages that are outdated.

docs/faq.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ For example, you might have a Dockerfile that looks something like this:
214214
FROM python
215215
COPY pyproject.toml poetry.lock .
216216
COPY src/ ./src
217-
RUN pip install poetry && poetry install --without dev
217+
RUN pip install poetry && poetry install --only main
218218
```
219219

220220
As soon as *any* source file changes, the cache for the `RUN` layer will be invalidated, which forces all 3rd party dependencies (likely the slowest step out of these) to be installed again if you changed any files in `src/`.
@@ -229,9 +229,9 @@ This might look something like this:
229229
```text
230230
FROM python
231231
COPY pyproject.toml poetry.lock .
232-
RUN pip install poetry && poetry install --no-root --no-directory
232+
RUN pip install poetry && poetry install --only main --no-root --no-directory
233233
COPY src/ ./src
234-
RUN poetry install --without dev
234+
RUN poetry install --only main
235235
```
236236

237237
The two key options we are using here are `--no-root` (skips installing the project source) and `--no-directory` (skips installing any local directory path dependencies, you can omit this if you don't have any).

0 commit comments

Comments
 (0)