From 9c0eb9a70e872fda41dc0ca59db7d8f22c441e9c Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Mon, 31 Oct 2022 23:49:30 +1300 Subject: [PATCH] MAINT: move static metadata to pyproject.toml --- pyproject.toml | 66 ++++++++++++++++++++++++++++++++++++++++++++++++- setup.py | 67 +++----------------------------------------------- 2 files changed, 68 insertions(+), 65 deletions(-) mode change 100644 => 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml index 9787c3bdf0..be122a7d07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,67 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = [ + "setuptools>=61.0.0", +] build-backend = "setuptools.build_meta" + +[project] +name = "geopandas" +dynamic = ["version"] +authors = [ + {name = "Kelsey Jordahl", email = "kjordahl@alum.mit.edu"}, +] +maintainers = [ + {name = "GeoPandas contributors"}, +] +license = {text = "BSD 3-Clause"} +description = "Geographic pandas extensions" +keywords = ["GIS", "cartography", "pandas", "shapely"] +readme = {text = """\ +GeoPandas is a project to add support for geographic data to +`pandas`_ objects. + +The goal of GeoPandas is to make working with geospatial data in +python easier. It combines the capabilities of `pandas`_ and `shapely`_, +providing geospatial operations in pandas and a high-level interface +to multiple geometries to shapely. GeoPandas enables you to easily do +operations in python that would otherwise require a spatial database +such as PostGIS. + +.. _pandas: https://pandas.pydata.org +.. _shapely: https://shapely.readthedocs.io/en/latest/ +""", content-type = "text/x-rst"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering :: GIS", +] +requires-python = ">=3.8" +dependencies = [ + "fiona >= 1.8", + "packaging", + "pandas >= 1.0.0", + "pyproj >= 2.6.1.post1", + "shapely >= 1.7", +] + +[project.urls] +Home = "https://geopandas.org" +Repository = "https://github.com/geopandas/geopandas" + +[tool.setuptools.packages.find] +include = [ + "geopandas", + "geopandas.*", +] + +[tool.setuptools.package-data] +geopandas = [ + "datasets/nybb_16a.zip", + "datasets/naturalearth_cities/*", + "datasets/naturalearth_lowres/*", + "tests/data/*", +] diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index d12ea2f623..6f675bc925 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ -#!/usr/bin/env/python -"""Installation script - -""" +#!/usr/bin/env python3 +"""Installation script.""" import os import sys @@ -15,67 +13,8 @@ import versioneer # noqa: E402 -LONG_DESCRIPTION = """GeoPandas is a project to add support for geographic data to -`pandas`_ objects. - -The goal of GeoPandas is to make working with geospatial data in -python easier. It combines the capabilities of `pandas`_ and `shapely`_, -providing geospatial operations in pandas and a high-level interface -to multiple geometries to shapely. GeoPandas enables you to easily do -operations in python that would otherwise require a spatial database -such as PostGIS. - -.. _pandas: http://pandas.pydata.org -.. _shapely: http://shapely.readthedocs.io/en/latest/ -""" - -if os.environ.get("READTHEDOCS", False) == "True": - INSTALL_REQUIRES = [] -else: - INSTALL_REQUIRES = [ - "pandas >= 1.0.0", - "shapely >= 1.7", - "fiona >= 1.8", - "pyproj >= 2.6.1.post1", - "packaging", - ] - -# get all data dirs in the datasets module -data_files = [] - -for item in os.listdir("geopandas/datasets"): - if not item.startswith("__"): - if os.path.isdir(os.path.join("geopandas/datasets/", item)): - data_files.append(os.path.join("datasets", item, "*")) - elif item.endswith(".zip"): - data_files.append(os.path.join("datasets", item)) - -data_files.append("tests/data/*") - - +# see pyproject.toml for static project metadata setup( - name="geopandas", version=versioneer.get_version(), - description="Geographic pandas extensions", - license="BSD", - author="GeoPandas contributors", - author_email="kjordahl@alum.mit.edu", - url="http://geopandas.org", - project_urls={ - "Source": "https://github.com/geopandas/geopandas", - }, - long_description=LONG_DESCRIPTION, - long_description_content_type="text/x-rst", - packages=[ - "geopandas", - "geopandas.io", - "geopandas.tools", - "geopandas.datasets", - "geopandas.tests", - "geopandas.tools.tests", - ], - package_data={"geopandas": data_files}, - python_requires=">=3.8", - install_requires=INSTALL_REQUIRES, cmdclass=versioneer.get_cmdclass(), )