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

nbgitpuller source package is incomplete #210

Closed
manics opened this issue Sep 1, 2021 · 1 comment · Fixed by #211
Closed

nbgitpuller source package is incomplete #210

manics opened this issue Sep 1, 2021 · 1 comment · Fixed by #211
Labels

Comments

@manics
Copy link
Member

manics commented Sep 1, 2021

Bug description

nbgitpuller 1.0.0 source package is either missing some files, or calls npm unnecessarily

$ pip install https://files.pythonhosted.org/packages/61/c/c87c7cf4edaf61f4b71faee9ef074f03a5d7a4e26fe6a8c0a36a8ee03f00/nbgitpuller-1.0.0.tar.gz

Collecting https://files.pythonhosted.org/packages/61/c6/c87c7cf4edaf61f4b71faee9ef074f03a5d7a4e26fe6a8c0a36a8ee03f00/nbgitpuller-1.0.0.tar.gz
  Using cached nbgitpuller-1.0.0.tar.gz (428 kB)
    ERROR: Command errored out with exit status 1:
     command: /tmp/test/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-7gtz5b_d/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-7gtz5b_d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-9w72cltg
         cwd: /tmp/pip-req-build-7gtz5b_d/
    Complete output (17 lines):
    npm ERR! code ENOENT
    npm ERR! syscall open
    npm ERR! path /tmp/pip-req-build-7gtz5b_d/package.json
    npm ERR! errno -2
    npm ERR! enoent ENOENT: no such file or directory, open '/tmp/pip-req-build-7gtz5b_d/package.json'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent
 
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/simon/.npm/_logs/2021-09-01T19_54_00_470Z-debug.log
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-7gtz5b_d/setup.py", line 12, in <module>
        subprocess.check_call(['npm', 'install'])
      File "/tmp/test/lib/python3.9/subprocess.py", line 373, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['npm', 'install']' returned non-zero exit status 254.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/61/c6/c87c7cf4edaf61f4b71faee9ef074f03a5d7a4e26fe6a8c0a36a8ee03f00/nbgitpuller-1.0.0.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@manics manics added the bug label Sep 1, 2021
@manics
Copy link
Member Author

manics commented Sep 1, 2021

Note the source package includes some js files:

$ tar -ztvf nbgitpuller-1.0.0.tar.gz |grep \\.js
-rw-r--r-- runner/docker    89 2021-09-01 16:23 nbgitpuller-1.0.0/nbgitpuller/etc/jupyter_notebook_config.d/nbgitpuller.json
-rw-r--r-- runner/docker    87 2021-09-01 16:23 nbgitpuller-1.0.0/nbgitpuller/etc/jupyter_server_config.d/nbgitpuller.json
-rw-r--r-- runner/docker 424792 2021-09-01 16:23 nbgitpuller-1.0.0/nbgitpuller/static/dist/bundle.js
-rw-r--r-- runner/docker    475 2021-09-01 16:23 nbgitpuller-1.0.0/nbgitpuller/static/dist/bundle.js.LICENSE.txt
-rw-r--r-- runner/docker 1205965 2021-09-01 16:23 nbgitpuller-1.0.0/nbgitpuller/static/dist/bundle.js.map
-rw-r--r-- runner/docker    9193 2021-09-01 16:23 nbgitpuller-1.0.0/nbgitpuller/static/js/index.js

Assuming these are as expected it shouldn't be necessary to call npm, however

nbgitpuller/setup.py

Lines 12 to 13 in 4ffd009

subprocess.check_call(['npm', 'install'])
subprocess.check_call(['npm', 'run', 'webpack'])

means npm is always run when setup.py is loaded.

Ideally it'd only be run as part of the build. See for example

The alternative is to remove the js files from the source dist, and instead package all the files (e.g. package.json) required for npm to run.

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

Successfully merging a pull request may close this issue.

1 participant