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

pipenv install --system <pkg> and pipenv update --system #5584

Open
bblanchon opened this issue Jan 30, 2023 · 9 comments
Open

pipenv install --system <pkg> and pipenv update --system #5584

bblanchon opened this issue Jan 30, 2023 · 9 comments
Assignees
Labels
--system flag Issues that related to the --system flag

Comments

@bblanchon
Copy link

Hi,

Thank you very much for pipenv; I love this tool ❤️

Is your feature request related to a problem? Please describe.

I'm using pipenv to install Python dependencies in Docker containers.
I don't want to use virtual environments because Docker already provides this isolation.
Therefore, I call pipenv install --system to install the packages globally.
So far, so good.

However, every time I need to add a new dependency, I need to run two commands:

pipenv install <pkg>
pipenv install --system

Similarly, every time I need to update the dependencies, I must do:

pipenv update
pipenv install --system

Describe the solution you'd like

Allow --system to be combined with package installation, like so:

pipenv install --system <pkg>

Similarly, allow --system with the update command like so:

pipenv update --system

This feature should work transparently with PIPENV_SYSTEM so that one can run regular pipenv commands without worrying if in a container or a virtual environment.

Describe alternatives you've considered

I'm currently using the two-command solution described above.
They work but are error-prone and create an unused virtual environment.

Additional context

I'm using Docker, not only for production but also for development, using devcontainers.
That's why I need to update and install packages frequently.

@matteius matteius added the --system flag Issues that related to the --system flag label Feb 1, 2023
@bblanchon
Copy link
Author

bblanchon commented Feb 1, 2023

PS: I forgot to include the error messages I get with pipenv 2022.12.19.

$ pipenv install --system pkg
Loading .env environment variables...
Warning: --system is intended to be used for Pipfile installation, not installation of specific packages. Aborting.
Usage: pipenv install [OPTIONS] [PACKAGES]...

ERROR:: See also: {} --deploy flag

$ pipenv update --system
Loading .env environment variables...
Usage: pipenv update [OPTIONS] [PACKAGES]...
Try 'pipenv update -h' for help.

Error: No such option: --system

@matteius
Copy link
Member

@bblanchon you might be interested in my very recent work on an pipenv upgrade command -- #5617

Its my answer to getting rid of --keep-outdated and --selective-upgrade and probably replaces pipenv update with a more powerful functionality. Would love to get some feedback.

@bblanchon
Copy link
Author

@matteius, I'm OK with update's behaviors; I just want to remove the restriction with the --system flag.
Sure, I could do pipenv upgrade && pipenv install --system, but it's not as convenient as pipenv update --system.
Moreover, I love the simplicity of pipenv, so I prefer we don't add new commands.

@matteius
Copy link
Member

@bblanchon pipenv update does something very different from what pipenv upgrade does, and I am not convinced to replace update with the functionality of upgrade yet so hence prototyping a new command. It's working towards fixing bugs and providing the right set of functionality, which is more important than any perceived simplicity, since under the hood its very not simple at all to maintain, the goal is to reach more maintainable code paths. We have added other new commands such as pipenv requirements in the last year which greatly helped to reduce complexity and bugs in the much overloaded code paths by removing the pipenv lock -r flag.

@matteius
Copy link
Member

Plus that branch removes one of the flawed validation checks on the --system flag . What is it that the update command does that is desirable? Its one of the few commands I just haven't made much use of, so any insights there would be helpful.

@matteius
Copy link
Member

I've taken a stab at updating the update command as well -- it doesn't yet address your concerns about the --system flag but its heading in the right direction towards making that happen.

@bblanchon
Copy link
Author

Hi @matteius,
Any progress on this feature?

@matteius matteius self-assigned this Aug 2, 2023
@matteius
Copy link
Member

matteius commented Aug 3, 2023

@bblanchon not really -- revisiting the system flag is one of the next big things on the list though after releasing the refactor away from requirementslib which is out for PR and solves a number of edge cases with extras installs.

@bblanchon
Copy link
Author

OK, no problem; I'll continue calling pipenv twice.
Let me know if there is anything I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--system flag Issues that related to the --system flag
Projects
None yet
Development

No branches or pull requests

2 participants