diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 405a72f9e0..2078ffe278 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -25,8 +25,8 @@ jobs: run: | python -m pip install --upgrade pip pip install --user --no-cache-dir Cython - pip install codespell -r requirements.txt -r requirements_extra.txt -r requirements_all.txt - pip install . + pip install codespell + pip install .[all] - name: Discover typos with codespell run: codespell --skip="*.csv,*.geojson,*.json,*.yml*.js,*.html,*cff,*.pdf" --ignore-words-list="aci,acount,acounts,fallow,ges,hart,hist,nd,ned,ois,wqs,watermask" - name: LOAD EE CREDENTIALS diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e38046181f..b744271ed4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -27,8 +27,8 @@ jobs: run: | python -m pip install --upgrade pip pip install --user --no-cache-dir Cython - pip install codespell -r requirements.txt -r requirements_extra.txt -r requirements_all.txt - pip install . + pip install codespell + pip install .[all] - name: Discover typos with codespell run: codespell --skip="*.csv,*.geojson,*.json,*.yml*.js,*.html,*cff,*.pdf" --ignore-words-list="aci,acount,acounts,fallow,ges,hart,hist,nd,ned,ois,wqs,watermask" - name: LOAD EE CREDENTIALS diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2613503cb6..d633ade7a0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -31,8 +31,8 @@ jobs: gdalinfo --version - name: Install dependencies run: | - pip install -r requirements.txt -r requirements_extra.txt -r requirements_all.txt - pip install . + pip install codespell + pip install .[all] - name: Discover typos with codespell run: | pip install codespell diff --git a/MANIFEST.in b/MANIFEST.in index cfaea44434..8a49264c55 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,6 @@ include LICENSE include README.rst include requirements.txt -include requirements_extra.txt -include requirements_all.txt include requirements_docs.txt recursive-include geemap/data * diff --git a/docs/contributing.md b/docs/contributing.md index 1cb256bfb5..d23fe09fec 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -78,14 +78,14 @@ Ready to contribute? Here's how to set up _geemap_ for local development. 5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox: ``` - flake8 geemap tests + pflake8 geemap tests ``` ``` python setup.py test or pytest ``` - To get flake8 and tox, just pip install them into your conda env. + To get pflake8 and tox, just pip install them into your conda env (`pip install pyproject-flake8` and `pip install tox`). 6. Commit your changes and push your branch to GitHub: diff --git a/docs/installation.md b/docs/installation.md index dbe07e8c72..d456e05359 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -35,9 +35,9 @@ mamba install geemap -c conda-forge mamba install geopandas localtileserver -c conda-forge ``` -All the optional dependencies are listed in [requirements_all.txt](https://github.com/gee-community/geemap/blob/master/requirements_all.txt), which can be installed using one of the following: +The optional dependencies can be installed using one of the following: -- `pip install geemap[all]`: installing all optional dependencies listed in [requirements_all.txt](https://github.com/gee-community/geemap/blob/master/requirements_all.txt). +- `pip install geemap[all]`: installing all optional dependencies. - `pip install geemap[backends]`: installing keplergl, pydeck. - `pip install geemap[lidar]`: installing ipygany, ipyvtklink, laspy, panel, pyntcloud[LAS], pyvista. - `pip install geemap[raster]`: installing localtileserver, rio-cogeo, rioxarray, netcdf4, xarray_leaflet. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..b7970e82a8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,137 @@ +[project] +name = "geemap" +version = "0.30.0" +dynamic = [ + "dependencies", +] +description = "A Python package for interactive mapping using Google Earth Engine and ipyleaflet" +readme = "README.rst" +requires-python = ">=3.8" +keywords = [ + "geemap", +] +license = {text = "MIT"} +authors = [ + {name = "Qiusheng Wu", email = "giswqs@gmail.com"}, +] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "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", +] + +[project.entry-points."console_scripts"] +geemap = "geemap.cli:main" + +[project.optional-dependencies] +all = [ + "geemap[backends,extra,lidar,raster,sql,apps,vector,workshop]", +] +backends = [ + "keplergl", + "pydeck", + "plotly", +] +extra = [ + "datapane", + "ee_extra>=0.0.15", + "ffmpeg-python", + "gdown", + "geeadd>=0.5.1", + "geojson", + "geopandas", + "ipynb-py-convert", + "jupyterlab>=3", + "mapclassify>=2.4.0", + "mss", + "oeel", + "owslib", + "palettable", + "pycrs", + "sankee>=0.1.0", + "whiteboxgui>=0.6.0", + "xee", +] +lidar = [ + "ipygany", + "ipyvtklink", + "laspy[lazrs]", + "panel", + "pyntcloud[LAS]", + "pyvista", + "pyvista-xarray", + "rioxarray", +] +raster = [ + "geedim", + "localtileserver", + "rio-cogeo", + "rioxarray", + "netcdf4", + "pyvista-xarray", +] +sql = [ + "psycopg2", + "sqlalchemy", +] +apps = [ + "gradio", + "streamlit-folium", + "voila", + "solara", +] +vector = [ + "geopandas", + "osmnx", +] +workshop = [ + "geopandas", + "geedim", + "ffmpeg-python", + "gdown", +] + +[tool.setuptools.packages.find] +where = ["geemap"] +namespaces = false + +[project.urls] +Homepage = "https://github.com/gee-community/geemap" + +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.distutils.bdist_wheel] +universal = true + +[tool.bumpversion] +current_version = "0.30.0" +commit = true +tag = true + +[[tool.bumpversion.files]] +filename = "pyproject.toml" +search = 'version = "{current_version}"' +replace = 'version = "{new_version}"' + +[[tool.bumpversion.files]] +filename = "geemap/__init__.py" +search = '__version__ = "{current_version}"' +replace = '__version__ = "{new_version}"' + +[tool.flake8] +exclude = [ + "docs", +] +max-line-length = 88 + +[tool.setuptools_scm] diff --git a/requirements_all.txt b/requirements_all.txt deleted file mode 100644 index 8cb56449cb..0000000000 --- a/requirements_all.txt +++ /dev/null @@ -1,28 +0,0 @@ -datapane -geedim>=1.3.2 -gradio -keplergl -ipygany -ipynb-py-convert -ipyvtklink -jupyterlab>=3 -laspy -localtileserver -mapclassify>=2.4.0 -mss -netcdf4 -oeel -palettable -osmnx -owslib -panel -psycopg2 -pydeck -pyntcloud[LAS] -pyvista-xarray -rio-cogeo -rioxarray -sqlalchemy -streamlit-folium -voila -xee \ No newline at end of file diff --git a/requirements_docs.txt b/requirements_docs.txt index 1cca6f0eb6..f8c62c2d09 100644 --- a/requirements_docs.txt +++ b/requirements_docs.txt @@ -1,14 +1,14 @@ black black[jupyter] +bump-my-version codespell deadlink -bump2version coverage -flake8 ipykernel livereload nbconvert nbformat +pyproject-flake8 pip sphinx tox diff --git a/requirements_extra.txt b/requirements_extra.txt deleted file mode 100644 index d8a9b61842..0000000000 --- a/requirements_extra.txt +++ /dev/null @@ -1,9 +0,0 @@ -ee_extra>=0.0.15 -ffmpeg-python -gdown -geeadd>=0.5.1 -geojson -geopandas -pycrs -sankee>=0.1.0 -whiteboxgui>=0.6.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c8e1dad37c..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,21 +0,0 @@ -[bumpversion] -current_version = 0.30.0 -commit = True -tag = True - -[bumpversion:file:setup.py] -search = version="{current_version}" -replace = version="{new_version}" - -[bumpversion:file:geemap/__init__.py] -search = __version__ = "{current_version}" -replace = __version__ = "{new_version}" - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = docs -max-line-length = 88 - -[aliases] diff --git a/setup.py b/setup.py deleted file mode 100644 index 2b009d09e8..0000000000 --- a/setup.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python - -"""The setup script.""" -import platform -from os import path as op -import io -from setuptools import setup, find_packages - -with open("README.rst") 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: - core_reqs = f.read().split("\n") - if platform.system() == "Windows": - core_reqs.append("pywin32") - -with io.open(op.join(here, "requirements_extra.txt"), encoding="utf-8") as f: - extra_reqs = [x.strip() for x in f.read().split("\n")] - -with io.open(op.join(here, "requirements_all.txt"), encoding="utf-8") as f: - all_reqs = [x.strip() for x in f.read().split("\n")] - -install_requires = [x.strip() for x in core_reqs if "git+" not in x] -dependency_links = [x.strip().replace("git+", "") for x in core_reqs if "git+" not in x] - -extras_requires = { - "extra": extra_reqs, - "all": all_reqs, - "backends": ["keplergl", "pydeck", "plotly"], - "lidar": [ - "ipygany", - "ipyvtklink", - "laspy[lazrs]", - "panel", - "pyntcloud[LAS]", - "pyvista", - "pyvista-xarray", - "rioxarray", - ], - "raster": [ - "geedim", - "localtileserver", - "rio-cogeo", - "rioxarray", - "netcdf4", - "pyvista-xarray", - ], - "sql": ["psycopg2", "sqlalchemy"], - "apps": ["gradio", "streamlit-folium", "voila", "solara"], - "vector": ["geopandas", "osmnx"], - "workshop": ["geopandas", "geedim", "ffmpeg-python", "gdown"], -} - -setup_requirements = [] - -test_requirements = [] - -setup( - author="Qiusheng Wu", - author_email="giswqs@gmail.com", - python_requires=">=3.8", - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "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 interactive mapping using Google Earth Engine and ipyleaflet", - entry_points={ - "console_scripts": [ - "geemap=geemap.cli:main", - ], - }, - install_requires=install_requires, - extras_require=extras_requires, - dependency_links=dependency_links, - license="MIT license", - long_description=readme, - include_package_data=True, - keywords="geemap", - name="geemap", - packages=find_packages(include=["geemap", "geemap.*"]), - setup_requires=setup_requirements, - test_suite="tests", - tests_require=test_requirements, - url="https://github.com/gee-community/geemap", - version="0.30.0", - zip_safe=False, -)