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

feat: update node_npm actions and workflow to support building in source directory #462

Merged
merged 4 commits into from
Mar 2, 2023

Conversation

torresxb1
Copy link
Contributor

Issue #, if available:

Description of changes:
Updates node actions and workflow to support building in source directory. Seems like a big PR but most is tests and changing comments to numpy docstring format. Tests will fail until this other PR is merged: #461

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

if self.install_links:
command.append("--install-links")

self.subprocess_npm.run(command, cwd=self.install_dir)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've realized the CI action maybe should've just been a subclass of the normal install action, and in general I'm not sure why we don't use the same flags. But it might be too late to change now.

subprocess_npm=subprocess_npm,
osutils=osutils,
build_options=self.options,
install_links=self.build_dir == self.source_dir,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to use install-links so npm installs local dependencies without any symbolic links and without dev dependencies or temporary files, but instead just like any other dependency.

self.subprocess_npm.run(["ci"], cwd=self.install_dir)
command = ["ci"]
if self.install_links:
command.append("--install-links")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something to keep in mind, is that we are appending in certain places and doing a + operation in other places, let's default to one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a problem with using both 🤔 . Appending to add one element, using "+" to concatenate two lists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any strong opinion here, but we can also use .extend() to concatenate two lists if we feel that's cleaner moving forward, though I think += is usually descriptive enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that its not a technical problem, its about cohesion.

Copy link
Contributor

@mildaniel mildaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks Rup

@torresxb1 torresxb1 enabled auto-merge (squash) March 2, 2023 20:10
@torresxb1 torresxb1 merged commit 1f3c658 into aws:develop Mar 2, 2023
@torresxb1
Copy link
Contributor Author

Thanks for the reviews!

@torresxb1 torresxb1 deleted the build-in-source-node-npm branch March 2, 2023 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants