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

Write our own minimum copy of npm in Python to remove dependency on Node.js during installation #129

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Xmader
Copy link
Member

@Xmader Xmader commented Jul 19, 2023

closes #116

@Xmader Xmader changed the title Write our own minimum copy of npm in Python to remove dependency on Node.js Write our own minimum copy of npm in Python to remove dependency on Node.js during installation Jul 19, 2023
@wesgarland
Copy link
Collaborator

wesgarland commented Jul 19, 2023

There must be a simpler way to handle the error condition of npm not existing than to write and ship a replacement package manager. How about sys.exit('npm not found - please install and pip install pythonmonkey again')

If we were to ship this, it would need to

  • resolve packages in a way that conflicting version numbers in dependencies work properly by virtue of node_modules. (i.e. naive path flattening is not good enough)
  • fire npm hooks correctly
  • support npm audit
  • interoperate correctly with Tidelift
  • support pminit npm i <user package> after install
  • resolve the latest package names that match package.json, not package-lock.json.
  • never, ever, have a versioning bug that can miss an update and expose Distributive to legal liability problems from a third party

That last two are why I don't want to ship packages with the wheel. Besides shipping cool software, I need to protect the company from ever being associated with a security problem, eg. getting mentioned in a CVE vulnerability report. This could seriously harm our ability to carry out our core business in the future.

Some day, I would like to have enough node-compatibility capability to actually run npm via pythonmonkey. We could maybe use pmpm to install npm as a special bootstrap case, since it has no dependencies. But we are quite a ways off from this, and we really need to focus on getting dcp-client running in web-compatibility mode before that.
Is there perhaps a way we can pass a command-line switch into pip that changes the package manager?

@Xmader Xmader marked this pull request as draft July 20, 2023 18:25
@wiwichips
Copy link
Collaborator

This MR is set to draft and will not be revisited until later - see comment here: #129 (comment)

@Xmader Xmader mentioned this pull request May 8, 2024
@Xmader
Copy link
Member Author

Xmader commented May 8, 2024

I've made the CI green, so that we could easily continue the work later.

@Xmader Xmader force-pushed the Xmader/feat/npm-py branch from d0ecd67 to 2b99eeb Compare May 8, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing npm should print better error during pip install
3 participants