Skip to content

Commit 8837459

Browse files
committed
Add sanity check for 'build/lib/build/lib' when creating distribution fixtures
1 parent cb5048f commit 8837459

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

setuptools/tests/fixtures.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ def setuptools_sdist(tmp_path_factory, request):
7777
if dist:
7878
return dist
7979

80+
# Sanity check
81+
# Building should not create recursive `setuptools/build/lib/build/lib/...`
82+
assert not Path(request.config.rootdir, "build/lib/build").exists()
83+
8084
subprocess.check_output([
8185
sys.executable,
8286
"-m",
@@ -86,6 +90,11 @@ def setuptools_sdist(tmp_path_factory, request):
8690
str(tmp),
8791
str(request.config.rootdir),
8892
])
93+
94+
# Sanity check
95+
# Building should not create recursive `setuptools/build/lib/build/lib/...`
96+
assert not Path(request.config.rootdir, "build/lib/build").exists()
97+
8998
return next(tmp.glob("*.tar.gz"))
9099

91100

@@ -102,6 +111,10 @@ def setuptools_wheel(tmp_path_factory, request):
102111
if dist:
103112
return dist
104113

114+
# Sanity check
115+
# Building should not create recursive `setuptools/build/lib/build/lib/...`
116+
assert not Path(request.config.rootdir, "build/lib/build").exists()
117+
105118
subprocess.check_output([
106119
sys.executable,
107120
"-m",
@@ -111,6 +124,11 @@ def setuptools_wheel(tmp_path_factory, request):
111124
str(tmp),
112125
str(request.config.rootdir),
113126
])
127+
128+
# Sanity check
129+
# Building should not create recursive `setuptools/build/lib/build/lib/...`
130+
assert not Path(request.config.rootdir, "build/lib/build").exists()
131+
114132
return next(tmp.glob("*.whl"))
115133

116134

0 commit comments

Comments
 (0)