Skip to content

[chore] keplergl-jupyter: reduce list of python build requirements#3083

Open
jorisvandenbossche wants to merge 1 commit intokeplergl:masterfrom
jorisvandenbossche:reduce-build-requirements
Open

[chore] keplergl-jupyter: reduce list of python build requirements#3083
jorisvandenbossche wants to merge 1 commit intokeplergl:masterfrom
jorisvandenbossche:reduce-build-requirements

Conversation

@jorisvandenbossche
Copy link
Copy Markdown

I noticed that installing this package installs a bunch of packages when pip creates the isolated build environment (which happens since keplergl-jupyter only provides a source distribution, so it will "build" a wheel when installing).

Right now also packages like geopandas and pyarrow get installed in that isolated build environment, while those are not needed for building the wheel (only as runtime dependency in the environment in which you are installing keplergl into).

I think only jupyter-packaging (and its dependencies like setuptools) is needed for running setup.py (also following https://github.com/jupyter/jupyter-packaging?tab=readme-ov-file#as-a-build-requirement).
The actual runtime dependencies which includes the packages like geopandas and pyarrow, are still listed in is still the setup.py (install_requires), so this change should not impact the end result of pip install keplergl-jupyter`

@heshan0131 heshan0131 requested a review from lixun910 May 8, 2025 09:21
@lixun910 lixun910 requested a review from Copilot May 8, 2025 16:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to reduce the Python build requirements for keplergl-jupyter by removing packages that are not needed for building the wheel.

  • Removed unnecessary build-time dependencies (geopandas, ipywidgets, notebook, jupyter-contrib-nbextensions, jupyterlab, pyarrow, wheel)
  • Retained only the essential build dependencies (jupyter_packaging and setuptools)
Comments suppressed due to low confidence (1)

bindings/kepler.gl-jupyter/pyproject.toml:2

  • Confirm that the dependencies removed from the build requirements are properly declared as runtime dependencies in setup.py to ensure a consistent installation experience.
requires = ["jupyter_packaging~=0.12.3", "setuptools>=69.5.1"]

@lixun910
Copy link
Copy Markdown
Collaborator

lixun910 commented May 8, 2025

Thanks, @jorisvandenbossche! The pyproject.toml has not been really used in the build system. Maybe this is a good time to
replace setup.py with pyproject.toml since it is a modern practice in Python packaging?

I have copilot generate the following pyproject.toml. Can you do a quick check if this makes sense? Thank you very much!

[build-system]
requires = ["setuptools>=61.0", "wheel", "jupyter_packaging>=0.12.3"]
build-backend = "setuptools.build_meta"

[project]
name = "keplergl"
dynamic = ["version"]  # Let jupyter_packaging handle version
description = "This is a simple jupyter widget for kepler.gl, an advanced geospatial visualization tool, to render large-scale interactive maps."
readme = "README.md"
authors = [
    {name = "Shan He", email = "shan@uber.com"}
]
license = {text = "MIT"}
keywords = ["ipython", "jupyter", "widgets", "geospatial", "visualization", "webGL"]
classifiers = [
    "Development Status :: 4 - Beta",
    "Framework :: IPython",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "Topic :: Multimedia :: Graphics",
    "Programming Language :: Python :: 2",
    "Programming Language :: Python :: 3.6",
    "Programming Language :: Python :: 3.7",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
    "Topic :: Scientific/Engineering :: Visualization",
]
requires-python = ">=3.6,<3.13"
dependencies = [
    "ipywidgets>=8.1.5",
    "traittypes>=0.2.1",
    "traitlets>=4.3.2",
    "geopandas>=0.14.3",
    "Shapely>=1.6.4.post2",
    "jupyter_packaging>=0.12.3",
    "jupyter>=1.0.0",
    "jupyterlab>=4.1.6",
    "notebook>=6.0.1",
    "pyarrow>=16.0.0",
    "geoarrow-pyarrow>=0.1.2",
    "geoarrow-pandas>=0.1.1",
]

[project.urls]
Homepage = "https://github.com/keplergl/kepler.gl/tree/master/bindings/kepler.gl-jupyter"
Documentation = "https://docs.kepler.gl/docs/keplergl-jupyter"
Repository = "https://github.com/keplergl/kepler.gl"
Issues = "https://github.com/keplergl/kepler.gl/issues"

[project.optional-dependencies]
dev = [
    "pytest>=6.0",
    "pytest-cov>=2.0",
    "black>=22.0",
    "isort>=5.0",
    "flake8>=4.0",
]

[tool.setuptools]
packages = ["keplergl"]
zip-safe = false
include-package-data = true

[tool.jupyter-packaging]
js-dir = "js"
npm = ["yarn"]
build-cmd = "build"
data-files = [
    ["share/jupyter/nbextensions/keplergl-jupyter", "keplergl/static", "**"],
    ["share/jupyter/labextensions/keplergl-jupyter", "keplergl-jupyter/labextension", "**"],
    ["etc/jupyter/nbconfig/notebook.d", ".", "keplergl-jupyter.json"]
]
ensure-targets = [
    ["keplergl/static/index.js"],
    ["keplergl-jupyter/labextension/package.json"]
]

[tool.setuptools.dynamic]
version = {attr = "keplergl._version.__version__"}

@igorDykhta igorDykhta added the jupyter keplergl for Jupyter label May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jupyter keplergl for Jupyter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants