diff --git a/eomaps/__init__.py b/eomaps/__init__.py index 959c260aa..bc2a416c9 100644 --- a/eomaps/__init__.py +++ b/eomaps/__init__.py @@ -1,3 +1,4 @@ +import importlib.metadata from .helpers import register_modules as _register_modules # address numpy runtime warning concerning binary incompatibility when @@ -6,8 +7,8 @@ from .eomaps import Maps from .mapsgrid import MapsGrid -from ._version import __version__ +__version__ = importlib.metadata.version("eomaps") __author__ = "Raphael Quast" # Follow conventions used by cartopy to setup cache directory diff --git a/eomaps/_version.py b/eomaps/_version.py deleted file mode 100644 index 40d114c5b..000000000 --- a/eomaps/_version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "7.3.3" diff --git a/eomaps/eomaps.py b/eomaps/eomaps.py index d9b3cbedd..98ca1b986 100644 --- a/eomaps/eomaps.py +++ b/eomaps/eomaps.py @@ -13,6 +13,7 @@ import gc from textwrap import fill from contextlib import contextmanager, ExitStack +import importlib.metadata import numpy as np @@ -71,7 +72,7 @@ from ._data_manager import DataManager -from ._version import __version__ +__version__ = importlib.metadata.version("eomaps") def _handle_backends(): diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..3489937aa --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,69 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +include = ["eomaps"] + +[project] +name = "eomaps" +version = "7.4" +description = "A library to create interactive maps of geographical datasets." +requires-python = ">=3.8" + +authors = [ + { name="Raphael Quast", email="raphael.quast@geo.tuwien.ac.at" }, +] + +keywords = ["Visualization", "Plotting", "Maps", "Geographical Data"] + +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Operating System :: OS Independent", +] + +dependencies = [ + "numpy", + "scipy", + "matplotlib>=3.4", + "cartopy>=0.20.0", + "descartes", + "pyproj", + "packaging", + "click" +] + +[project.optional-dependencies] + +all = ["eomaps[io, classify, wms, shade, gui]"] + +all_nogui = ["eomaps[io, classify, wms, shade]"] + +io = [ + "pandas", + "geopandas", + "xarray", + "netcdf4", + "rioxarray" +] + +classify = ["mapclassify"] + +wms = [ + "owslib", + "requests", + "cairosvg", +] + +shade = ["datashader"] + +gui = [ + "PyQt5", + "qtpy" + ] + + +[project.urls] +Documentation = "https://eomaps.readthedocs.io/" +Repository = "https://github.com/raphaelquast/eomaps" diff --git a/setup.py b/setup.py deleted file mode 100644 index a1cbf5775..000000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: UTF-8 -*- - -""" -This file is part of EOmaps. -For COPYING and LICENSE details, please refer to the LICENSE file -""" -from setuptools import setup, find_packages -from pathlib import Path -import re - -# add the README as long-description -this_directory = Path(__file__).parent -try: - long_description = (this_directory / "README.md").read_text() -except Exception: - long_description = "A library to create interactive maps of geographical datasets." - -# get version-number from _version.py -try: - with open(this_directory / "eomaps" / "_version.py") as file: - (version,) = re.findall('__version__ = "(.*)"', file.read()) -except Exception: - version = "undefined" - -setup( - name="EOmaps", - version=version, - description="A library to create interactive maps of geographical datasets.", - packages=find_packages(), - package_dir={"eomaps": "eomaps"}, - package_data={"eomaps": ["logo.png", "NE_features.json", "qtcompanion/icons/*"]}, - # include_package_data=True, - author="Raphael Quast", - author_email="raphael.quast@geo.tuwien.ac.at", - maintainer="Raphael Quast", - maintainer_email="raphael.quast@geo.tuwien.ac.at", - license="GNU General Public License v3 or later (GPLv3+)", - url="https://github.com/raphaelquast/maps", - long_description=long_description, - long_description_content_type="text/markdown", - install_requires=[ - "numpy", - "scipy", - "pandas", - "matplotlib>=3.4", - "cartopy>=0.20.0", - "descartes", - "mapclassify", - "pyproj", - "pyepsg", - "geopandas", - "owslib", - "requests", - "xmltodict", - "cairosvg", - "packaging", - "click", - "qtpy", - ], - entry_points={"console_scripts": ["eomaps = eomaps.scripts.open:cli"]}, - keywords=["visualization", "plotting", "maps", "geographical data"], - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Visualization", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - # Pick your license as you wish (should match "license" above) - # ~ 'License :: OSI Approved :: MIT License', - "Programming Language :: Python :: 3.7", - ], - license_files=("LICENSE",), -)