Skip to content

Comments

Add system-site-packages setting#1404

Closed
kam1sh wants to merge 1 commit intopython-poetry:developfrom
kam1sh:1393-system-site-packages
Closed

Add system-site-packages setting#1404
kam1sh wants to merge 1 commit intopython-poetry:developfrom
kam1sh:1393-system-site-packages

Conversation

@kam1sh
Copy link
Contributor

@kam1sh kam1sh commented Sep 24, 2019

closes #1393

Pull Request Check List

  • [ x ] Added tests for changed code.
  • [ x ] Updated documentation for changed code.
  • [ x ] Based on the develop branch

I'm not sure is practice using system-site-packages is good or bad, but if venv module supports that, I think poetry should support it too as it manages virtual environments.

@kasteph kasteph added kind/feature Feature requests/implementations area/venv Related to virtualenv management labels Sep 24, 2019
@kasteph
Copy link
Member

kasteph commented Sep 24, 2019

Thanks for your PR @kam1sh 🍡 💫

I think this is a good idea and is a great feature to have 💪 would you mind fixing the checks that cause this build to fail?

@kam1sh
Copy link
Contributor Author

kam1sh commented Sep 25, 2019

Sure! I just was too lazy to implement this for Python 2.7 =)

@kam1sh
Copy link
Contributor Author

kam1sh commented Sep 25, 2019

I think it's ready.

@kasteph
Copy link
Member

kasteph commented Sep 26, 2019

Thanks @kam1sh! Sorry but one more thing, can you squash the commits into one?

@kam1sh
Copy link
Contributor Author

kam1sh commented Sep 26, 2019

I thought it can be done on PR merge...

@kasteph
Copy link
Member

kasteph commented Sep 26, 2019

Absolutely, but maybe you yourself would want to create a descriptive commit message :)

@sdispater
Copy link
Member

You will need to update the config command and the Config class if you want this new setting to be set via the config command.

@kam1sh
Copy link
Contributor Author

kam1sh commented Sep 26, 2019

Forgot to check it in the Poetry CLI itself, thank you.

@kam1sh
Copy link
Contributor Author

kam1sh commented Sep 27, 2019

Now it shows in poetry config:

> poetry config --list
...
virtualenvs.include-system-packages = false
...

What's next? Maybe I should mock environment creation in tests? Or write tests for command poetry env use?

@kam1sh
Copy link
Contributor Author

kam1sh commented Sep 30, 2019

Hello? I have to write more tests/code or feature is ready to merge?

@stale
Copy link

stale bot commented Nov 29, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 29, 2019
@kam1sh
Copy link
Contributor Author

kam1sh commented Dec 1, 2019

Well, I see that no one wants this PR. Fine =(

@codito
Copy link

codito commented Jan 4, 2020

@stephsamson @kam1sh can you please consider reviving this PR? What is the additional work required to merge? Some of us are willing to help, see #1393.

@samvasko
Copy link

samvasko commented Apr 28, 2020

Hello, this is very useful for packages that that are distributed using apt on ARM. I would really appreciate this getting merged.

@kam1sh Your PR looks great and It would be a shame for the work to go to waste. Could you please reopen it so we can pester people to merge it in.

@broken-wheel
Copy link

I too would really appreciate if this gets merged.
Also, would it be possible to use site-packages as part of CLI invocation (e.g., poetry venv or poetry install?

@frankier
Copy link

I agree this functionality would be useful in Poetry, but for the meantime here are some workarounds (cross-posting across related issues):

Use case 1) I just want to save space use by my virtualenvs:

  1. Install https://rdfind.pauldreik.se/
  2. cd ~/.cache/pypoetry/virtualenvs/ && rdfind -makehardlinks true .

Use case 2) I need to use a globally installed package from my poetry venv.

  1. Open ~/.cache/pypoetry/virtualenvs/myvenv/pyvenv.cfg
  2. Set include-system-site-packages = true

@Jaakkonen
Copy link

This would be helpful in cases where some developer uses their own debugging modules via PYTHONBREAKPOINT or similar. Without system-site-packages and this environment variable set to non-existent module (such as IPython debugger), breakpoint() will just fail and not open a debugging session

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/venv Related to virtualenv management kind/feature Feature requests/implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants