{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6257","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6257/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6257/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6257/events","html_url":"https://github.com/numpy/numpy/issues/6257","id":103511643,"number":6257,"title":"NumPy version written out incorrectly in egg-info filename","user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20build","name":"component: build","color":"e11d21"},{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.distutils","name":"component: numpy.distutils","color":"ff0000"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-08-27T13:39:33Z","updated_at":"2015-10-10T23:52:55Z","closed_at":null,"body":"NumPy prefers using `distutils` to `setuptools` for the `install` step and thus creation of the `egg-info` filename. This means that the `egg-info` filename gets the `+` in the version replaced with `_` and written out as `numpy-1.11.0.dev0_2329eae.egg-info`, despite the fact that the version is `numpy-1.11.0.dev0+2329eae`.\r\n\r\nThis causes a problem for satisfying requirements for other packages, since `setuptools` sees this as a `LegacyVersion` (after replacing the `_` with a `-` in the filename), and thus you can get errors like this:\r\n```\r\npkg_resources.VersionConflict: (numpy 1.11.0.dev0-2329eae (/home/larsoner/.local/lib/python2.7/site-packages), Requirement.parse('numpy>=1.6.1'))\r\n```\r\nOne solution that might work is using `setuptools` for the `install` step, because `setuptools` creates the name with the `+` in it and it thus gets parsed properly. However, given the lengths taken to triage `distutils` vs `setuptools` in that step, I assume there is a reason why `distutils` is preferred. And it looks like back in 2013 this was addressed:\r\n\r\nhttps://github.com/scipy/scipy/commit/a4e93fbd1c1e192b699e1ff545236dab7cffc579#diff-2eeaed663bd0d25b7e608891384b7298L185\r\n\r\nMaybe `setuptools` would be okay to use now...?\r\n\r\nRelated `setuptools` ticket:\r\n\r\nhttps://bitbucket.org/pypa/setuptools/issues/419/setuptools-pkg_resources-fails-to-detect\r\n\r\nAny ideas for how to solve this problem?"},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/147137936","html_url":"https://github.com/numpy/numpy/issues/6257#issuecomment-147137936","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6257","id":147137936,"user":{"login":"dstufft","id":145979,"avatar_url":"https://avatars.githubusercontent.com/u/145979?v=3","gravatar_id":"","url":"https://api.github.com/users/dstufft","html_url":"https://github.com/dstufft","followers_url":"https://api.github.com/users/dstufft/followers","following_url":"https://api.github.com/users/dstufft/following{/other_user}","gists_url":"https://api.github.com/users/dstufft/gists{/gist_id}","starred_url":"https://api.github.com/users/dstufft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstufft/subscriptions","organizations_url":"https://api.github.com/users/dstufft/orgs","repos_url":"https://api.github.com/users/dstufft/repos","events_url":"https://api.github.com/users/dstufft/events{/privacy}","received_events_url":"https://api.github.com/users/dstufft/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T23:52:54Z","updated_at":"2015-10-10T23:52:54Z","body":"I haven't read the whole discussion on the upgrade thing, but I don't see any reason that ``pip upgrade`` (non-recursive, only if needed) couldn't be implemented before a real dependency solver was added. I'd think we'd need it before ``pip upgrade-all`` though.\r\n\r\nFTR pip doesn't use a bundled copy of ``setuptools`` for building, we only have a bundled copy of ``pkg_resources`` for inspecting ``sys.path`` for installed distributions. We use whatever setuptools is installed (and error out if you try to install a sdist without setuptools installed). You don't need setuptools installed at all to install from wheels.\r\n\r\nCurrently the build interface is: executes ``setup.py`` with some arguments, because the sdist \"standard\" is basically, \"produces a thing that looks similar to what distutils produces\". It's not really a standard, but it's what we got right now. Other than the fact pip goes through some shenanigans to ensure that setuptools is imported (and thus, has monkeypatched distutils) to make all distutils using ``setup.py`` files use setuptools, there's nothing that says those ``setup.py`` files *need* to use setuptools, it's just the most expedient since the interface isn't well defined. I don't see any reason that we couldn't just formalize (or semi formalize at least) the current standard so that people can rely on that particular interface.\r\n\r\nOf course, the other problem is that pip won't ensure that your build time dependencies are installed (and it doesn't now even for ``setup_requires``, it assumes that the ``setup.py`` will handle any build requirements. I also don't see any reason we couldn't layer on a small additional standard to ``setup.cfg`` or something to support build time dependencies.\r\n\r\nThose are the smaller, more incremental changes we could make to the current system. Of course, we can also solve it by making a whole new format, but if we're going to do that I want to make sure it solves the other problems too."}}