-
-
Notifications
You must be signed in to change notification settings - Fork 611
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
Allow pip-sync
to remove pip-tools
when --python-executable
is specified
#2103
Comments
Thanks for raising this issue, sounds like a resonable proposal.
Yup, I think that is already on the roadmap; alternatively, there is #1998 proposed, which installs Unfortunately, we're blocked by failing Windows tests, currently, and lack contributors who would be able and willing to investigate (my feeling is that |
I actually need this for Windows, so I'll take a look at the failing PR in addition to looking into my own suggestion. |
Thanks! Tests are also failing on |
I didn't see a clear issue related to the CI failures, so I posted one with some notes on why |
Just noting that while I did look at the failing PR, I didn't understand the |
What's the problem this feature will solve?
I'd like to be able to remove
pip-tools
and the other protected packages when runningpip-sync --python-executable 'path/to/other/env
.The protection makes sense when
pip-sync
is running in the Python environment being modified, but doesn't seem necessary when manipulating a separate target environment.Describe the solution you'd like
pip-sync --python-executable 'path/to/other/env
should allow removingpip-tools
and the other protected packages from the target environment. I'd be ok with having to pass an extra option to say "no, seriously, I mean it, remove everything that isn't listed in the requirements files", but would prefer it if that wasn't necessary.This came up due to the fact that
pip-compile
doesn't currently allow resolving for an environment other than the one runningpip-compile
(adding a--python-executable
option topip-compile
is a much harder problem, but would technically eliminate my use case for this hopefully simpler proposal).To work around this, I'd like to be able to temporarily install
pip-tools
, and then remove it later withpip-sync
.Alternative Solutions
Rather than running
pip-sync
directly, instead runpython -Ic "import piptools.scripts.sync, piptools.sync; piptools.sync.PACKAGES_TO_IGNORE.clear(); piptools.scripts.sync.cli()"
(with the same CLI arguments as would be passed to a direct invocation ofpip-sync
)Edit: just noting #2117 as a trap to watch out for when using
--python-executable
with standalone Python environments.The text was updated successfully, but these errors were encountered: