question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extras_require behaving differently in setuptools 36.2.1, breaking Twisted test

See original GitHub issue

This Twisted test started failing this morning with setuptools 36.2.1:

https://github.com/twisted/twisted/blob/trunk/src/twisted/python/test/test_setup.py#L76

    def test_distributeTakesExtrasRequire(self):
        """
        Setuptools' Distribution object parses and stores its C{extras_require}
        argument as an attribute.
        """
        extras = dict(im_an_extra_dependency="thing")
        attrs = dict(extras_require=extras)
        distribution = Distribution(attrs)
        self.assertEqual(
            extras,
            distribution.extras_require
        )

With this:

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "/Users/crodrigues/twisted1/src/twisted/python/test/test_setup.py", line 86, in test_distributeTakesExtrasRequire
    distribution.extras_require
  File "/Users/crodrigues/twisted1/src/twisted/trial/_synctest.py", line 432, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 515, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 837, in assertDictEqual
    self.fail(self._formatMessage(msg, standardMsg))
twisted.trial.unittest.FailTest: {'im_an_extra_dependency': 'thing'} != {'im_an_extra_dependency': ['thing']}
- {'im_an_extra_dependency': 'thing'}
+ {'im_an_extra_dependency': ['thing']}
?                            +       +


twisted.python.test.test_setup.OptionalDependenciesTests.test_distributeTakesExtrasRequire
-------------------------------------------------------------------------------

Looks like the value in the dictionary is now being converted to a list, whereas before it was not.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
benoit-pierrecommented, Jul 23, 2017

Yep sorry, I updated my comment above, it’s d.items() in the lambda.

0reactions
rodrigccommented, Jul 23, 2017

I’ll close this for now, because https://github.com/twisted/twisted/pull/847 seems to work. I don’t know if other setuptools users will hit this, but keep an eye out for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install setuptools 36.2.1 through exception #1101 - GitHub
The problem occurs when upgrading/downgrading setuptools from 36.2.0, with pip, and from source. What command do you use?
Read more >
Does pip handle extras_requires from setuptools/distribute ...
If I run python setup.py install on package B, which uses setuptools. command. easy_install under the hood, the extras_requires is correctly resolved, and ......
Read more >
Dependencies Management in Setuptools
There are three types of dependency styles offered by setuptools: 1) build system requirement, 2) required dependency and 3) optional dependency.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found