Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# pygtk.require().
#init-hook=

# Add files or directories to the blacklist. They should be base names, not
# Add files or directories to the ignore list. They should be base names, not
# paths.
ignore=compat.py, utils.py

Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/custom_make/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ It is then the responsibility of the make target to make sure the artifacts are
* We only care about certain build targets. so essentially this is a pluggable builder, but nothing beyond that at this point in time.

* Which environment variables are usable in this makefile?
* There are a series of whitelisted environment variables that need to be defined and not be overriden within the Makefile to work. Currently that is just `$ARTIFACTS_DIR`
* There are a series of allowlisted environment variables that need to be defined and not be overridden within the Makefile to work. Currently that is just `$ARTIFACTS_DIR`

* Can this be used even for runtimes that have builders associated with it? eg: python3.8?
* Possibly, some changes would be needed be made to way the corresponding builder is picked up in sam cli. If we changed it such that there is a makefile we pick a makefile builder and if not fall back to the specified language builder.
Expand Down
12 changes: 6 additions & 6 deletions aws_lambda_builders/workflows/python_pip/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class DependencyBuilder(object):
"manylinux2010_x86_64",
"manylinux2014_x86_64",
}
_COMPATIBLE_PACKAGE_WHITELIST = {"sqlalchemy"}
_COMPATIBLE_PACKAGE_ALLOWLIST = {"sqlalchemy"}

def __init__(self, osutils, runtime, pip_runner=None):
"""Initialize a DependencyBuilder.
Expand Down Expand Up @@ -291,9 +291,9 @@ def _download_dependencies(self, directory, requirements_filename):
# Now there is still the case left over where the setup.py has been
# made in such a way to be incompatible with python's setup tools,
# causing it to lie about its compatibility. To fix this we have a
# manually curated whitelist of packages that will work, despite
# manually curated allowlist of packages that will work, despite
# claiming otherwise.
compatible_wheels, incompatible_wheels = self._apply_wheel_whitelist(compatible_wheels, incompatible_wheels)
compatible_wheels, incompatible_wheels = self._apply_wheel_allowlist(compatible_wheels, incompatible_wheels)
missing_wheels = deps - compatible_wheels
LOG.debug("Final compatible: %s", compatible_wheels)
LOG.debug("Final incompatible: %s", incompatible_wheels)
Expand All @@ -305,7 +305,7 @@ def _download_all_dependencies(self, requirements_filename, directory):
# Download dependencies prefering wheel files but falling back to
# raw source dependences to get the transitive closure over
# the dependency graph. Return the set of all package objects
# which will serve as the master list of dependencies needed to deploy
# which will serve as the primary list of dependencies needed to deploy
# successfully.
self._pip.download_all_dependencies(requirements_filename, directory)
deps = {Package(directory, filename) for filename in self._osutils.get_directory_contents(directory)}
Expand Down Expand Up @@ -365,11 +365,11 @@ def _is_compatible_wheel_filename(self, filename):
# Don't know what we have but it didn't pass compatibility tests.
return False

def _apply_wheel_whitelist(self, compatible_wheels, incompatible_wheels):
def _apply_wheel_allowlist(self, compatible_wheels, incompatible_wheels):
compatible_wheels = set(compatible_wheels)
actual_incompatible_wheels = set()
for missing_package in incompatible_wheels:
if missing_package.name in self._COMPATIBLE_PACKAGE_WHITELIST:
if missing_package.name in self._COMPATIBLE_PACKAGE_ALLOWLIST:
compatible_wheels.add(missing_package)
else:
actual_incompatible_wheels.add(missing_package)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/workflows/python_pip/test_packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def test_can_replace_incompat_whl(self, tmpdir, osutils, pip_runner):
for req in reqs:
assert req in installed_packages

def test_whitelist_sqlalchemy(self, tmpdir, osutils, pip_runner):
def test_allowlist_sqlalchemy(self, tmpdir, osutils, pip_runner):
reqs = ["sqlalchemy==1.1.18"]
pip, runner = pip_runner
appdir, builder = self._make_appdir_and_dependency_builder(reqs, tmpdir, runner)
Expand Down