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

Add -markerlib and pkg-resources to the list of PACKAGES_TO_IGNORE #368

Closed
wants to merge 2 commits into from
Closed

Conversation

cworth-gh
Copy link

On Debian unstable, mkvirtualenv 15.0.0 is installing two pseudo
packages (each with a version number of 0.0.0) as can be seen here:

$ mkvirtualenv foo
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/cworth/.virtualenvs/foo/bin/python2
Also creating executable in /home/cworth/.virtualenvs/foo/bin/python
Installing setuptools, pkg_resources, _markerlib, pip, wheel...done.

But then pip-sync will try to uninstall these packages (since nothing
explicitly depends on them) which will then cause pip stop working as
can be seen here:

$ pip-sync reqs.txt
Uninstalling pkg-resources-0.0.0:
  Successfully uninstalled pkg-resources-0.0.0

$ pip-sync reqs.txt
Traceback (most recent call last):
  File "/home/cworth/.virtualenvs/foo/bin/pip-sync", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

This commit adds these two package names to the PACKAGES_TO_IGNORE
list so that pip-sync will not try to uninstall them.

On Debian unstable, mkvirtualenv 15.0.0 is installing two pseudo
packages (each with a version number of 0.0.0) as can be seen here:

	$ mkvirtualenv foo
	Running virtualenv with interpreter /usr/bin/python2
	New python executable in /home/cworth/.virtualenvs/foo/bin/python2
	Also creating executable in /home/cworth/.virtualenvs/foo/bin/python
	Installing setuptools, pkg_resources, _markerlib, pip, wheel...done.

But then pip-sync will try to uninstall these packages (since nothing
explicitly depends on them) which will then cause pip stop working as
can be seen here:

	$ pip-sync reqs.txt
	Uninstalling pkg-resources-0.0.0:
	  Successfully uninstalled pkg-resources-0.0.0

	$ pip-sync reqs.txt
	Traceback (most recent call last):
	  File "/home/cworth/.virtualenvs/foo/bin/pip-sync", line 5, in <module>
	    from pkg_resources import load_entry_point
	ImportError: No module named pkg_resources

This commit adds these two package names to the PACKAGES_TO_IGNORE
list so that pip-sync will not try to uninstall them.
This release includes the change we have submitted upstream here:

	#368
@tekacs
Copy link

tekacs commented Sep 13, 2016

Currently having to fix this manually, everywhere - would be great to see this merged!

@palfrey
Copy link
Member

palfrey commented Dec 6, 2016

I'd also like to see this in. Any thoughts on getting it merged? Is it worth setting up a separate PR with just the sync.py changes?

@ericamador
Copy link

I know this repository recently changed ownership, so I'm bumping this to see if anything needs to be changed in to get the first commit of this series merged?

@vphilippon
Copy link
Member

vphilippon commented Apr 11, 2017

@amadornimbis It definitely needs a rebase on master. The version update in setup.py and CHANGELOG.md should be removed too, as that'll be handled when doing the release (the CHANGELOG entry itself should be kept though).

pkg_resources seems fine to add to the list, as it usually comes from setuptools anyway.
_markerlib is not a valid package name to install anyway (pip install _markerlib leads to and InvalidRequirement error), so I feel like it can be ignored too.

@davidovich Could you take a look at this? It seems like this would fix some error related to pip-sync uninstalling pkg_resources.

@oxplot
Copy link

oxplot commented Jul 19, 2017

As a workaround, you can setup the env with no setuptools and install it after activation:

virtualenv --no-setuptools venv
. venv/bin/activate
pip install setuptools
pip-sync requirements.txt

nicksellen added a commit to karrot-dev/karrot-backend that referenced this pull request Aug 10, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@vphilippon
Copy link
Member

Will be completed in #613

@vphilippon vphilippon closed this Nov 23, 2017
@graingert
Copy link
Member

instead of ignoring -markerlib what about also ignoring anything without a valid package name:

^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$

@vphilippon
Copy link
Member

@graingert Hm, maybe. but that should be opened in its own issue, that'll be lost on here.

@graingert
Copy link
Member

@vphilippon #618 done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants