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

Getting started contributing documentation #1754

Closed
dsblank opened this issue Sep 10, 2016 · 15 comments
Closed

Getting started contributing documentation #1754

dsblank opened this issue Sep 10, 2016 · 15 comments

Comments

@dsblank
Copy link
Member

dsblank commented Sep 10, 2016

Attempting to contribute to notebook on Ubuntu 14.04, followed the documentation for developers, but kept encountering an error:

# pip install -e . --user
Obtaining file:///home/dblank/notebook
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): tornado>=4 in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): ipython_genutils in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): traitlets>=4.2.1 in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): jupyter_core in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): jupyter_client in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): nbformat in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): nbconvert in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): ipykernel in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): terminado>=0.3.3 in /usr/local/lib/python3.4/dist-packages (from notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): MarkupSafe in /usr/local/lib/python3.4/dist-packages (from jinja2->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): backports_abc>=0.4 in /usr/local/lib/python3.4/dist-packages (from tornado>=4->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): decorator in /usr/local/lib/python3.4/dist-packages (from traitlets>=4.2.1->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python3.4/dist-packages (from traitlets>=4.2.1->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): pyzmq>=13 in /usr/local/lib/python3.4/dist-packages (from jupyter_client->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): jsonschema!=2.5.0,>=2.0 in /usr/local/lib/python3.4/dist-packages (from nbformat->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): entrypoints in /usr/local/lib/python3.4/dist-packages (from nbconvert->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): mistune!=0.6 in /usr/local/lib/python3.4/dist-packages (from nbconvert->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): pygments in /usr/local/lib/python3.4/dist-packages (from nbconvert->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): ipython>=4.0.0 in /usr/local/lib/python3.4/dist-packages (from ipykernel->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): ptyprocess in /usr/local/lib/python3.4/dist-packages (from terminado>=0.3.3->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in /usr/lib/python3/dist-packages (from ipython>=4.0.0->ipykernel->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): prompt-toolkit<2.0.0,>=1.0.3 in /usr/local/lib/python3.4/dist-packages (from ipython>=4.0.0->ipykernel->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): pexpect; sys_platform != "win32" in /usr/local/lib/python3.4/dist-packages (from ipython>=4.0.0->ipykernel->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): pickleshare in /usr/local/lib/python3.4/dist-packages (from ipython>=4.0.0->ipykernel->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in /usr/local/lib/python3.4/dist-packages (from ipython>=4.0.0->ipykernel->notebook==5.0.0.dev0)
Requirement already satisfied (use --upgrade to upgrade): wcwidth in /usr/local/lib/python3.4/dist-packages (from prompt-toolkit<2.0.0,>=1.0.3->ipython>=4.0.0->ipykernel->notebook==5.0.0.dev0)
Installing collected packages: notebook
  Running setup.py develop for notebook
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/home/dblank/notebook/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps --user --prefix=:
    running develop
    running jsversion
    running js
    running jsdeps
    > npm install --progress=false
    > npm dedupe
    > npm run bower

    > jupyter-notebook-deps@4.0.0 bower /home/dblank/notebook
    > bower install --allow-root --config.interactive=false

    Missing /home/dblank/notebook/notebook/static/built/index.js
    > npm run build:js

    > jupyter-notebook-deps@4.0.0 build:js /home/dblank/notebook
    > webpack

    [BABEL] Note: The code generator has deoptimised the styling of "/home/dblank/notebook/notebook/static/notebook/js/notebook.js" as it exceeds the max of "100KB".
    [BABEL] Note: The code generator has deoptimised the styling of "/home/dblank/notebook/notebook/static/notebook/js/notebook.js" as it exceeds the max of "100KB".
    [BABEL] Note: The code generator has deoptimised the styling of "/home/dblank/notebook/notebook/static/notebook/js/notebook.js" as it exceeds the max of "100KB".
    [BABEL] Note: The code generator has deoptimised the styling of "/home/dblank/notebook/notebook/static/notebook/js/notebook.js" as it exceeds the max of "100KB".
    ModuleBuildError: Module build failed: ReferenceError: Promise is not defined
        at LazyResult.async (/home/dblank/notebook/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:237:31)
        at LazyResult.then (/home/dblank/notebook/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:141:21)
        at processCss (/home/dblank/notebook/node_modules/css-loader/lib/processCss.js:198:5)
        at Object.module.exports (/home/dblank/notebook/node_modules/css-loader/lib/loader.js:24:2)
        at DependenciesBlock.onModuleBuildFailed (/home/dblank/notebook/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:315:19)
        at nextLoader (/home/dblank/notebook/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:270:31)
        at /home/dblank/notebook/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:292:15
        at runSyncOrAsync (/home/dblank/notebook/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:173:4)
        at nextLoader (/home/dblank/notebook/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:290:3)
        at /home/dblank/notebook/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
        at Storage.finished (/home/dblank/notebook/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
        at /home/dblank/notebook/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:78:16
        at fs.js:268:14
        at /home/dblank/notebook/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:43:10
        at Object.oncomplete (fs.js:107:15)
    [BABEL] Note: The code generator has deoptimised the styling of "/home/dblank/notebook/notebook/static/notebook/js/notebook.js" as it exceeds the max of "100KB".
    [BABEL] Note: The code generator has deoptimised the styling of "/home/dblank/notebook/notebook/static/notebook/js/notebook.js" as it exceeds the max of "100KB".
    npm ERR! weird error 1
    npm WARN This failure might be due to the use of legacy binary "node"
    npm WARN For further explanations, please read
    /usr/share/doc/nodejs/README.Debian

    npm ERR! not ok code 0
    /usr/local/lib/python3.4/dist-packages/setuptools/dist.py:331: UserWarning: Normalizing '5.0.0.dev' to '5.0.0.dev0'
      normalized_version,
    rebuilding js and css failed. The following required files are missing: ['notebook/static/built/index.js', 'notebook/static/style/ipython.min.css', 'notebook/static/style/style.min.css']
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/dblank/notebook/setup.py", line 198, in <module>
        main()
      File "/home/dblank/notebook/setup.py", line 195, in main
        setup(**setup_args)
      File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/dblank/notebook/setupbase.py", line 528, in run
        raise e
      File "/home/dblank/notebook/setupbase.py", line 518, in run
        self.distribution.run_command('js')
      File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/dblank/notebook/setupbase.py", line 454, in run
        run(['npm', 'run', 'build:js'])
      File "/home/dblank/notebook/setupbase.py", line 325, in run
        return check_call(cmd, *args, **kwargs)
      File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['npm', 'run', 'build:js']' returned non-zero exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/home/dblank/notebook/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps --user --prefix=" failed with error code 1 in /home/dblank/notebook/

I tried many things, but eventually I went through the .travis.yml, noted the use of nvm, and did the following:

curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
nvm install 5.6
nvm use 5.6
npm upgrade -g npm

which doesn't seem to be documented anywhere. But afterwards, I was able to build and install the notebook from source.

@dsblank
Copy link
Member Author

dsblank commented Sep 10, 2016

Also, had to deal with this error:

https://github.com/webpack/css-loader/issues/145

@gnestor
Copy link
Contributor

gnestor commented Sep 12, 2016

Yes, this appears to be the result of using a legacy version of Node (probably Node <4).

@Carreau @willingc Should the docs include a minimum Node version in the installation requirements? I just searched and I don't see any mention of Node as a requirement.

@gnestor gnestor added this to the No action milestone Sep 12, 2016
@willingc
Copy link
Member

@dsblank Sorry! Were you using the following links or docs from another spot? If from another spot, we should update that place to give users a bit more guidance.

https://jupyter-notebook.readthedocs.io/en/latest/contributing.html
https://jupyter-notebook.readthedocs.io/en/latest/contributing.html#installing-node-js-and-npm

The second link contains an important step with Ubuntu/Debian since the legacy node requires installation.

Most importantly, we are happy to have any doc contributions or corrections. Please feel free to ping me if you run up against something like this in the future.

@gnestor Feel free to add a note about using an up to date version of node. Thanks for following up!

@gnestor
Copy link
Contributor

gnestor commented Sep 12, 2016

@willingc Ok it looks like https://jupyter-notebook.readthedocs.io/en/latest/contributing.html#installing-node-js-and-npm covers it. Thanks.

@dsblank Feel free to close.

@dsblank
Copy link
Member Author

dsblank commented Sep 13, 2016

@willingc I did follow those instructions. The only way I could get nvm as a command was to do the above. I think that this is a separate issue.

@dsblank
Copy link
Member Author

dsblank commented Sep 13, 2016

Also note that the issue pointed to here webpack-contrib/css-loader#145 is another issue, I think because of version incompatibilities.

I think that docs you point to could use some checks ("at this point you should be able to run the following: node, nvm, npm, ... with these versions.") and followed by troubleshooting hints.

@willingc
Copy link
Member

@dsblank Thanks for the suggestions and we'll take a look at improving.

@gnestor I'm traveling today. Would you mind taking a look at the node/webpack process? Thanks!

@blink1073
Copy link
Member

We add the following in JupyterLab to work around the css-loader issue: https://github.com/jupyter/jupyterlab/blob/d32b3f8180cc1ec5bcad25b1ddc9b5d3f6924674/jupyterlab/webpack.config.js#L4-L6

@dsblank
Copy link
Member Author

dsblank commented Sep 13, 2016

@blink1073 Thanks for confirming; I had to add that line too.

@willingc
Copy link
Member

@blink1073 Thanks for adding this in 👍

@gnestor
Copy link
Contributor

gnestor commented Sep 13, 2016

@blink1073 Should I submit a PR to notebook adding the es6-promise polyfill to the webpack config?

@dsblank Where are you seeing the following: "at this point you should be able to run the following: node, nvm, npm, ... with these versions." I don't see it at https://jupyter-notebook.readthedocs.io/en/latest/contributing.html#installing-node-js-and-npm. I'd like to add that nvm is not a requirement for installing or running the notebook (nvm is a version manager for Node), just a non-legacy version of Node, so brew install node (on OS X) can be used in lieu of:

curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
nvm install 5.6
nvm use 5.6
npm upgrade -g npm

@dsblank
Copy link
Member Author

dsblank commented Sep 14, 2016

@gnestor I was suggesting that text like that should be added. That is, it would be helpful to have checks, and also troubleshooting along the process.

I am new to this the notebook development process; I'm just reporting the problem I had, and what appears to have resolved it. I'm using Ubuntu.

@gnestor
Copy link
Contributor

gnestor commented Sep 14, 2016

@dsblank Ok, you're on Ubuntu. Did you try sudo apt-get install nodejs-legacy npm? I did a little reading and the nodejs Ubuntu package does not provide a node command while the nodejs-legacy package does.

@blink1073
Copy link
Member

@gnestor, I'd say add the polyfill to the webpack config, the move it from bower to an npm requirement.

@jtpio
Copy link
Member

jtpio commented Jun 20, 2023

Closing as the contributing guide on main is now targeting Notebook 7: https://jupyter-notebook.readthedocs.io/en/latest/contributing.html

@jtpio jtpio closed this as completed Jun 20, 2023
@jtpio jtpio modified the milestones: Reference, 7.0 Jun 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants