Skip to content

Commit 73e4bde

Browse files
authored
doc(configuration): improve documentation (#6254)
# Pull Request Check List - [ ] Added **tests** for changed code. - [ ] Updated **documentation** for changed code. Bunch of improvements over `Configuration` documentation: - Better show default value of options - Add some missing `Introduced in <VERSION>` notes - Add backticks around types for better readability Will backport to `1.2` branch before final release.
1 parent ec3a6c1 commit 73e4bde

File tree

1 file changed

+83
-54
lines changed

1 file changed

+83
-54
lines changed

docs/configuration.md

+83-54
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ You can override the Cache directory by setting the `POETRY_CACHE_DIR` environme
147147

148148
### `cache-dir`
149149

150-
**Type**: string
150+
**Type**: `string`
151151

152152
The path to the cache directory used by Poetry.
153153

@@ -159,7 +159,9 @@ Defaults to one of the following directories:
159159

160160
### `experimental.system-git-client`
161161

162-
**Type**: boolean
162+
**Type**: `boolean`
163+
164+
**Default**: `false`
163165

164166
*Introduced in 1.2.0*
165167

@@ -169,33 +171,30 @@ Poetry uses `dulwich` by default for git related tasks to not rely on the availa
169171

170172
If you encounter any problems with it, set to `true` to use the system git backend.
171173

172-
Defaults to `false`.
173-
174-
### `installer.parallel`
175-
176-
**Type**: boolean
174+
### `installer.max-workers`
177175

178-
Use parallel execution when using the new (`>=1.1.0`) installer.
179-
Defaults to `true`.
176+
**Type**: `int`
180177

181-
### `installer.max-workers`
178+
**Default**: `number_of_cores + 4`
182179

183-
**Type**: int
180+
*Introduced in 1.2.0*
184181

185-
Set the maximum number of workers while using the parallel installer. Defaults to `number_of_cores + 4`.
182+
Set the maximum number of workers while using the parallel installer.
186183
The `number_of_cores` is determined by `os.cpu_count()`.
187-
If this raises a `NotImplentedError` exception `number_of_cores` is assumed to be 1.
184+
If this raises a `NotImplementedError` exception, `number_of_cores` is assumed to be 1.
188185

189186
If this configuration parameter is set to a value greater than `number_of_cores + 4`,
190187
the number of maximum workers is still limited at `number_of_cores + 4`.
191188

192189
{{% note %}}
193-
This configuration will be ignored when `installer.parallel` is set to false.
190+
This configuration is ignored when `installer.parallel` is set to `false`.
194191
{{% /note %}}
195192

196193
### `installer.no-binary`
197194

198-
**Type**: string | bool
195+
**Type**: `string | boolean`
196+
197+
**Default**: `false`
199198

200199
*Introduced in 1.2.0*
201200

@@ -240,22 +239,33 @@ Unless this is required system-wide, if configured globally, you could encounter
240239
across all your projects if incorrectly set.
241240
{{% /warning %}}
242241

242+
### `installer.parallel`
243+
244+
**Type**: `boolean`
245+
246+
**Default**: `true`
247+
248+
*Introduced in 1.1.4*
249+
250+
Use parallel execution when using the new (`>=1.1.0`) installer.
243251

244252
### `virtualenvs.create`
245253

246-
**Type**: boolean
254+
**Type**: `boolean`
255+
256+
**Default**: `true`
247257

248258
Create a new virtual environment if one doesn't already exist.
249-
Defaults to `true`.
250259

251260
If set to `false`, poetry will install dependencies into the current python environment.
252261

253262
### `virtualenvs.in-project`
254263

255-
**Type**: boolean
264+
**Type**: `boolean`
265+
266+
**Default**: `None`
256267

257268
Create the virtualenv inside the project's root directory.
258-
Defaults to `None`.
259269

260270
If not set explicitly, `poetry` by default will create virtual environment under
261271
`{cache-dir}/virtualenvs` or use the `{project-dir}/.venv` directory when one is available.
@@ -265,35 +275,27 @@ If set to `true`, the virtualenv will be created and expected in a folder named
265275

266276
If set to `false`, `poetry` will ignore any existing `.venv` directory.
267277

268-
### `virtualenvs.path`
269-
270-
**Type**: string
271-
272-
Directory where virtual environments will be created.
273-
Defaults to `{cache-dir}/virtualenvs` (`{cache-dir}\virtualenvs` on Windows).
278+
### `virtualenvs.options.always-copy`
274279

275-
### `virtualenvs.prompt`
280+
**Type**: `boolean`
276281

277-
**Type**: string
282+
**Default**: `false`
278283

279-
Format string defining the prompt to be displayed when the virtual environment is activated.
280-
The variables `project_name` and `python_version` are available for formatting.
281-
Defaults to `"{project_name}-py{python_version}"`.
284+
*Introduced in 1.2.0*
282285

283-
### `virtualenvs.options.always-copy`
286+
If set to `true` the `--always-copy` parameter is passed to `virtualenv` on creation of the virtual environment, so that
287+
all needed files are copied into it instead of symlinked.
284288

285-
**Type**: boolean
289+
### `virtualenvs.options.no-pip`
286290

287-
If set to `true` the `--always-copy` parameter is passed to `virtualenv` on creation of the venv. Thus all needed files are copied into the venv instead of symlinked.
288-
Defaults to `false`.
291+
**Type**: `boolean`
289292

290-
### `virtualenvs.options.no-pip`
293+
**Default**: `false`
291294

292-
**Type**: boolean
295+
*Introduced in 1.2.0*
293296

294-
If set to `true` the `--no-pip` parameter is passed to `virtualenv` on creation of the venv. This means when a new
295-
virtual environment is created, `pip` will not be installed in the environment.
296-
Defaults to `false`.
297+
If set to `true` the `--no-pip` parameter is passed to `virtualenv` on creation of the virtual environment. This means
298+
when a new virtual environment is created, `pip` will not be installed in the environment.
297299

298300
{{% note %}}
299301
Poetry, for its internal operations, uses the `pip` wheel embedded in the `virtualenv` package installed as a dependency
@@ -306,12 +308,15 @@ packages. This is desirable for production environments.
306308

307309
### `virtualenvs.options.no-setuptools`
308310

309-
**Type**: boolean
311+
**Type**: `boolean`
312+
313+
**Default**: `false`
314+
315+
*Introduced in 1.2.0*
310316

311-
If set to `true` the `--no-setuptools` parameter is passed to `virtualenv` on creation of the venv. This means when a new
312-
virtual environment is created, `setuptools` will not be installed in the environment. Poetry, for its internal operations,
313-
does not require `setuptools` and this can safely be set to `true`.
314-
Defaults to `false`.
317+
If set to `true` the `--no-setuptools` parameter is passed to `virtualenv` on creation of the virtual environment. This
318+
means when a new virtual environment is created, `setuptools` will not be installed in the environment. Poetry, for its
319+
internal operations, does not require `setuptools` and this can safely be set to `true`.
315320

316321
{{% warning %}}
317322
Some development tools like IDEs, make an assumption that `setuptools` (and other) packages are always present and
@@ -320,44 +325,68 @@ available within a virtual environment. This can cause some features in these to
320325

321326
### `virtualenvs.options.system-site-packages`
322327

323-
**Type**: boolean
328+
**Type**: `boolean`
329+
330+
**Default**: `false`
324331

325332
Give the virtual environment access to the system site-packages directory.
326333
Applies on virtualenv creation.
327-
Defaults to `false`.
334+
335+
### `virtualenvs.path`
336+
337+
**Type**: `string`
338+
339+
**Default**: `{cache-dir}/virtualenvs`
340+
341+
Directory where virtual environments will be created.
328342

329343
### `virtualenvs.prefer-active-python` (experimental)
330344

331-
**Type**: boolean
345+
**Type**: `boolean`
346+
347+
**Default**: `false`
348+
349+
*Introduced in 1.2.0*
350+
351+
Use currently activated Python version to create a new virtual environment.
352+
If set to `false`, Python version used during Poetry installation is used.
353+
354+
### `virtualenvs.prompt`
332355

333-
Use currently activated Python version to create a new venv.
334-
Defaults to `false`, which means Python version used during Poetry installation is used.
356+
**Type**: `string`
357+
358+
**Default**: `{project_name}-py{python_version}`
359+
360+
*Introduced in 1.2.0*
361+
362+
Format string defining the prompt to be displayed when the virtual environment is activated.
363+
The variables `project_name` and `python_version` are available for formatting.
335364

336365
### `repositories.<name>`
337366

338-
**Type**: string
367+
**Type**: `string`
339368

340369
Set a new alternative repository. See [Repositories]({{< relref "repositories" >}}) for more information.
341370

342371
### `http-basic.<name>`:
343372

344-
**Types**: string, string
373+
**Type**: `(string, string)`
345374

346375
Set repository credentials (`username` and `password`) for `<name>`.
347376
See [Repositories - Configuring credentials]({{< relref "repositories#configuring-credentials" >}})
348377
for more information.
349378

350379
### `pypi-token.<name>`:
351380

352-
**Type**: string
381+
**Type**: `string`
353382

354383
Set repository credentials (using an API token) for `<name>`.
355384
See [Repositories - Configuring credentials]({{< relref "repositories#configuring-credentials" >}})
356385
for more information.
357386

358387
### `certificates.<name>.cert`:
359388

360-
**Type**: string | bool
389+
**Type**: `string | boolean`
361390

362391
Set custom certificate authority for repository `<name>`.
363392
See [Repositories - Configuring credentials - Custom certificate authority]({{< relref "repositories#custom-certificate-authority-and-mutual-tls-authentication" >}})
@@ -368,7 +397,7 @@ repository.
368397

369398
### `certificates.<name>.client-cert`:
370399

371-
**Type**: string
400+
**Type**: `string`
372401

373402
Set client certificate for repository `<name>`.
374403
See [Repositories - Configuring credentials - Custom certificate authority]({{< relref "repositories#custom-certificate-authority-and-mutual-tls-authentication" >}})

0 commit comments

Comments
 (0)