question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adopting "working" scheme for every run

See original GitHub issue

Just carrying over my idea in https://github.com/pypa/pip/issues/1056#issuecomment-218130183, for proper dedicated discussion.

AFAIK, there are 3 possible schemes for packages:

  • “system” - for system/global packages (--system)
  • “user” - for packages installed in user space (--user)
  • “local” - for virtualenv packages (--local)

pip enforces a “working” scheme on every run. Outside a virtualenv, the default working scheme would be “system” (It should really be “user”, that’s another issue #1668). Inside a virtualenv, the default working scheme should be “local”. Passing --system or --user or --local overrides the working scheme.

Only packages in the same scheme as the working scheme can be modified. By modifying, I mean installing or uninstalling a package. Trying to modify a package in a different scheme is not allowed and pip would print a message and error out.

So, modifying a package in system scheme with a “user” working scheme is not allowed. Nor is modifing a package in user scheme with a “system” working scheme. Niether are the other permutations with “local”.

I think this results in a pretty simple behaviour model.

As @ncoghlan pointed out, this would need some logic to understand that user installs shadow system ones. Also, I would slightly change this to spell it like --scheme {global,user,venv} because I like how this signifies exclusiveness of the behaviours better than plain flags do and is consistent with some internal configuration stuff.

Additionally, while doing this:

  • preparatory work of #1668 can also be done, meaning that defaulting to user would just be flipping the default (something like what we did for --upgrade-strategy).
  • addresses #1056 by requiring the user to specify the scheme that they are working with.

/ping @dstufft @pfmoore

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:26 (19 by maintainers)

github_iconTop GitHub Comments

3reactions
piotr-dobrogostcommented, Aug 1, 2018

How does --target mode of operation relate to schemes? It feels like --target essentially is another type of scheme and treating it as such would potentially solve many bugs pertaining to --target option.

1reaction
nanonymecommented, Mar 7, 2019

I personally think that fallback logic is too complicated. If you’re operating under a badly configured distro, use virtualenv.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Four-day week: Which countries have embraced it and how's it ...
The idea is simple – employees would work four days a week while getting paid the same and earning the same benefits, but...
Read more >
User Adoption Strategies to Level Up Your User Onboarding ...
We explore user adoption strategies for SaaS businesses, the importance of user onboarding, and how you can measure your success.
Read more >
Side project time - Wikipedia
Side project time is a type of employee benefit constituting a guarantee from employers that their employees may work on their personal projects...
Read more >
Goldendoodle rescue adoption
We are run by a group of dedicated volunteers with a passion for rescuing and re-homing all breeds of dogs. We love our...
Read more >
Adoption support fund (ASF) - GOV.UK
Local authorities and regional adoption agencies (RAAs) can apply for therapeutic funding for eligible adoptive and special guardianship order families.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found