Skip to content

Commit 6deebc6

Browse files
committed
Capture behaviour of issue 3692 in test
1 parent 59ee498 commit 6deebc6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

setuptools/tests/test_config_discovery.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,19 @@ def test_flat_layout_with_multiple_modules(self, tmp_path):
248248
with pytest.raises(PackageDiscoveryError, match="multiple (packages|modules)"):
249249
_get_dist(tmp_path, {})
250250

251+
def test_py_modules_when_wheel_dir_is_cwd(self, tmp_path):
252+
"""Regression for issue 3692"""
253+
from setuptools import build_meta
254+
255+
pyproject = '[project]\nname = "test"\nversion = "1"'
256+
(tmp_path / "pyproject.toml").write_text(DALS(pyproject), encoding="utf-8")
257+
(tmp_path / "foo.py").touch()
258+
with jaraco.path.DirectoryStack().context(tmp_path):
259+
build_meta.build_wheel(".")
260+
# Ensure py_modules are found
261+
wheel_files = get_wheel_members(next(tmp_path.glob("*.whl")))
262+
assert "foo.py" in wheel_files
263+
251264

252265
class TestNoConfig:
253266
DEFAULT_VERSION = "0.0.0" # Default version given by setuptools

0 commit comments

Comments
 (0)