-
-
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
Pipenv install
throws Value is not a valid boolean-like
error for truthy CI
environment variables
#5554
Comments
@jodem1 You found the intentional refactoring of the said methods -- to us, |
Thank you for the quick reply. This value is set as a default built-in environment variable by Woodpecker. We do not rely on this particular value, but we use Codeberg CI for our pipeline, and they use Woodpecker as CI solution. Therefore, we do not have direct access to the server configuration of said variable, for now we have to override and expand the variable in every job that makes a |
Pipenv also complains when I've raised #5564 for the empty string case. |
I think we could make an exception for "thruty" values for the CI variable.
|
I think the PR I opened handles both this case and the case where CI is set but empty, because it would return its own value which would be empty and not evaluate to true -- if you want to confirm that @allanlewis by reviewing the PR. |
Which PR is that? |
|
Issue description
When installing dependencies with pipenv inside a Woodpecker pipeline the job fails with the following error:
ValueError: Value is not a valid boolean-like: woodpecker
when the following environment variable (default for woodpecker) is set:CI=woodpecker
Expected result
The pipenv installation step should not fail when the environment variable
CI
is set to a truthy value like "woodpecker".Actual result
The installation step fails because pipenv treats "woodpecker" not as a truthy environment variable value.
Full output:
Steps to replicate
Set the environment value
CI
to a "truthy" value other than "1", "true", "yes", "on".Currently, pipenv uses
is_env_truthy
(https://github.com/pypa/pipenv/blob/main/pipenv/environments.py#L80) which itself callsenv_to_bool
to decide if theCI
env variable is truthy. True values are currently restricted in the constantTRUE_VALUES = ("1", "true", "yes", "on")
.In a comment for the method
is_env_truthy
it says "An environment variable is truthy if it exists and isn't one of (0, false, no, off)" (which would be, imo, the correct and expected behavior) which contradicts the implemented logic.I found this related Issue: #5128
On nov 2 there was a refactoring of said methods: 38813b9
The text was updated successfully, but these errors were encountered: