diff --git a/aws_lambda_builders/workflows/python_pip/packager.py b/aws_lambda_builders/workflows/python_pip/packager.py index 788f0b3fa..fd907f63a 100644 --- a/aws_lambda_builders/workflows/python_pip/packager.py +++ b/aws_lambda_builders/workflows/python_pip/packager.py @@ -266,8 +266,8 @@ def _has_at_least_one_package(self, filename): # actually being specified, but those aren't common # cases. for line in f: - line = line.strip() - if line and not line.startswith("#"): + stripped_line = line.strip() + if stripped_line and not stripped_line.startswith("#"): return True return False @@ -296,11 +296,10 @@ def _download_dependencies(self, directory, requirements_filename): for package in deps: if package.dist_type == "sdist": sdists.add(package) + elif self._is_compatible_wheel_filename(package.filename): + compatible_wheels.add(package) else: - if self._is_compatible_wheel_filename(package.filename): - compatible_wheels.add(package) - else: - incompatible_wheels.add(package) + incompatible_wheels.add(package) LOG.debug("initial compatible: %s", compatible_wheels) LOG.debug("initial incompatible: %s", incompatible_wheels | sdists) diff --git a/aws_lambda_builders/workflows/ruby_bundler/workflow.py b/aws_lambda_builders/workflows/ruby_bundler/workflow.py index 451ef605a..0dd082426 100644 --- a/aws_lambda_builders/workflows/ruby_bundler/workflow.py +++ b/aws_lambda_builders/workflows/ruby_bundler/workflow.py @@ -52,13 +52,12 @@ def __init__(self, source_dir, artifacts_dir, scratch_dir, manifest_path, runtim # clean up the dependencies first self.actions.append(CleanUpAction(self.dependencies_dir)) self.actions.append(CopyDependenciesAction(source_dir, artifacts_dir, self.dependencies_dir)) - else: + elif self.dependencies_dir: # if dependencies folder exists and not download dependencies, simply copy the dependencies from the # dependencies folder to artifact folder - if self.dependencies_dir: - self.actions.append(CopySourceAction(self.dependencies_dir, artifacts_dir)) - else: - LOG.info( - "download_dependencies is False and dependencies_dir is None. Copying the source files into the " - "artifacts directory. " - ) + self.actions.append(CopySourceAction(self.dependencies_dir, artifacts_dir)) + else: + LOG.info( + "download_dependencies is False and dependencies_dir is None. Copying the source files into the " + "artifacts directory. " + ) diff --git a/requirements/dev.txt b/requirements/dev.txt index 44e6f2d1d..f39103230 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,4 +12,4 @@ pyelftools~=0.29 # Used to verify the generated Go binary architecture in integr # formatter black==23.1.0 -ruff==0.0.247 \ No newline at end of file +ruff==0.0.254 \ No newline at end of file