Redraft to respond to comments

This commit is contained in:
Joe Rickerby
2022-03-29 20:45:23 +01:00
parent 1d6a1c0209
commit 901f07b586
+14 -31
View File
@@ -402,7 +402,7 @@ This option can also be set using the [command-line option](#command-line)
> Manually set the Python compatibility of your project > Manually set the Python compatibility of your project
By default, cibuildwheel reads your package's Python compatibility from By default, cibuildwheel reads your package's Python compatibility from
`pyproject.toml` following [PEP621](https://www.python.org/dev/peps/pep-0621/) `pyproject.toml` following the [project metadata specification](https://packaging.python.org/en/latest/specifications/declaring-project-metadata/)
or from `setup.cfg`; finally it will try to inspect the AST of `setup.py` for a or from `setup.cfg`; finally it will try to inspect the AST of `setup.py` for a
simple keyword assignment in a top level function call. If you need to override simple keyword assignment in a top level function call. If you need to override
this behaviour for some reason, you can use this option. this behaviour for some reason, you can use this option.
@@ -416,43 +416,26 @@ Default: reads your package's Python compatibility from `pyproject.toml`
`setup.py` `setup(python_requires="...")`. If not found, cibuildwheel assumes `setup.py` `setup(python_requires="...")`. If not found, cibuildwheel assumes
the package is compatible with all versions of Python that it can build. the package is compatible with all versions of Python that it can build.
!!! note !!! note
Rather than using this option, it's recommended you set Rather than using this option, it's recommended you set this value
`project.requires-python` in `pyproject.toml` instead: statically in a way that your build backend can use it, too. This ensures
that your package's metadata is correct when published on PyPI.
```toml - If you have a `pyproject.toml` containing a `[project]` table, you can
[project] specify `requires-python` there.
requires-python = ">=3.6"
```
A few things to note:
- If your project didn't already have a `pyproject.toml`, be sure to
set the build system to your build backend.
```toml ```toml
[build-system] [project]
requires = ["setuptools>=42", "wheel"] requires-python = ">=3.6"
build-backend = "setuptools.build_meta"
``` ```
- If you didn't already have a `pyproject.toml` that had a `[project]` Note that build backend support for the `[project]` table is still patchy, and
table, you should migrate values from `setup.py` or `setup.cfg`, or adding `[project]` to `pyproject.toml` can change the behaviour of your build
list them in the [the `dynamic` field](https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#dynamic). (e.g. setuptools may ignore `install_requires` specified via `setup.py` or
The values to include and the format is listed in the `setup.cfg`). Make sure to double-check the build after adding.
[project source metadata specification](https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#dynamic)
(as originally defined in PEP 621).
- Adding `[project]` to `pyproject.toml` can - 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)
change the behaviour of your build (e.g. `setuptools` may ignore and cibuildwheel will read it from there.
`install_requires` specified via `setup.py` or `setup.cfg`). Make sure
to double-check the build after adding.
This option is not available in `pyproject.toml` under
`tool.cibuildwheel.project-requires-python`, since it should be set with the
[PEP621](https://www.python.org/dev/peps/pep-0621/) location instead,
`project.requires-python`.
#### Examples #### Examples