Skip to content

Commit 4861691

Browse files
Merge branch 'develop'
2 parents 2cef6c8 + 1583ef3 commit 4861691

File tree

6 files changed

+20
-11
lines changed

6 files changed

+20
-11
lines changed

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@v2
49+
uses: github/codeql-action/init@v3
5050
with:
5151
languages: ${{ matrix.language }}
5252
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -60,7 +60,7 @@ jobs:
6060
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
6161
# If this step fails, then you should remove it and run the build manually (see below)
6262
- name: Autobuild
63-
uses: github/codeql-action/autobuild@v2
63+
uses: github/codeql-action/autobuild@v3
6464

6565
# ℹ️ Command-line programs to run using the OS shell.
6666
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -73,6 +73,6 @@ jobs:
7373
# ./location_of_script_within_repo/buildscript.sh
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@v2
76+
uses: github/codeql-action/analyze@v3
7777
with:
7878
category: "/language:${{matrix.language}}"

aws_lambda_builders/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# Changing version will trigger a new release!
66
# Please make the version change as the last step of your development.
77

8-
__version__ = "1.44.0"
8+
__version__ = "1.45.0"
99
RPC_PROTOCOL_VERSION = "0.3"

aws_lambda_builders/workflows/python_pip/packager.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -772,12 +772,14 @@ def _execute(self, command, args, env_vars=None, shim=None):
772772
main_args = [command] + args
773773
LOG.debug("calling pip %s", " ".join(main_args))
774774
rc, out, err = self._wrapped_pip.main(main_args, env_vars=env_vars, shim=shim)
775+
LOG.debug("pip stdout: %s", out)
776+
LOG.debug("pip stderr: %s", err)
775777
return rc, out, err
776778

777779
def build_wheel(self, wheel, directory, compile_c=True):
778780
"""Build an sdist into a wheel file."""
779781
arguments = ["--no-deps", "--wheel-dir", directory, wheel]
780-
env_vars = self._osutils.environ()
782+
env_vars = self._osutils.original_environ()
781783
shim = ""
782784
if not compile_c:
783785
env_vars.update(pip_no_compile_c_env_vars)

aws_lambda_builders/workflows/python_pip/utils.py

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717

1818
class OSUtils(object):
19-
def environ(self):
20-
return os.environ
21-
2219
def original_environ(self):
2320
# https://pyinstaller.readthedocs.io/en/stable/runtime-information.html#ld-library-path-libpath-considerations
2421
env = dict(os.environ)

tests/functional/workflows/python_pip/test_packager.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import tarfile
55
import io
66
from collections import defaultdict, namedtuple
7-
from unittest import mock
7+
from unittest import TestCase, mock
88

99
import pytest
1010

@@ -182,7 +182,7 @@ def osutils():
182182
@pytest.fixture
183183
def empty_env_osutils():
184184
class EmptyEnv(object):
185-
def environ(self):
185+
def original_environ(self):
186186
return {}
187187

188188
return EmptyEnv()
@@ -830,6 +830,16 @@ def test_build_into_existing_dir_with_preinstalled_packages(self, tmpdir, osutil
830830
assert installed_packages == ["bar"]
831831

832832

833+
class TestPipRunner(TestCase):
834+
def test_build_wheel_calls_pip_without_ld_library_path(self):
835+
pip_mock = mock.Mock()
836+
pip_mock.main.return_value = (0, "out", "err")
837+
os_utils_mock = mock.Mock()
838+
pip_runner = PipRunner(mock.Mock(), pip_mock, os_utils_mock)
839+
pip_runner.build_wheel("wheel", "dir")
840+
os_utils_mock.original_environ.assert_called_once()
841+
842+
833843
class TestSubprocessPip(object):
834844
def test_can_invoke_pip(self):
835845
pip = SubprocessPip(python_exe=sys.executable)

tests/unit/workflows/python_pip/test_packager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class CustomEnv(OSUtils):
6161
def __init__(self, env):
6262
self._env = env
6363

64-
def environ(self):
64+
def original_environ(self):
6565
return self._env
6666

6767

0 commit comments

Comments
 (0)