Commit 11b921f2 authored by Thiebaud Weksteen's avatar Thiebaud Weksteen

Change _add_defaults_data_files override and add unittest

parent a64fcd48
...@@ -142,9 +142,10 @@ class sdist(sdist_add_defaults, orig.sdist): ...@@ -142,9 +142,10 @@ class sdist(sdist_add_defaults, orig.sdist):
for filename in filenames]) for filename in filenames])
def _add_defaults_data_files(self): def _add_defaults_data_files(self):
""" try:
Don't add any data files, but why? sdist_add_defaults._add_defaults_data_files(self)
""" except TypeError:
log.warn("data_files contains unexpected objects")
def check_readme(self): def check_readme(self):
for f in self.READMES: for f in self.READMES:
......
...@@ -26,7 +26,8 @@ SETUP_ATTRS = { ...@@ -26,7 +26,8 @@ SETUP_ATTRS = {
'name': 'sdist_test', 'name': 'sdist_test',
'version': '0.0', 'version': '0.0',
'packages': ['sdist_test'], 'packages': ['sdist_test'],
'package_data': {'sdist_test': ['*.txt']} 'package_data': {'sdist_test': ['*.txt']},
'data_files': [("data", [os.path.join("d", "e.dat")])],
} }
SETUP_PY = """\ SETUP_PY = """\
...@@ -95,9 +96,12 @@ class TestSdistTest: ...@@ -95,9 +96,12 @@ class TestSdistTest:
# Set up the rest of the test package # Set up the rest of the test package
test_pkg = os.path.join(self.temp_dir, 'sdist_test') test_pkg = os.path.join(self.temp_dir, 'sdist_test')
os.mkdir(test_pkg) os.mkdir(test_pkg)
data_folder = os.path.join(self.temp_dir, "d")
os.mkdir(data_folder)
# *.rst was not included in package_data, so c.rst should not be # *.rst was not included in package_data, so c.rst should not be
# automatically added to the manifest when not under version control # automatically added to the manifest when not under version control
for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst']: for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst',
os.path.join(data_folder, "e.dat")]:
# Just touch the files; their contents are irrelevant # Just touch the files; their contents are irrelevant
open(os.path.join(test_pkg, fname), 'w').close() open(os.path.join(test_pkg, fname), 'w').close()
...@@ -126,6 +130,7 @@ class TestSdistTest: ...@@ -126,6 +130,7 @@ class TestSdistTest:
assert os.path.join('sdist_test', 'a.txt') in manifest assert os.path.join('sdist_test', 'a.txt') in manifest
assert os.path.join('sdist_test', 'b.txt') in manifest assert os.path.join('sdist_test', 'b.txt') in manifest
assert os.path.join('sdist_test', 'c.rst') not in manifest assert os.path.join('sdist_test', 'c.rst') not in manifest
assert os.path.join('d', 'e.dat') in manifest
def test_defaults_case_sensitivity(self): def test_defaults_case_sensitivity(self):
""" """
......
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