Skip to content

Commit

Permalink
chore: Improve npm install debug logging (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
mildaniel authored May 13, 2024
1 parent 4b8b675 commit 002b6f9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ integ-test:
LAMBDA_BUILDERS_DEV=1 pytest tests/integration

lint:
# Liner performs static analysis to catch latent bugs
ruff aws_lambda_builders
# Linter performs static analysis to catch latent bugs
ruff check aws_lambda_builders

lint-fix:
ruff aws_lambda_builders --fix
Expand All @@ -35,4 +35,4 @@ black-check:
# Verifications to run before sending a pull request
pr: init dev black-check

format: lint-fix black
format: lint-fix black
4 changes: 2 additions & 2 deletions aws_lambda_builders/workflows/nodejs_npm/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def execute(self):
:raises lambda_builders.actions.ActionFailedError: when NPM execution fails
"""
try:
LOG.debug("NODEJS installing in: %s", self.install_dir)
LOG.debug("NODEJS installing production dependencies in: %s", self.install_dir)

command = ["install", "-q", "--no-audit", "--no-save", "--unsafe-perm", "--production"]
self.subprocess_npm.run(command, cwd=self.install_dir)
Expand All @@ -132,7 +132,7 @@ def execute(self):
:raises lambda_builders.actions.ActionFailedError: when NPM execution fails
"""
try:
LOG.debug("NODEJS updating in: %s", self.install_dir)
LOG.debug("NODEJS updating production dependencies in: %s", self.install_dir)

command = [
"update",
Expand Down
5 changes: 5 additions & 0 deletions aws_lambda_builders/workflows/nodejs_npm/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ def get_install_action(
if build_options and isinstance(build_options, dict):
npm_ci_option = build_options.get("use_npm_ci", False)

LOG.debug(
"npm installation actions install only production dependencies. "
"Dev dependencies are omitted from the Lambda artifacts package"
)

if (osutils.file_exists(lockfile_path) or osutils.file_exists(shrinkwrap_path)) and npm_ci_option:
return NodejsNpmCIAction(
install_dir=install_dir, subprocess_npm=subprocess_npm, install_links=is_building_in_source
Expand Down
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
[tool.ruff]
line-length = 120

[tool.ruff.lint]

select = [
"E", # Pycodestyle
"F", # Pyflakes
"PL", # pylint
"I", # isort
"E", # Pycodestyle
"F", # Pyflakes
"PL", # pylint
"I", # isort
]
ignore = ["PLR0913"]

[tool.ruff.pylint]
[tool.ruff.lint.pylint]
max-branches = 13

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "E501"]
"aws_lambda_builders/workflow.py" = ["E501"]

Expand All @@ -32,4 +34,4 @@ exclude = '''
| pip-wheel-metadata
)/
)
'''
'''

0 comments on commit 002b6f9

Please sign in to comment.