Repository: pypa/pipenv

Issue:
Pipenv `install` throws `Value is not a valid boolean-like` error for truthy `CI` environment variables
### Issue description

When installing dependencies with pipenv inside a [Woodpecker](https://woodpecker-ci.org/) 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](https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables)) 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:

```
installing pipenv...
done! ✨ 🌟 ✨
  installed package pipenv 2022.11.30, installed using Python 3.8.12
  These apps are now globally available
    - pipenv
    - pipenv-resolver
+ pipenv install --dev --skip-lock
Error in sys.excepthook:
Traceback (most recent call last):
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/exceptions.py", line 35, in handle_exception
    if environments.Setting().is_verbose() or not issubclass(exc_type, ClickException):
AttributeError: module 'pipenv.environments' has no attribute 'Setting'

Original exception was:
Traceback (most recent call last):
  File "/root/.local/bin/pipenv", line 5, in <module>
    from pipenv import cli
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/__init__.py", line 58, in <module>
    from .cli import cli
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/cli/__init__.py", line 1, in <module>
    from .command import cli  # noqa
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/cli/command.py", line 4, in <module>
    from pipenv import environments
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/environments.py", line 80, in <module>
    PIPENV_IS_CI = is_env_truthy("CI") or is_env_truthy("TF_BUILD")
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/utils/shell.py", line 419, in is_env_truthy
    return env_to_bool(os.getenv(name, False))
  File "/root/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv/utils/shell.py", line 414, in env_to_bool
    raise ValueError(f"Value is not a valid boolean-like: {val}")
ValueError: Value is not a valid boolean-like: woodpecker
```

### 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 calls `env_to_bool` to decide if the `CI` env variable is truthy. True values are currently restricted in the constant `TRUE_VALUES = ("1", "true", "yes", "on")`.

In a comment for the method `is_env_truthy` [it says](https://github.com/pypa/pipenv/blob/cff5620a478249f487064d5fcd8674978ac6d683/pipenv/utils/shell.py#L418) "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: https://github.com/pypa/pipenv/issues/5128

On nov 2 there was a refactoring of said methods: https://github.com/pypa/pipenv/commit/38813b96b8a978356628fc33a6779ea7f653926c



Discussion:
@jodem1 You found the intentional refactoring of the said methods -- to us, `woodpecker` isn't any more truthy than the string `false`.   Is there a real reason you have to se the CI value to `woodpecker`?
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 install` call to prevent it from failing.
https://woodpecker-ci.org/docs/usage/environment#built-in-environment-variables
Pipenv also complains when `CI` is set to an empty string - surely this could be considered "falsey" too?

I've raised #5564 for the empty string case.
I think we could make an exception for "thruty" values for the CI variable.
I don't think this exception should be extended to empty CI value.
So the following are going to happen:
```
CI={woodpacker, banjo, jenkins} -> true
CI= -> exception.

```


Resolving patch:
diff --git a/pipenv/environments.py b/pipenv/environments.py
--- a/pipenv/environments.py
+++ b/pipenv/environments.py
@@ -76,7 +76,9 @@ def normalize_pipfile_path(p):
 SESSION_IS_INTERACTIVE = _isatty(sys.stdout)
 
 # TF_BUILD indicates to Azure pipelines it is a build step
-PIPENV_IS_CI = is_env_truthy("CI") or is_env_truthy("TF_BUILD")
+PIPENV_IS_CI = get_from_env("CI", prefix="", check_for_negation=False) or is_env_truthy(
+    "TF_BUILD"
+)
 
 
 NO_COLOR = False


Test patch: