visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.26k stars 2.08k forks source link

[Bug]: build failure pydeck #8469

Open natsukium opened 9 months ago

natsukium commented 9 months ago

Description

I can't install pydeck from the source due to an invalid pyproject.toml. See https://github.com/visgl/deck.gl/pull/6777#issuecomment-1079652376 And unfortunately, the CI was fixed in the wrong way in https://github.com/visgl/deck.gl/pull/7198

We should remove the deprecated setup.py develop and prepare the correct pyproject.toml or otherwise remove it until it is ready. https://setuptools.pypa.io/en/latest/deprecated/commands.html#running-setuptools-commands

Flavors

Expected Behavior

install pydeck without failure

Steps to Reproduce

docker run --rm -it python:3.11-slim bash
apt update && apt install -y git
git clone https://github.com/visgl/deck.gl
cd deck.gl/bindings/pydeck
pip install .

I followed this guide but without yarn, since this failure is not related to it.

Environment

Logs

!!
        _handle_missing_dynamic(dist, project_table)
      Traceback (most recent call last):
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 175, in <module>
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 159, in setup
          dist.parse_config_files()
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 627, in parse_config_files
          pyprojecttoml.apply_configuration(self, filename, ignore_option_errors)
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/config/pyprojecttoml.py", line 67, in apply_configuration
          return _apply(dist, config, filepath)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 56, in apply
          _apply_project_table(dist, config, root_dir)
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 82, in _apply_project_table
          corresp(dist, value, root_dir)
        File "/tmp/pip-build-env-649qibkf/overlay/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py", line 163, in _long_description
          file = val.get("file") or []
                 ^^^^^^^
      AttributeError: 'NoneType' object has no attribute 'get'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
donmccurdy commented 7 months ago

CC:

donmccurdy commented 7 months ago

I'm trying to resolve the broken local builds, and have perhaps made some progress, but I'm hitting other errors. Removing pyproject.toml does not seem to solve the issues for me. Sharing progress here in case others have ideas.

  1. Start a clean virtual env, on macOS:

    make setup-env
    . env/bin/activate
  2. Run make init

[!CAUTION] Jupyter command jupyter-nbextension not found.

  1. Edit bindings/pydeck/requirements/requirements-dev.txt to set jupyterlab<4.0.0

  2. Run make init again

  3. Run make prepare-jupyter

[!WARNING] (Deprecated) Installing extensions with the jupyter labextension install command is now deprecated and will be removed in a future major version of JupyterLab.

Users should manage prebuilt extensions with package managers like pip and conda, and extension authors are encouraged to distribute their extensions as prebuilt packages (Deprecated) Installing extensions with the jupyter labextension install command is now deprecated and will be removed in a future major version of JupyterLab.

Users should manage prebuilt extensions with package managers like pip and conda, and extension authors are encouraged to distribute their extensions as prebuilt packages

We'll ignore this for now. We currently don't support JupyterLab v4, and v3 reaches EOL next month, according to https://github.com/jupyterlab/jupyterlab/issues/15921. See #7030 for steps required to update to JupyterLab v4 — the migration appears non-trivial.

  1. Run jupyter notebook, open "01 Introduction" in examples/, and run all cells.

The first few cells complete, until we get to r.show(). Here we fail with JavaScript errors:

Screenshot 2024-04-01 at 4 04 58 PM

I'm not sure how to work around this part yet. My guess is that perhaps I need to roll back some other dependencies in requirements.txt or requirements-dev.txt, but I don't know which ones. If anyone currently has local builds working and would like to share the versions of dependencies you have installed (pip freeze) that might be helpful.

donmccurdy commented 7 months ago

I also tried running pypi-timemachine, which runs a local PyPi registry hiding any packages newer than the specified date. Testing an installation locked to <= 2023-01-01, the errors are essentially the same. I'm not sure pypi-timemachine affects nbextension extension installations, so maybe that's just not going to work here.

One other clue, notebooks are generating HTML/JS output like this...

    const tooltip = True; // 🛑 should be 'true', not 'True'!
    const customLibraries = null;
    const configuration = null;

... if that narrows down which dependency might be causing the problem. 😕

donmccurdy commented 7 months ago

Partial fix coming in https://github.com/visgl/deck.gl/pull/8756. Still working on the runtime errors above.

donmccurdy commented 7 months ago

Additional fix in https://github.com/visgl/deck.gl/pull/8780. The const tooltip = True error is fixed. Errors from the widget bindings remain, and prevent .show() from working, but .to_html() now renders the map.

donmccurdy commented 7 months ago

Current state of debugging, known errors, and known workarounds in:

https://gist.github.com/donmccurdy/4cb069e73cbb82b6e5f75a0b3a6bb74f