diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb38c940a7..dc92464cfb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: rev: 24.8.0 hooks: - id: black-jupyter - language_version: python3.11 + language_version: python3.12 - repo: https://github.com/codespell-project/codespell rev: v2.3.0 diff --git a/leafmap/colormaps.py b/leafmap/colormaps.py index fb9dedcfb8..8c5595d8da 100644 --- a/leafmap/colormaps.py +++ b/leafmap/colormaps.py @@ -138,7 +138,7 @@ def create_colormap( axis_off: Optional[bool] = False, show_name: Optional[bool] = False, font_size: Optional[int] = 12, - **kwargs + **kwargs, ) -> None: """Plot a matplotlib colormap. @@ -207,7 +207,7 @@ def plot_colormap( axis_off: Optional[bool] = False, show_name: Optional[bool] = False, font_size: Optional[int] = 12, - **kwargs + **kwargs, ) -> None: """Plot a matplotlib colormap. @@ -267,7 +267,7 @@ def plot_colormaps( width: Optional[float] = 8.0, height: Optional[float] = 0.4, return_fig: Optional[bool] = False, - **kwargs + **kwargs, ) -> None: """Plot all available colormaps. diff --git a/leafmap/deck.py b/leafmap/deck.py index 7ce713676a..4e3040c628 100644 --- a/leafmap/deck.py +++ b/leafmap/deck.py @@ -123,7 +123,7 @@ def add_gdf( layer_type="GeoJsonLayer", layer_name: Optional[str] = None, random_color_column: Optional[str] = None, - **kwargs + **kwargs, ): """Adds a GeoPandas GeoDataFrame to the map. @@ -196,7 +196,7 @@ def add_vector( layer_type: str = "GeoJsonLayer", layer_name: Optional[str] = None, random_color_column: Optional[str] = None, - **kwargs + **kwargs, ): """Adds a vector file to the map. @@ -238,7 +238,7 @@ def add_geojson( filename: str, layer_name: Optional[str] = None, random_color_column: Optional[str] = None, - **kwargs + **kwargs, ): """Adds a GeoJSON file to the map. @@ -257,7 +257,7 @@ def add_shp( filename: str, layer_name: Optional[str] = None, random_color_column: Optional[str] = None, - **kwargs + **kwargs, ): """Adds a shapefile to the map. @@ -276,7 +276,7 @@ def add_kml( filename: str, layer_name: Optional[str] = None, random_color_column: Optional[str] = None, - **kwargs + **kwargs, ): """Adds a KML file to the map. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..269c51b19d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,80 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "leafmap" +version = "0.37.3" +dynamic = [ + "dependencies", +] +description = "A Python package for geospatial analysis and interactive mapping in a Jupyter environment." +readme = "README.md" +readme-content-type = "text/markdown" +requires-python = ">=3.8" +license = {text = "MIT license"} +keywords = ["leafmap"] +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "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", +] +authors = [{name = "Qiusheng Wu", email = "giswqs@gmail.com"}] +homepage = "https://github.com/opengeos/leafmap" +requires = ["setuptools>=42"] + +[project.optional-dependencies] +backends = ["bokeh", "keplergl", "maplibre", "pydeck", "plotly"] +lidar = ["ipygany", "ipyvtklink", "laspy", "panel", "pyntcloud[LAS]", "pyvista"] +raster = ["localtileserver>=0.10.0", "jupyter-server-proxy", "rio-cogeo", "rioxarray", "netcdf4", "pynhd", "py3dep"] +sql = ["psycopg2", "sqlalchemy"] +apps = ["streamlit-folium", "voila", "solara"] +vector = ["geopandas", "osmnx", "pmtiles", "flask", "flask-cors", "lonboard", "mapclassify"] +pmtiles = ["pmtiles", "flask", "flask-cors"] +ai = ["geopandas", "osmnx", "localtileserver>=0.10.0", "rastervision", "pytorch-lightning"] +maplibre = ["geopandas", "h3", "ipyvuetify", "localtileserver", "mapclassify", "maplibre", "pmtiles", "rioxarray", "xarray"] + +[tool] +[tool.setuptools.packages.find] +include = ["leafmap*"] +exclude = ["docs*"] + + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.distutils.bdist_wheel] +universal = true + +[tool.bumpversion] +current_version = "0.37.3" +commit = true +tag = true + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = 'version = "{current_version}"' +replace = 'version = "{new_version}"' + +[[tool.bumpversion.files]] +filename = "leafmap/__init__.py" +search = '__version__ = "{current_version}"' +replace = '__version__ = "{new_version}"' + +[tool.flake8] +exclude = [ + "docs", +] +max-line-length = 88 + +[tool.setuptools_scm] + +[project.urls] +Homepage = "https://github.com/opengeos/leafmap" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 036a9d3297..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,20 +0,0 @@ -[bumpversion] -current_version = 0.37.3 -commit = True -tag = True - -[bumpversion:file:setup.py] -search = version="{current_version}" -replace = version="{new_version}" - -[bumpversion:file:leafmap/__init__.py] -search = __version__ = "{current_version}" -replace = __version__ = "{new_version}" - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = docs - -[aliases] diff --git a/setup.py b/setup.py deleted file mode 100644 index ef5a085e3d..0000000000 --- a/setup.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python - -"""The setup script.""" - -import io -from os import path as op -from setuptools import setup, find_packages - -with open("README.md") as readme_file: - readme = readme_file.read() - -here = op.abspath(op.dirname(__file__)) - -# get the dependencies and installs - - -with io.open(op.join(here, "requirements.txt"), encoding="utf-8") as f: - all_reqs = f.read().split("\n") - -with io.open(op.join(here, "requirements_dev.txt"), encoding="utf-8") as f: - dev_reqs = [x.strip() for x in f.read().split("\n")] - -install_requires = [x.strip() for x in all_reqs if "git+" not in x] -dependency_links = [x.strip().replace("git+", "") for x in all_reqs if "git+" not in x] - -extras_requires = { - "all": dev_reqs, - "backends": [ - "bokeh", - "keplergl", - "maplibre", - "pydeck", - "plotly", - ], - "lidar": ["ipygany", "ipyvtklink", "laspy", "panel", "pyntcloud[LAS]", "pyvista"], - "raster": [ - "localtileserver>=0.10.0", - "jupyter-server-proxy", - "rio-cogeo", - "rioxarray", - "netcdf4", - "pynhd", - "py3dep", - ], - "sql": ["psycopg2", "sqlalchemy"], - "apps": ["streamlit-folium", "voila", "solara"], - "vector": [ - "geopandas", - "osmnx", - "pmtiles", - "flask", - "flask-cors", - "lonboard", - "mapclassify", - ], - "pmtiles": ["pmtiles", "flask", "flask-cors"], - "ai": [ - "geopandas", - "osmnx", - "localtileserver>=0.10.0", - "rastervision", - "pytorch-lightning", - ], - "maplibre": [ - "geopandas", - "h3", - "ipyvuetify", - "localtileserver", - "mapclassify", - "maplibre", - "pmtiles", - "rioxarray", - "xarray", - ], -} - -requirements = [] - -setup_requirements = [] - -test_requirements = [] - -setup( - author="Qiusheng Wu", - author_email="giswqs@gmail.com", - python_requires=">=3.8", - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - description="A Python package for geospatial analysis and interactive mapping in a Jupyter environment.", - install_requires=install_requires, - extras_require=extras_requires, - dependency_links=dependency_links, - license="MIT license", - long_description=readme, - long_description_content_type="text/markdown", - include_package_data=True, - keywords="leafmap", - name="leafmap", - packages=find_packages(include=["leafmap", "leafmap.*"]), - setup_requires=setup_requirements, - test_suite="tests", - tests_require=test_requirements, - url="https://github.com/opengeos/leafmap", - version="0.37.3", - zip_safe=False, -)