Skip to content

Commit e9ccfd1

Browse files
authored
release: Release for 1.3.0
1.3.0 Release PR
2 parents 270e1da + 2ad17ff commit e9ccfd1

File tree

7 files changed

+30
-6
lines changed

7 files changed

+30
-6
lines changed

.appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ for:
6060

6161
# setup go
6262
- rmdir c:\go /s /q
63-
- "choco install golang"
63+
- "choco install golang --version 1.15.7"
6464
- "choco install bzr"
6565
- "choco install dep"
6666
- setx PATH "C:\go\bin;C:\gopath\bin;C:\Program Files (x86)\Bazaar\;C:\Program Files\Mercurial;%PATH%;"

aws_lambda_builders/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
22
AWS Lambda Builder Library
33
"""
4-
__version__ = "1.2.0"
4+
__version__ = "1.3.0"
55
RPC_PROTOCOL_VERSION = "0.3"

aws_lambda_builders/workflows/python_pip/compat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
def pip_import_string(python_exe):
88
os_utils = OSUtils()
99
cmd = [python_exe, "-c", "import pip; print(pip.__version__)"]
10-
p = os_utils.popen(cmd, stdout=os_utils.pipe, stderr=os_utils.pipe)
10+
p = os_utils.popen(cmd, stdout=os_utils.pipe, stderr=os_utils.pipe, env=os_utils.original_environ())
1111
stdout, stderr = p.communicate()
1212
if not p.returncode == 0:
1313
raise MissingPipError(python_path=python_exe)

aws_lambda_builders/workflows/python_pip/packager.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ def _generate_egg_info(self, package_dir):
494494
cmd = [sys.executable, "-c", script, "--no-user-cfg", "egg_info", "--egg-base", "egg-info"]
495495
egg_info_dir = self._osutils.joinpath(package_dir, "egg-info")
496496
self._osutils.makedirs(egg_info_dir)
497-
p = subprocess.Popen(cmd, cwd=package_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
497+
p = subprocess.Popen(
498+
cmd, cwd=package_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=self._osutils.original_environ()
499+
)
498500
p.communicate()
499501
info_contents = self._osutils.get_directory_contents(egg_info_dir)
500502
pkg_info_path = self._osutils.joinpath(egg_info_dir, info_contents[0], "PKG-INFO")
@@ -535,7 +537,7 @@ def __init__(self, osutils=None, python_exe=None, import_string=None):
535537

536538
def main(self, args, env_vars=None, shim=None):
537539
if env_vars is None:
538-
env_vars = self._osutils.environ()
540+
env_vars = self._osutils.original_environ()
539541
if shim is None:
540542
shim = ""
541543
run_pip = ("import sys; %s; sys.exit(main(%s))") % (self._import_string, args)

aws_lambda_builders/workflows/python_pip/utils.py

+17
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,29 @@
1010
import shutil
1111
import tarfile
1212
import subprocess
13+
import sys
1314

1415

1516
class OSUtils(object):
1617
def environ(self):
1718
return os.environ
1819

20+
def original_environ(self):
21+
# https://pyinstaller.readthedocs.io/en/stable/runtime-information.html#ld-library-path-libpath-considerations
22+
env = dict(os.environ)
23+
# Check whether running as a PyInstaller binary
24+
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
25+
lp_key = "LD_LIBRARY_PATH"
26+
original_lp = env.get(lp_key + "_ORIG")
27+
if original_lp is not None:
28+
env[lp_key] = original_lp
29+
else:
30+
# This happens when LD_LIBRARY_PATH was not set.
31+
# Remove the env var as a last resort:
32+
env.pop(lp_key, None)
33+
34+
return env
35+
1936
def file_exists(self, filename):
2037
return os.path.isfile(filename)
2138

aws_lambda_builders/workflows/python_pip/validator.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88

99
from aws_lambda_builders.exceptions import MisMatchRuntimeError
10+
from .utils import OSUtils
1011

1112
LOG = logging.getLogger(__name__)
1213

@@ -39,7 +40,9 @@ def validate(self, runtime_path):
3940

4041
cmd = self._validate_python_cmd(runtime_path)
4142

42-
p = subprocess.Popen(cmd, cwd=os.getcwd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
43+
p = subprocess.Popen(
44+
cmd, cwd=os.getcwd(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=OSUtils().original_environ()
45+
)
4346
p.communicate()
4447
if p.returncode != 0:
4548
raise MisMatchRuntimeError(language=self.language, required_runtime=self.runtime, runtime_path=runtime_path)

aws_lambda_builders/workflows/python_pip/workflow.py

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class PythonPipWorkflow(BaseWorkflow):
2020
".aws-sam",
2121
".chalice",
2222
".git",
23+
".gitignore",
2324
# Compiled files
2425
"*.pyc",
2526
"__pycache__",
@@ -51,6 +52,7 @@ class PythonPipWorkflow(BaseWorkflow):
5152
"venv.bak",
5253
"env.bak",
5354
"ENV",
55+
"env",
5456
# Editors
5557
# TODO: Move the commonly ignored files to base class
5658
".vscode",

0 commit comments

Comments
 (0)