You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/options.md
+18-31Lines changed: 18 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -402,7 +402,7 @@ This option can also be set using the [command-line option](#command-line)
402
402
> Manually set the Python compatibility of your project
403
403
404
404
By default, cibuildwheel reads your package's Python compatibility from
405
-
`pyproject.toml` following [PEP621](https://www.python.org/dev/peps/pep-0621/)
405
+
`pyproject.toml` following the [project metadata specification](https://packaging.python.org/en/latest/specifications/declaring-project-metadata/)
406
406
or from `setup.cfg`; finally it will try to inspect the AST of `setup.py` for a
407
407
simple keyword assignment in a top level function call. If you need to override
408
408
this behaviour for some reason, you can use this option.
@@ -416,42 +416,29 @@ Default: reads your package's Python compatibility from `pyproject.toml`
416
416
`setup.py``setup(python_requires="...")`. If not found, cibuildwheel assumes
417
417
the package is compatible with all versions of Python that it can build.
418
418
419
-
420
419
!!! note
421
-
Rather than using this option, it's recommended you set
422
-
`project.requires-python` in `pyproject.toml` instead:
423
-
Example `pyproject.toml`:
420
+
Rather than using this environment variable, it's recommended you set this value
421
+
statically in a way that your build backend can use it, too. This ensures
422
+
that your package's metadata is correct when published on PyPI. This
423
+
cibuildwheel-specific option is provided as an override, and therefore is only
424
+
available in environment variable form.
425
+
426
+
- If you have a `pyproject.toml` containing a `[project]` table, you can
427
+
specify `requires-python` there.
424
428
429
+
```toml
425
430
[project]
431
+
...
426
432
requires-python = ">=3.6"
433
+
```
427
434
428
-
# Aside - in pyproject.toml you should always specify minimal build
429
-
# system options, like this:
430
-
431
-
[build-system]
432
-
requires = ["setuptools>=42", "wheel"]
433
-
build-backend = "setuptools.build_meta"
434
-
435
-
436
-
Currently, setuptools has not yet added support for reading this value from
437
-
pyproject.toml yet, and so does not copy it to Requires-Python in the wheel
438
-
metadata. This mechanism is used by pip to scan through older versions of
439
-
your package until it finds a release compatible with the current version
440
-
of Python compatible when installing, so it is an important value to set if
441
-
you plan to drop support for a version of Python in the future.
442
-
443
-
If you don't want to list this value twice, you can also use the setuptools
444
-
specific location in `setup.cfg` and cibuildwheel will detect it from
445
-
there. Example `setup.cfg`:
446
-
447
-
[options]
448
-
python_requires = ">=3.6"
449
-
435
+
Note that not all build backends fully support using a `[project]` table yet;
436
+
specifically setuptools just added experimental support in version 61.
437
+
Adding `[project]` to `pyproject.toml` requires all the other supported
438
+
values to be specified there, or to be listed in `dynamic`.
450
439
451
-
This option is not available in `pyproject.toml` under
452
-
`tool.cibuildwheel.project-requires-python`, since it should be set with the
- If you're using setuptools, [you can set this value in `setup.cfg` (preferred) or `setup.py`](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#python-requirement)
0 commit comments