-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Suppressing .env loading message when PIPENV_QUIET is set #3457
Conversation
with open(dotenv_path, 'w') as f: | ||
pass | ||
|
||
with mock.patch('pipenv.environments.PIPENV_DOTENV_LOCATION', dotenv_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to set PIPENV_QUIET
environment variable, rather than patching the function here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I wanted to to this, but the PIPENV_QUIET variable is removed at import-time :
Line 271 in 1f36ca1
del PIPENV_VERBOSE |
Do you think patching PIPENV_VERBOSITY variable is acceptable instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I meant this line :
Line 270 in 1f36ca1
del PIPENV_QUIET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, setting PIPENV_VERBOSITY
to -1
looks fine to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks, changes done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can squash in one commit if you prefer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have preference on this. Either is ok for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just pushed the squashed commit
6faf9e2
to
a6beb61
Compare
Why the CI in windows for python27 can't pass... |
I don't know why CI fails on windows, #3426 has the same error. It fails while creating the virtualenv, with the error: I'm not sure how this could be related with my changes, they do not include non-ascii characters. |
Your PR looks good to me. I don't think the failing CI is related with your PR since it is a so minor change. But it still worth investigating why the CI fails... |
One more thing to say is that we might still need to make the test pass first, otherwise merging this may make our CI failing all the time. @thunderk Do you mind add a news first? |
d5dfd57
to
cca4861
Compare
@jxltom Sure, I added the news, I hope it's ok |
Offhand, are you using an editor that respects |
(We aren’t going to merge this until it’s sorted out either way, whether it’s a CI issue or a code issue, so let’s get to the bottom of it) |
@techalchemy Yes, I use an editor aware of .editorconfig. I checked again, and the files I edited seems to be saved as utf-8. I will try to add the coding:utf-8 header in the test file (it was missing, but I can't see non utf-8 chars in my diff). |
054ddd2
to
c3545a3
Compare
OK, I'm stuck, I tried to go back from master and rewrite my changes with another editor (just to be sure). Also checked the modified files with some utf-8 validator, and still no luck... |
c3545a3
to
1c6520c
Compare
1c6520c
to
9f04c93
Compare
well, note that all tests were failing until recently, so that may be contributing... the changes seem ok to me so i'll just update your pr with the current changes and see if that works |
(I think the transient test failure issue is resolved and this is probably something we can merge now!) |
Any news on this item. I am also interested to get ride this notification. |
This is a proposed fix for issue #2358 that have been closed without solution.
The fix suppresses the message "Loading .env environment variables" that is sent to stderr, when PIPENV_QUIET environment variable is set.
This is very useful for people that use pipenv run in cron commands, because writing to stderr may systematically report the cron as error.