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

Vendor pkg_resources #1434

Merged
merged 6 commits into from Jan 7, 2014

Conversation

Projects
None yet
3 participants
@dstufft
Member

dstufft commented Jan 7, 2014

This vendors pkg_resources which means that there is no longer a hard check on setuptools version and infract pip can install things perfectly fine without setuptools installed as long as it's only installing Wheels.

dstufft added some commits Jan 7, 2014

Remove the setuptools version check
With the vendoring of pkg_resources we no longer need to worry
about the version of the installed setuptools.
@pfmoore

This comment has been minimized.

Show comment
Hide comment
@pfmoore

pfmoore Jan 7, 2014

Member

zipping up pip and the main.py I quoted in #1422 ever-so-nearly works as a portable, standalone pip:

>virtualenv --no-setuptools xx
Using real prefix 'C:\\Apps\\Python33'
New python executable in xx\Scripts\python.EXE
(ve) PS 13:08 C:\Work\personal
>xx\scripts\python .\pip\pip.zip list
(ve) PS 13:08 C:\Work\personal
>xx\scripts\python .\pip\pip.zip install setuptools
Downloading/unpacking setuptools
Installing collected packages: setuptools
Cleaning up...
Exception:
Traceback (most recent call last):
  File ".\pip\pip.zip\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File ".\pip\pip.zip\pip\commands\install.py", line 275, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File ".\pip\pip.zip\pip\req.py", line 1373, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File ".\pip\pip.zip\pip\req.py", line 655, in install
    self.move_wheel_files(self.source_dir, root=root)
  File ".\pip\pip.zip\pip\req.py", line 886, in move_wheel_files
    pycompile=self.pycompile,
  File ".\pip\pip.zip\pip\wheel.py", line 324, in move_wheel_files
    generated.extend(maker.make(spec))
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 304, in make
    self._make_script(entry, filenames, options=options)
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 208, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 150, in _write_script
    launcher = self._get_launcher('t')
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 283, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'

Storing debug log for failure in C:\Users\uk03306\pip\pip.log

That latter looks like a distlib issue. I'll post it to the distlib tracker for comments (it's not a huge deal in the grand scheme of things, though).

Member

pfmoore commented Jan 7, 2014

zipping up pip and the main.py I quoted in #1422 ever-so-nearly works as a portable, standalone pip:

>virtualenv --no-setuptools xx
Using real prefix 'C:\\Apps\\Python33'
New python executable in xx\Scripts\python.EXE
(ve) PS 13:08 C:\Work\personal
>xx\scripts\python .\pip\pip.zip list
(ve) PS 13:08 C:\Work\personal
>xx\scripts\python .\pip\pip.zip install setuptools
Downloading/unpacking setuptools
Installing collected packages: setuptools
Cleaning up...
Exception:
Traceback (most recent call last):
  File ".\pip\pip.zip\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File ".\pip\pip.zip\pip\commands\install.py", line 275, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File ".\pip\pip.zip\pip\req.py", line 1373, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File ".\pip\pip.zip\pip\req.py", line 655, in install
    self.move_wheel_files(self.source_dir, root=root)
  File ".\pip\pip.zip\pip\req.py", line 886, in move_wheel_files
    pycompile=self.pycompile,
  File ".\pip\pip.zip\pip\wheel.py", line 324, in move_wheel_files
    generated.extend(maker.make(spec))
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 304, in make
    self._make_script(entry, filenames, options=options)
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 208, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 150, in _write_script
    launcher = self._get_launcher('t')
  File ".\pip\pip.zip\pip\_vendor\distlib\scripts.py", line 283, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'

Storing debug log for failure in C:\Users\uk03306\pip\pip.log

That latter looks like a distlib issue. I'll post it to the distlib tracker for comments (it's not a huge deal in the grand scheme of things, though).

@dstufft

This comment has been minimized.

Show comment
Hide comment
@dstufft

dstufft Jan 7, 2014

Member

FWIW I'd prefer to keep any changes to make this run as a zip file to the develop branch. It's kind of a stretch to add this to 1.5.1 since it's technically a new feature but I think unbreaking things for people who are using a system installed setuptools calls for the exception. But adding a feature that isn't needed for unbreaking things should go back to develop.

Member

dstufft commented Jan 7, 2014

FWIW I'd prefer to keep any changes to make this run as a zip file to the develop branch. It's kind of a stretch to add this to 1.5.1 since it's technically a new feature but I think unbreaking things for people who are using a system installed setuptools calls for the exception. But adding a feature that isn't needed for unbreaking things should go back to develop.

@pfmoore

This comment has been minimized.

Show comment
Hide comment
@pfmoore

pfmoore Jan 7, 2014

Member

Agreed - no intention that the run-in-a-zip-file stuff be for 1.5.1. I was just curious as to how close it was to working.

Member

pfmoore commented Jan 7, 2014

Agreed - no intention that the run-in-a-zip-file stuff be for 1.5.1. I was just curious as to how close it was to working.

@dstufft

This comment has been minimized.

Show comment
Hide comment
@dstufft

dstufft Jan 7, 2014

Member

This should be done now, letting the tests pass.

Member

dstufft commented Jan 7, 2014

This should be done now, letting the tests pass.

dstufft added a commit that referenced this pull request Jan 7, 2014

@dstufft dstufft merged commit 18c18de into pypa:1.5.X Jan 7, 2014

1 check passed

default The Travis CI build passed
Details

@dstufft dstufft deleted the dstufft:vendor-pkg-resources branch Jan 7, 2014

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Jan 8, 2014

Contributor

YAY!!!!

Contributor

qwcode commented Jan 8, 2014

YAY!!!!

@@ -261,6 +261,15 @@ def url_name(self):
@property
def setup_py(self):
try:
import pkg_resources

This comment has been minimized.

@qwcode

qwcode Jan 10, 2014

Contributor

I think this should be import setuptools?

just noticed an interesting situation on ubuntu-precise
ubuntu has a python-pkg-resources pkg, seperate from setuptools.
so import pkg_resources works, but there's no setuptools, so I end up failing later with a different exception than yours.

@qwcode

qwcode Jan 10, 2014

Contributor

I think this should be import setuptools?

just noticed an interesting situation on ubuntu-precise
ubuntu has a python-pkg-resources pkg, seperate from setuptools.
so import pkg_resources works, but there's no setuptools, so I end up failing later with a different exception than yours.

This comment has been minimized.

@dstufft

dstufft Jan 10, 2014

Member

You're probably right. I just adapted this from the old check and didn't really think about it.

@dstufft

dstufft Jan 10, 2014

Member

You're probably right. I just adapted this from the old check and didn't really think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment