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

Installing from source without npm #623

Open
sbrugman opened this issue May 30, 2024 · 1 comment
Open

Installing from source without npm #623

sbrugman opened this issue May 30, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sbrugman
Copy link

Is your feature request related to a problem? Please describe.
I'd like to install the master branch from source util v1.5.4 is released with the fix merged before.
The machine installing the code has no NodeJS installed, and it's not trivial to do so.
The setup fails with the following error:

Collecting sqllineage@ https://github.com/reata/sqllineage/archive/refs/heads/master.zip (from my-package==0.0.1->-r requirements.txt (line 1))
  Downloading https://github.com/reata/sqllineage/archive/refs/heads/master.zip
     / 709.9 kB 2.7 MB/s 0:00:00
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [2 lines of output]
      running egg_info
      error: [Errno 2] No such file or directory: 'npm'
      [end of output]

Describe the solution you'd like
I'd like the package to skip the javascript component when nodes/npm are unavailable, but continue with the Python installation (perhaps a warning).

The change should be simple, e.g. try-except or check if the npm bin is present:
https://github.com/reata/sqllineage/blob/master/setup.py#L28

Describe alternatives you've considered
A release would also solve my problem directly. Still I'd suggest considering this change, for future users.

Additional context
Add any other context or screenshots about the feature request here.

@sbrugman sbrugman added the enhancement New feature or request label May 30, 2024
@reata
Copy link
Owner

reata commented Jun 10, 2024

That's a good point. JavaScript component is indeed optional but Python packaging tools doesn't provide a way to mark non-Python modules as optional when building whl package.

On the other hand, installing from source code does give us the flexibility to NOT running npm command when not available.

Taking Python itself as an example, it can be successfully compiled with missing optional modules like _tkinter, _ssl, etc. A message is left in the compiling log to remind user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants