FIX: mixup between _egg_info and _sdist#342
Conversation
This fixes the following error message that appeared when upgrading Numpy from Versioneer 0.19 to 0.26: Traceback (most recent call last): File "setup.py", line 102, in <module> cmdclass = versioneer.get_cmdclass(numpy_cmdclass) File "/cygdrive/d/a/numpy/numpy/versioneer.py", line 1980, in get_cmdclass class cmd_egg_info(_egg_info): UnboundLocalError: local variable '_egg_info' referenced before assignment
|
Looks correct. I guess we should have a regression test where we prepopulate the cmdclass. |
|
@DimitriPapadopoulos Are you interested in adding a test? Would you like guidance? |
|
Yes, some guidance would be nice. I don't know what the modified code is for. I just fixed the obvious to be able to update Versioneer in another project, without really understanding the purpose of the modified code. |
|
No problem. The idea is that we're subclassing existing cmdclasses so that We have some unit tests, but mostly full integration tests with example projects: https://github.com/python-versioneer/python-versioneer/tree/master/test/ I think probably the easiest way to test this is just to make sure that calling commands = versioneer.get_cmdclass().copy()
+commands = versioneer.get_cmdclass(commands).copy()I think that should fail without your fix and pass with your fix. |
|
@DimitriPapadopoulos Went ahead and tested the above idea locally, and it does break things with the error you describe. Let's see if everything works with your fix, or if things are more complicated than I thought... |
|
Looks like it worked. Thanks! |
This fixes the following error message that appeared when upgrading Numpy from Versioneer 0.19 to 0.26: