summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2013-06-20 12:40:45 -0400
committerMonty Taylor <mordred@inaugust.com>2013-07-12 02:05:10 -0400
commita61eae656b839f1135f83844564fb3e4608309c6 (patch)
tree1da23b86379d362e77f27bfbaa6305ac4b35c34e
parent8809f523684d3da5377723dab1fbe34ce428621d (diff)
downloadpbr-a61eae656b839f1135f83844564fb3e4608309c6.tar.gz
Fix some issues in setup.py test
While tracking down a troveclient issue, found several issues in the new python setup.py test command: * check the right source files when we're trying to decide whether to re-run egg_info * fix bogus dependency links args when installing test requires * fix bogus .egg_info dir name when a project name includes a hyphen Change-Id: I0a1964902a87f72eb67f43b10f90dfee8c7d7875
-rw-r--r--pbr/packaging.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 062a844..197a721 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -352,7 +352,7 @@ def _newer_requires_files(egg_info_dir):
for src in _any_existing(sources):
if (not os.path.exists(target_path) or
os.path.getmtime(target_path)
- < os.path.getmtime(os.path.join(egg_info_dir, src))):
+ < os.path.getmtime(src)):
return True
return False
@@ -369,13 +369,15 @@ class _PipInstallTestRequires(object):
def install_test_requirements(self):
- links = _make_links_args(_any_existing(TEST_REQUIREMENTS_FILES))
+ links = _make_links_args(
+ parse_dependency_links(TEST_REQUIREMENTS_FILES))
if self.distribution.tests_require:
- _pip_install(links, self.distribution.tests_requires)
+ _pip_install(links, self.distribution.tests_require)
def pre_run(self):
self.egg_name = pkg_resources.safe_name(self.distribution.get_name())
- self.egg_info = "%s.egg-info" % self.egg_name
+ self.egg_info = "%s.egg-info" % pkg_resources.to_filename(
+ self.egg_name)
if (not os.path.exists(self.egg_info) or
_newer_requires_files(self.egg_info)):
ei_cmd = self.get_finalized_command('egg_info')