Commit bd800f4c authored by Paul Ganssle's avatar Paul Ganssle

Add test for relative path imports in build_meta

Failing test adapted from PR #1643
Co-authored-by: default avatarTzu-ping Chung <uranusjr@gmail.com>
parent 6d0daf14
......@@ -236,3 +236,23 @@ class TestBuildMetaBackend:
build_backend = self.get_build_backend()
build_backend.build_sdist("temp")
_relative_path_import_files = {
'setup.py': DALS("""
__import__('setuptools').setup(
name='foo',
version=__import__('hello').__version__,
py_modules=['hello']
)"""),
'hello.py': '__version__ = "0.0.0"',
'setup.cfg': DALS("""
[sdist]
formats=zip
""")
}
def test_build_sdist_relative_path_import(self, tmpdir_cwd):
build_files(self._relative_path_import_files)
build_backend = self.get_build_backend()
with pytest.raises(ImportError):
build_backend.build_sdist("temp")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment