From 91c88a8555562ceb4f4c5c7f91b8e6b0092ad137 Mon Sep 17 00:00:00 2001 From: Mike Taves Date: Mon, 7 Feb 2022 12:03:34 +1300 Subject: [PATCH] Convert setup.py to declarative configuration setup.cfg file --- .github/workflows/deploy.yml | 2 +- pyproject.toml | 3 +++ setup.cfg | 30 ++++++++++++++++++++++++++++++ setup.py | 31 +------------------------------ 4 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0e24e43..9299c68 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: python -m pip install --upgrade pip pip install build - name: Build package - run: python -m build --sdist --wheel --outdir dist/ + run: python -m build - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fed528d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..906abd3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +name = pyshp +version = attr: shapefile.__version__ +description = Pure Python read/write support for ESRI Shapefile format +long_description = file: README.md +long_description_content_type = text/markdown +author = Joel Lawhead +author_email = jlawhead@geospatialpython.com +maintainer = Karim Bahgat +maintainer_email = karim.bahgat.norway@gmail.com +url = https://github.com/GeospatialPython/pyshp +download_url = https://pypi.org/project/pyshp/ +license = MIT +license_files = LICENSE.TXT +keywords = gis, geospatial, geographic, shapefile, shapefiles +classifiers = + Development Status :: 5 - Production/Stable + Programming Language :: Python + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Topic :: Scientific/Engineering :: GIS + Topic :: Software Development :: Libraries + Topic :: Software Development :: Libraries :: Python Modules + +[options] +py_modules = shapefile +python_requires = >=2.7 + +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py index 1b635b4..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,32 +1,3 @@ from setuptools import setup - -def read_file(file): - with open(file, 'rb') as fh: - data = fh.read() - return data.decode('utf-8') - -setup(name='pyshp', - version='2.2.0', - description='Pure Python read/write support for ESRI Shapefile format', - long_description=read_file('README.md'), - long_description_content_type='text/markdown', - author='Joel Lawhead, Karim Bahgat', - author_email='jlawhead@geospatialpython.com', - url='https://github.com/GeospatialPython/pyshp', - py_modules=['shapefile'], - license='MIT', - zip_safe=False, - keywords='gis geospatial geographic shapefile shapefiles', - python_requires='>= 2.7', - classifiers=['Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Scientific/Engineering :: GIS', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules']) +setup()