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
+15-32Lines changed: 15 additions & 32 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,43 +416,26 @@ 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
-
424
-
```toml
425
-
[project]
426
-
requires-python = ">=3.6"
427
-
```
420
+
Rather than using this option, 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.
428
423
429
-
A few things to note:
430
-
431
-
- If your project didn't already have a `pyproject.toml`, be sure to
432
-
set the build system to your build backend.
424
+
- If you have a `pyproject.toml` containing a `[project]` table, you can
425
+
specify `requires-python` there.
433
426
434
427
```toml
435
-
[build-system]
436
-
requires = ["setuptools>=42", "wheel"]
437
-
build-backend = "setuptools.build_meta"
428
+
[project]
429
+
requires-python = ">=3.6"
438
430
```
439
431
440
-
- If you didn't already have a `pyproject.toml` that had a `[project]`
441
-
table, you should migrate values from `setup.py` or `setup.cfg`, or
442
-
list them in the [the `dynamic` field](https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#dynamic).
443
-
The values to include and the format is listed in the
Note that build backend support for the `[project]` table is still patchy, and
433
+
adding `[project]` to `pyproject.toml` can change the behaviour of your build
434
+
(e.g. setuptools may ignore `install_requires` specified via `setup.py` or
435
+
`setup.cfg`). Make sure to double-check the build after adding.
436
+
437
+
- If you're using setuptools, [you can set this value in `setup.cfg` or `setup.py`](https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#python-requirement)
0 commit comments