-
-
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
Set build_isolation and use_pep517 correctly #4248
Conversation
- `ignore_compatibility` is meant to resolve hashes into the lockfile after resolution happens - We still want compatible items to be the ones we actually tell pip to install - Fixes #4231 Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
- Fix how `use_pep517` and `build_isolation` are read from the environment -- introduce a new environment helper to detect `<PREFIX>_<SETTING>` and `<PREFIX>_NO_<SETTING>`, check for booleans and return appropriately boolean, str, or None types - Check for `False` values when adding `--no-use-pep517` and `--no-build-isolation` during resolution rather than falsey values - Change environment variable name from `PIP_PYTHON_VERSION` to `PIPENV_REQUESTED_PYTHON_VERSION` to avoid causing `pip` to fail due to accidentally percieving the `python_version` flag as being set -- this is an artifact from attempting to resolve outside of the virtualenv - Add `pipenv` to the path of patched `notpip.__main__` to accommodate updated import fully qualified module names - Update `pip` and `piptools` patches - Add test packages for each of two known failure modes: outdated `setuptools` with a missing `build-backend` (which `pip` forces to `build_meta:__legacy__` & which doesn't exist before `40.8`), and `import Cython` statements in `setup.py` in packages with properly defined `pyproject.toml` `build-backend` lines. - Fixes #4231 - Replaces, includes, and closes #4242 Signed-off-by: Dan Ryan <dan.ryan@canonical.com> Add integration tests for #4231 Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
pipenv/environments.py
Outdated
if positive_lookup in os.environ: | ||
if _is_env_truthy(positive_lookup): | ||
return bool(os.environ[positive_lookup]) | ||
return os.environ[positive_lookup] |
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 seems wrong to me. Think of ENABLE_SOMETHING=0
, does it mean to enable or disable?
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.
so the answer to that is it should be disabled -- the real answer is that I was not at all thinking about how _is_env_truthy
works and it really can't be used here to achieve this
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.
Yeah, you are probably seeking for _is_env_boolean_like
.
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.
oh gosh is that a thing, I couldn't think of the name of it and probably just reinvented it
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 is not implemented, I just make up the name that indicates how the function should work.
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
Signed-off-by: Dan Ryan <dan.ryan@canonical.com>
use_pep517
andbuild_isolation
are read from theenvironment -- introduce a new environment helper to detect
<PREFIX>_<SETTING>
and<PREFIX>_NO_<SETTING>
, check for booleansand return appropriately boolean, str, or None types
False
values when adding--no-use-pep517
and--no-build-isolation
during resolution rather than falsey valuesPIP_PYTHON_VERSION
toPIPENV_REQUESTED_PYTHON_VERSION
to avoid causingpip
to fail dueto accidentally percieving the
python_version
flag as being set --this is an artifact from attempting to resolve outside of the
virtualenv
pipenv
to the path of patchednotpip.__main__
to accommodateupdated import fully qualified module names
pip
andpiptools
patchessetuptools
with a missingbuild-backend
(whichpip
forces tobuild_meta:__legacy__
& which doesn't exist before40.8
), andimport Cython
statements insetup.py
in packages with properlydefined
pyproject.toml
build-backend
lines.