-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix/use 4e6d935eafa commit #3176
Conversation
4b58f99
to
6e1b32c
Compare
I've been working with this patch, since my project (Versioneer) needs "pip install ." to invoke sdist instead of doing a copy (so my build_py hook can get control and compute a version from git metadata, before the .git directory goes away). I updated it to match current trunk, but I ran into a new fun problem. The generated sdist tarball is missing the I think the problem is that I was able to work around this during my tests by putting One other weird thing I noticed with this patch in place: the tarball appears to be unpacked in the same directory where the tarball was copied, so the unpacked sdist will differ from the original source tree (one addtional .tar.gz file). Hopefully that won't matter, but it might be cleaner to point Here's my updated version of the patch (it also removes the now-obsolete comment about the operation being very slow) |
One way around that would be to just manually copy the setup.py into the temporary location after we unpack the newly created sdist. Sent from my iPhone
|
I've added that to my patch, attached here. My versioneer tests work better with that. One remaining problem: MANIFEST.in is not, itself, usually included in the sdist. And it seems like the generated MANIFEST file is not there either. So an unpacked sdist tarball (for any project uses MANIFEST.in) is not itself capable of correctly producing a new second-generation sdist. If I add Maybe this is a fringe use case. An unpacked sdist is what you get if you visit PyPI in a browser, download a tarball, unpack it, then run |
This works around a problem with the new sdist-based "pip install .": * when creating the sdist, we don't run a literal "setup.py sdist" * instead, sys.argv[0] is a complicated shim that injects setuptools even into distutils-based projects * as a result, distutils.command.sdist.add_defaults() doesn't realize that "setup.py" is the name of its setup script (it gets confused because sys.argv[0] is not a real file). * so add_defaults() doesn't include setup.py in the generated tarball. (projects could add "include setup.py" to their MANIFEST.in, but this is not common practice because usually it's automatic) * so the unpacked sdist (from which pip will make a wheel) lacks the critical setup.py This copies the setup.py from source tree to unpacked target tree. The patch also removes a performance comment that was obsoleted by switching to _copy_dist_from_dir(). refs pypa#2195, pypa#2535, pypa#3176
I updated this patch and added the "copy setup.py" workaround in #3615. It passes tests (on py27 at least) locally, we'll see what travis says. I don't know if there's a way to specifically test the setup.py problem, or how to deal with the MANIFEST.in thing, but maybe #3615 is a better place to discuss that now. If #3615 lands, this PR should probably be closed. |
Accidentally closed this, reopening. Sorry! |
Hello! As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the If you do nothing, this Pull Request will be automatically closed by @BrownTruck since it cannot be merged. If this pull request is still valid, please rebase it against If you choose to rebase/merge and resubmit this Pull Request, here is an example message that you can copy and paste:
|
This Pull Request was closed because it cannot be automatically reparented to the Please feel free to re-open it or re-submit it if it is still valid and you have rebased it onto |
Missing piece of #2535
This change is