From a889680b3b6a9af1cf64d6d01c5e0541b4150d54 Mon Sep 17 00:00:00 2001 From: Mathias Hauser Date: Thu, 29 Jul 2021 09:59:34 +0200 Subject: [PATCH] setup options to setup.cfg (#240) * setup options to setup.cfg * whats new --- docs/whats_new.rst | 3 +++ requirements.txt | 4 ++++ setup.cfg | 37 +++++++++++++++++++++++++++++++++++++ setup.py | 34 +++------------------------------- 4 files changed, 47 insertions(+), 31 deletions(-) diff --git a/docs/whats_new.rst b/docs/whats_new.rst index ab6e196a..0b5517aa 100644 --- a/docs/whats_new.rst +++ b/docs/whats_new.rst @@ -34,6 +34,8 @@ Docs Internal Changes ~~~~~~~~~~~~~~~~ +- Moved contents of setup.py to setup.cfg. + v0.7.0 (28.07.2021) ------------------- @@ -45,6 +47,7 @@ finalizes a number of deprecations, and restores compatibility with xarray 0.19. Breaking Changes ~~~~~~~~~~~~~~~~ + - Removed support for Python 2. This is the first version of regionmask that is Python 3 only! - The minimum versions of some dependencies were changed (:pull:`220`): diff --git a/requirements.txt b/requirements.txt index 72f402d2..6ab1bc18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,7 @@ +# This file is redundant with setup.cfg; +# it exists to let GitHub build the repository dependency graph +# https://help.github.com/en/github/visualizing-repository-data-with-graphs/listing-the-packages-that-a-repository-depends-on + geopandas >= 0.6 numpy >= 1.17 pooch >= 1.0 diff --git a/setup.cfg b/setup.cfg index d31f68ce..f370c570 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,40 @@ +[metadata] +name = regionmask +author = regionmask Developers +author_email = mathias.hauser@env.ethz.com +license = MIT +description = plotting and creation of masks for spatial regions +long_description_content_type=text/x-rst +long_description = See https://regionmask.readthedocs.io +url = https://github.com/regionmask/regionmask +classifiers = + Development Status :: 5 - Production/Stable + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Intended Audience :: Science/Research + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Topic :: Scientific/Engineering + Topic :: Scientific/Engineering :: Atmospheric Science + Topic :: Scientific/Engineering :: GIS + +[options] +packages = find: +zip_safe = False # https://mypy.readthedocs.io/en/latest/installed_packages.html +include_package_data = True +python_requires = >=3.6 +install_requires = + geopandas >= 0.6 + numpy >= 1.17 + pooch >= 1.0 + rasterio >= 1.0 + shapely >= 1.6 + xarray >= 0.15 + [tool:pytest] python_files = test_*.py testpaths = regionmask/tests diff --git a/setup.py b/setup.py index 903ed327..d84fbdd7 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ -from setuptools import find_packages, setup +#!/usr/bin/env python +from setuptools import setup # get version with open("regionmask/version.py") as f: @@ -6,33 +7,4 @@ version = line.split("=")[1] __version__ = version - -setup( - name="regionmask", - version=__version__, - description="plotting and creation of masks for spatial regions", - author="mathause", - author_email="mathias.hauser@env.ethz.com", - packages=find_packages(), - url="https://github.com/regionmask/regionmask", - install_requires=open("requirements.txt").read().strip().split("\n"), - extras_require={"docs": ["numpydoc", "jupyter", "nbconvert"]}, - long_description_content_type="text/x-rst", - long_description="See https://regionmask.readthedocs.io", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Intended Audience :: Science/Research", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Atmospheric Science", - "Topic :: Scientific/Engineering :: GIS", - ], - python_requires=">=3.6", -) +setup(version=__version__)