Skip to content

Commit 643c75d

Browse files
authored
pyproject.toml, setup.py: Declare backend-path (#14313)
Replacing `sys.path.insert(0, ".")` in `setup.py` by declaring a custom PEP-517 build system.
2 parents a069d99 + c928806 commit 643c75d

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include README.rst
22
include COPYING.rst
33
include LICENSE
44
include setupbase.py
5+
include _build_meta.py
56
include MANIFEST.in
67
include py.typed
78
include .mailmap

_build_meta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# See https://setuptools.pypa.io/en/latest/build_meta.html#dynamic-build-dependencies-and-other-build-meta-tweaks
2+
from setuptools.build_meta import *

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[build-system]
22
requires = ["setuptools >= 51.0.0"]
3-
build-backend = "setuptools.build_meta"
3+
# We need access to the 'setupbase' module at build time.
4+
# Hence we declare a custom build backend.
5+
build-backend = "_build_meta" # just re-exports setuptools.build_meta definitions
6+
backend-path = ["."]
47

58
[tool.mypy]
69
python_version = "3.10"

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
from setuptools import setup
6767

6868
# Our own imports
69-
sys.path.insert(0, ".")
7069

7170
from setupbase import target_update, find_entry_points
7271

0 commit comments

Comments
 (0)