Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

versioneer does not work properly with setuptools #101

Closed
mithrandi opened this issue Oct 23, 2015 · 11 comments
Closed

versioneer does not work properly with setuptools #101

mithrandi opened this issue Oct 23, 2015 · 11 comments
Milestone

Comments

@mithrandi
Copy link
Contributor

Versioneer's build_py class inherits from the distutils one, not the setuptools one; this seems to cause problems like wheels not being built with the right contents (I guess because distutils handles MANIFEST.in differently).

There is already code to handle this for the "sdist" command, I think doing the same for "build_py" is the correct thing to do. PR incoming.

@mithrandi
Copy link
Contributor Author

Doh, this was already fixed in 99d5d93. Could we get a new release that includes this fix? It seems like a major issue.

@ariscn
Copy link

ariscn commented Oct 30, 2015

With the fix you linked, I get:

    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/var/folders/05/lzm4sx4s7nz1mrjzmvb4x5kr0000gn/T/pip-82obr2-build/setup.py", line 30, in <module>
        cmdclass=get_cmdclass(),
      File "versioneer.py", line 1459, in get_cmdclass
        if "setuptools" in sys.modules:
    AttributeError: 'NoneType' object has no attribute 'modules'

When running pip install [-e] . to install my package into a virtualenv for development. Why on earth is sys None here? Works in a Py 3.5 venv, error is only under 2.7.

@ariscn
Copy link

ariscn commented Oct 31, 2015

It looks like this relates to #52.

For some reason, del sys.modules['versioneer'] seems to entirely remove sys when run under Python 2.7(.10). Commenting out both instances of del allows versioneer to work under 2.7, but re-introduces the linked issue.

@ariscn
Copy link

ariscn commented Oct 31, 2015

Okay, figured it out. I was doing:

from versioneer import get_cmdclass, get_version

I prefer this style to import versioneer. But because of some dark magic involving sys.modules, the former fails under 2.7 while the latter works as expected.

I'm not sure what the fix is, so I propose updating the docs to warn against the from versioneer syntax.

@kristi
Copy link

kristi commented Nov 2, 2015

+1 on releasing a new versioneer version. I'm having setuptools related versioneer issues too.

@ariscn
Copy link

ariscn commented Nov 2, 2015

Found another problem! pip install -e . to develop a project fixes the versioneer version string at install time. I doubt that there's a way to update this dynamically, but is there at least a way to detect an editable install and construct a different version string, by adding a '-editable' suffix?

@mikebryant
Copy link

+1. Just spent several hours trying to figure out why my static data wasn't included in my wheels

@warner warner added this to the 0.16 milestone Jan 22, 2016
@kristi
Copy link

kristi commented Mar 26, 2016

Five months later and still no 0.16 release?

@warner
Copy link
Collaborator

warner commented Mar 31, 2016

So sorry, I've been distracted by other projects. I'll make an 0.16 release with the existing code now.

@warner
Copy link
Collaborator

warner commented Mar 31, 2016

@ariscn I think your install -e problem is #83 (not that there's an obvious solution, but maybe you'll find the analysis useful).

@ariscn I ran some little test programs with python 2.7.10 and 2.7.11, and didn't see sys getting deleted entirely. When 0.16 is out, could you re-test and open a new issue if that problem persists? I'm thinking it might involve the version of setuptools you had back in october too.

@warner
Copy link
Collaborator

warner commented Mar 31, 2016

Ok, 0.16 is out , and should include this fix. Closing this out. Sorry for the extended delay, folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants