Skip to content

Commit

Permalink
pyproject.toml, setup.py: Declare backend-path (#14313)
Browse files Browse the repository at this point in the history
Replacing `sys.path.insert(0, ".")` in `setup.py` by declaring a custom
PEP-517 build system.
  • Loading branch information
Carreau committed Jan 31, 2024
2 parents a069d99 + c928806 commit 643c75d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include README.rst
include COPYING.rst
include LICENSE
include setupbase.py
include _build_meta.py
include MANIFEST.in
include py.typed
include .mailmap
Expand Down
2 changes: 2 additions & 0 deletions _build_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See https://setuptools.pypa.io/en/latest/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks
from setuptools.build_meta import *
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[build-system]
requires = ["setuptools >= 51.0.0"]
build-backend = "setuptools.build_meta"
# We need access to the 'setupbase' module at build time.
# Hence we declare a custom build backend.
build-backend = "_build_meta" # just re-exports setuptools.build_meta definitions
backend-path = ["."]

[tool.mypy]
python_version = "3.10"
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
from setuptools import setup

# Our own imports
sys.path.insert(0, ".")

from setupbase import target_update, find_entry_points

Expand Down

0 comments on commit 643c75d

Please sign in to comment.