@@ -236,14 +236,14 @@ def __init__(self, python_version, python_path):
236
236
def __enter__ (self ):
237
237
# Only inject when the value is valid
238
238
if self .python_version :
239
- os .environ ["PIP_PYTHON_VERSION " ] = str (self .python_version )
239
+ os .environ ["PIPENV_REQUESTED_PYTHON_VERSION " ] = str (self .python_version )
240
240
if self .python_path :
241
241
os .environ ["PIP_PYTHON_PATH" ] = str (self .python_path )
242
242
243
243
def __exit__ (self , * args ):
244
244
# Restore original Python version information.
245
245
try :
246
- del os .environ ["PIP_PYTHON_VERSION " ]
246
+ del os .environ ["PIPENV_REQUESTED_PYTHON_VERSION " ]
247
247
except KeyError :
248
248
pass
249
249
@@ -682,25 +682,21 @@ def pip_command(self):
682
682
self ._pip_command = self ._get_pip_command ()
683
683
return self ._pip_command
684
684
685
- def prepare_pip_args (self , use_pep517 = True , build_isolation = True ):
685
+ def prepare_pip_args (self , use_pep517 = False , build_isolation = True ):
686
686
pip_args = []
687
687
if self .sources :
688
688
pip_args = prepare_pip_source_args (self .sources , pip_args )
689
- if not use_pep517 :
689
+ if use_pep517 is False :
690
690
pip_args .append ("--no-use-pep517" )
691
- if not build_isolation :
691
+ if build_isolation is False :
692
692
pip_args .append ("--no-build-isolation" )
693
693
pip_args .extend (["--cache-dir" , environments .PIPENV_CACHE_DIR ])
694
694
return pip_args
695
695
696
696
@property
697
697
def pip_args (self ):
698
- use_pep517 = False if (
699
- os .environ .get ("PIP_NO_USE_PEP517" , None ) is not None
700
- ) else (True if os .environ .get ("PIP_USE_PEP517" , None ) is not None else None )
701
- build_isolation = False if (
702
- os .environ .get ("PIP_NO_BUILD_ISOLATION" , None ) is not None
703
- ) else (True if os .environ .get ("PIP_BUILD_ISOLATION" , None ) is not None else None )
698
+ use_pep517 = environments .get_from_env ("USE_PEP517" , prefix = "PIP" )
699
+ build_isolation = environments .get_from_env ("BUILD_ISOLATION" , prefix = "PIP" )
704
700
if self ._pip_args is None :
705
701
self ._pip_args = self .prepare_pip_args (
706
702
use_pep517 = use_pep517 , build_isolation = build_isolation
@@ -790,6 +786,7 @@ def get_resolver(self, clear=False, pre=False):
790
786
self ._resolver = PiptoolsResolver (
791
787
constraints = self .parsed_constraints , repository = self .repository ,
792
788
cache = DependencyCache (environments .PIPENV_CACHE_DIR ), clear_caches = clear ,
789
+ # TODO: allow users to toggle the 'allow unsafe' flag to resolve setuptools?
793
790
prereleases = pre , allow_unsafe = False
794
791
)
795
792
0 commit comments