From 7f10b40347b2dd48e270ab23c8e6dded5fed7a16 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 29 Jul 2015 14:49:58 -0400 Subject: Combine named and unnamed extras handling. --- ptr.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ptr.py b/ptr.py index aa65e03..7988ebb 100644 --- a/ptr.py +++ b/ptr.py @@ -63,16 +63,16 @@ class PyTest(orig.test): self._build_egg_fetcher() if self.distribution.install_requires: self.distribution.fetch_build_eggs(self.distribution.install_requires) - # include environment-specific unnamed environment markers - for spec, reqs in self.distribution.extras_require.items(): - name, sep, marker = spec.partition(':') - if not name and self.marker_passes(marker): - self.distribution.fetch_build_eggs(reqs) if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) - if self.distribution.extras_require and self.extras: - list(map(self.distribution.fetch_build_eggs, - self.distribution.extras_require.values())) + extras_require = self.distribution.extras_require or {} + for spec, reqs in extras_require.items(): + name, sep, marker = spec.partition(':') + if not self.marker_passes(marker): + continue + # always include unnamed extras + if not name or self.extras: + self.distribution.fetch_build_eggs(reqs) if self.dry_run: self.announce('skipping tests (dry run)') return -- cgit v1.2.1