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

Allow more control over .env loading message #4027

Closed
mjpieters opened this issue Nov 14, 2019 · 11 comments
Closed

Allow more control over .env loading message #4027

mjpieters opened this issue Nov 14, 2019 · 11 comments
Assignees
Labels
PR: merged The PR related to this issue has been merged.

Comments

@mjpieters
Copy link

I'm running automated pipenv run ... commands, and each and every time there is a Loading .env environment variables message.

Please, let me disable that message. pipenv run doesn't take switches nor is there a PIPENV_BARE environment variable, and so output of the message is unconditional.

Either support --bare for pipenv run, or better still, let me control pipenv output with an environment variable like PIPENV_BARE or PIPENV_QUIET.

What I don't want:

  • Having to disable .env loading with PIPENV_DONT_LOAD_ENV
  • Having to redirect stderr to /dev/null; the commands I run with pipenv run have to be able to use stderr too, and if the .env is corrupted or PIPENV_DOTENV_LOCATION is set I don't want error messages about those issues to be missed.
@264nm
Copy link

264nm commented Dec 10, 2019

Second this one...

@teroyks
Copy link

teroyks commented Mar 10, 2020

A third from me.

@codl
Copy link

codl commented Mar 23, 2022

It seems that since 2022.3.23 the message is printed regardless of the presence of a .env file, and on stdout instead of stderr, making this even more of an issue

@project0
Copy link

Super annoying, this just broke some CI pipelines for us.

@matteius

This comment was marked as outdated.

codl added a commit to codl/pokemonrates that referenced this issue Mar 23, 2022
ci: freeze pipenv version

turns out the output of `pipenv run` is not meant to be stable?
pypa/pipenv#4027
codl added a commit to codl/pokemonrates that referenced this issue Mar 23, 2022
turns out the output of `pipenv run` is not meant to be stable?
pypa/pipenv#4027
@matteius
Copy link
Member

@codl and @project0 Actually there is another issue report of this affecting requirements.txt generation so its a higher priority than I indicated prior and its out for PR now if you would have a look -- I adjusted it to only print the statement if the .env file is present. Can you check if the linked PR branch suites your needs?

@matteius
Copy link
Member

matteius commented Mar 23, 2022

In the linked PR #5006 its based on a separate PR to move this back to stderr and only when the .env file exists. Plus in the linked PR you can pass the --quiet flag

matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-4467$ pipenv run echo "TEST" --quiet
Loading .env environment variables...
TEST --quiet

matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-4467$ pipenv --quiet run echo "TEST"
TEST

matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-4467$ export PIPENV_QUIET=1
matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-4467$ pipenv run echo "TEST"
TEST

@matteius matteius added PR: awaiting-merge The PR related to this issue has been reviewed and is awaiting merge. and removed triage labels Mar 23, 2022
@matteius matteius self-assigned this Mar 23, 2022
@matteius
Copy link
Member

The fix for this has been released under pipenv==2022.3.24

@matteius matteius added PR: merged The PR related to this issue has been merged. and removed PR: awaiting-merge The PR related to this issue has been reviewed and is awaiting merge. labels Mar 23, 2022
@nomis
Copy link

nomis commented Mar 26, 2022

The fix for this has been released under pipenv==2022.3.24

When PIPENV_QUIET=1 it doesn't load the .env file at all...

@matteius
Copy link
Member

Thanks @nomis waiting on an upstream setuptools issue affecting the CI to get sorted before we can merge the fix into main

@Flimm
Copy link

Flimm commented May 27, 2024

The fix for this has been released under pipenv==2022.3.24

When PIPENV_QUIET=1 it doesn't load the .env file at all...

That bug was fixed here: #5010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged The PR related to this issue has been merged.
Projects
None yet
Development

No branches or pull requests

8 participants