Skip to content

Commit

Permalink
Move build requirements from setup.cfg to pyproject.toml.
Browse files Browse the repository at this point in the history
Using `setup_requires` in `setup.cfg` is deprecated in newer verisons of
`setuptools`, in favor of PEP517-style `[build-system].requires` in
`pyproject.toml`.

More concretely, I believe moving to the newer style will fix an issue
my team is hitting in our monorepo, where we've occasionally been seeing
failures to install `cairocffi` because of "file already exists" errors
when building the underlying `cffi`. I found a discussion in another
project where the `cffi` maintainer said the issue arises when the same
dependency is listed in both `setup_requires` and `install_requires`
(pypa/cibuildwheel#813 (comment))
and then confirmed that switching to a PEP517-style build fixed things
(pypa/cibuildwheel#813 (comment)).
  • Loading branch information
danxmoran committed Jan 5, 2023
1 parent b88f62b commit a8a91ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "cffi >= 1.1.0"]
build-backend = "setuptools.build_meta"
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ project_urls =

[options]
packages = find:
setup_requires =
cffi >= 1.1.0
setuptools
install_requires =
cffi >= 1.1.0
python_requires = >= 3.7
Expand Down

0 comments on commit a8a91ef

Please sign in to comment.