1. PyPA
  2. Python Packaging Authority Projects
  3. distlib

Commits

Vinay Sajip  committed b8ae10d

Updated dependency finding to use extras rather than a 'tests' flag.

  • Participants
  • Parent commits c929fca
  • Branches default

Comments (0)

Files changed (2)

File distlib/locators.py

View file
  • Ignore whitespace
         self.dists_by_name = {}
         self.reqts = {}
 
+        extras = set(extras or [])
         if isinstance(requirement, Distribution):
             dist = odist = requirement
             logger.debug('passed %s as requirement', odist)
 
             ireqts = dist.run_requires | dist.meta_requires
             sreqts = dist.build_requires
-            if not tests or dist not in install_dists:
+            if ':test:' not in extras or dist not in install_dists:
                 treqts = set()
             else:
                 treqts = dist.test_requires

File tests/test_locators.py

View file
  • Ignore whitespace
         actual = sorted([d.name for d in dists])
         self.assertEqual(actual, ['hgtools', 'irc',
                                   'pytest-runner'])
-        dists, problems = finder.find('irc (== 5.0.1)', True)  # include tests
+        dists, problems = finder.find('irc (== 5.0.1)', extras=[':test:'])
         self.assertFalse(problems)
         actual = sorted([d.name for d in dists])
         self.assertEqual(actual, ['hgtools', 'irc',