Skip to content

Commit

Permalink
Add test for relative path imports in build_meta
Browse files Browse the repository at this point in the history
Failing test adapted from PR pypa#1643

Co-authored-by: Tzu-ping Chung <[email protected]>
  • Loading branch information
pganssle and uranusjr committed Jan 27, 2019
1 parent db81330 commit e43aa84
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions setuptools/tests/test_build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,22 @@ def test_build_sdist_builds_targz_even_if_zip_indicated(self,

build_files(files)
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, build_backend, tmpdir_cwd):
build_files(self._relative_path_import_files)
with pytest.raises(ImportError):
build_backend.build_sdist("temp")

0 comments on commit e43aa84

Please sign in to comment.