Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Improve npm install debug logging #652

Merged
merged 1 commit into from
May 13, 2024
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
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
)/
)
'''
'''
Loading