Preserve environment.

This commit is contained in:
Jelmer Vernooij 2021-05-16 16:47:07 +01:00
parent 6f67102144
commit 8f2aaf30a8

View file

@ -463,7 +463,8 @@ class SetupPy(BuildSystem):
if interpreter is None: if interpreter is None:
interpreter = self.DEFAULT_PYTHON interpreter = self.DEFAULT_PYTHON
argv = [interpreter, "./setup.py"] + args argv = [interpreter, "./setup.py"] + args
env = {} # TODO(jelmer): Perhaps this should be additive?
env = dict(os.environ)
# Inherit SETUPTOOLS_SCM_PRETEND_VERSION from the current environment # Inherit SETUPTOOLS_SCM_PRETEND_VERSION from the current environment
if "SETUPTOOLS_SCM_PRETEND_VERSION" in os.environ: if "SETUPTOOLS_SCM_PRETEND_VERSION" in os.environ:
env["SETUPTOOLS_SCM_PRETEND_VERSION"] = os.environ[ env["SETUPTOOLS_SCM_PRETEND_VERSION"] = os.environ[