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

Vendor pkg_resources #1434

Merged
merged 6 commits into from
Jan 7, 2014
Merged

Vendor pkg_resources #1434

merged 6 commits into from
Jan 7, 2014

Conversation

dstufft
Copy link
Member

@dstufft 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.

With the vendoring of pkg_resources we no longer need to worry
about the version of the installed setuptools.
@pfmoore
Copy link
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
Copy link
Member Author

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
Copy link
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
Copy link
Member Author

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
@dstufft dstufft deleted the vendor-pkg-resources branch January 7, 2014 14:57
@qwcode
Copy link
Contributor

qwcode commented Jan 8, 2014

YAY!!!!

@@ -261,6 +261,15 @@ def url_name(self):

@property
def setup_py(self):
try:
import pkg_resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 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.

None yet

3 participants