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

switch 'pip install .' to use sdists, not copytree #3722

Closed
wants to merge 2 commits into from

Conversation

BrownTruck
Copy link
Contributor

This has an updated (mergeable) version of the original #2535 missing patch (to actually use the new copy function), and a workaround for the missing-setup.py problem that I found during testing.

refs #2195, #2535, #3176

This change is


This was automatically migrated from #3615 to reparent it to the master branch. Please see original pull request for any previous discussion.

Original Submitter: @warner

xavfernandez and others added 2 commits April 13, 2016 13:33
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
@pradyunsg
Copy link
Member

#4501 supercedes this. Closing.

Thanks @warner for the original PR. ^.^

@pradyunsg pradyunsg closed this Jul 22, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants