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

Support egg/setuptools packages for PEP 561 searching. #5282

Merged
merged 9 commits into from Jul 2, 2018

Conversation

Projects
None yet
3 participants
@ethanhs
Copy link
Collaborator

ethanhs commented Jun 26, 2018

This adds support for setuptool's egg format, which includes support for editable installs (pip install -e ./python setup.py develop)!

Setuptools creates its own directory to put the package we want to find. These directories are listed in easy-install.pth in a site-package directory.

Fixes #5007

ethanhs added some commits Jun 21, 2018

install_cmd.append('-e')
install_cmd.append('.')
else:
install_cmd = [python_executable, 'setup.py', 'install']

This comment has been minimized.

@JelleZijlstra

JelleZijlstra Jun 26, 2018

Collaborator

Should this be develop if editable is True?

This comment has been minimized.

@ethanhs

ethanhs Jun 26, 2018

Author Collaborator

I suppose that would be better, but the test should just use pip and editable (since pip install -e . calls python setup.py develop). But just to be safe, I will change it.

ethanhs added some commits Jun 26, 2018

@gvanrossum
Copy link
Member

gvanrossum left a comment

LG, just one question about make_abspath().

if os.path.abspath(path) == path:
return path
else:
return os.path.join(root, path)

This comment has been minimized.

@gvanrossum

gvanrossum Jul 2, 2018

Member

This feels a bit complicated (perhaps in part because you're assigning to a parameter). Is the intention this?

if os.path.isabs(path):
    return os.path.normpath(path)
else:
    return os.path.join(root, os.path.normpath(path))

While that looks like more code the flow feels a bit clearer. Also it's possible that in one of the branches you don't actually care about normpath, but I can't tell. (Or possibly you might want to call it after calling join.) Finally I note that presumably root is assumed to be absolute itself, else the function name would be misleading.

This comment has been minimized.

@ethanhs

ethanhs Jul 2, 2018

Author Collaborator

Yes, when I wrote this I didn't know isabs existed. :) But that is much better than what I was doing. I will use your suggested code.

@gvanrossum gvanrossum merged commit 9ab6936 into python:master Jul 2, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ethanhs ethanhs deleted the ethanhs:eggsupport branch Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.