From d9f9a9b023a1361dbfa3f5ef01ffa392e0dcf028 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 26 Mar 2024 09:01:01 +0800 Subject: [PATCH] Migrate from setup.py/setup.cfg to pyproject.toml --- pyproject.toml | 48 +++++++++++++++++++++++++++++++++++++++ setup.cfg | 2 -- setup.py | 61 -------------------------------------------------- 3 files changed, 48 insertions(+), 63 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 18efb6c7..b256f99b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,51 @@ +[build-system] +requires = ["setuptools>=64", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "HinetPy" +description = "A Python package to request and process seismic waveform data from NIED Hi-neta" +readme = "README.rst" +requires-python = ">=3.7" +authors = [{name = "Dongdong Tian", email = "seisman.info@gmail.com"}] +keywords = ["seismology", "NIED", "Hi-net", "waveform"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "Intended Audience :: Education", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python", + "Programming Language :: Python :: 3.7", + "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", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Utilities", +] +dependencies = ["requests"] +dynamic = ["version"] + +[project.urls] +homepage = "https://seisman.github.io/HinetPy/" +documentation = "https://seisman.github.io/HinetPy/" +repository = "https://github.com/seisman/HinetPy" + +[tool.setuptools] +license-files = ["LICENSE.txt"] + +[tool.setuptools.packages.find] +include = ["HinetPy*"] +exclude = ["docs", "tests"] + +[tool.setuptools_scm] +local_scheme = "node-and-date" +fallback_version = "999.999.999+unknown" + [tool.black] line-length = 88 exclude = ''' diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2bcd70e3..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length = 88 diff --git a/setup.py b/setup.py deleted file mode 100644 index 43e066e6..00000000 --- a/setup.py +++ /dev/null @@ -1,61 +0,0 @@ -""" -Build and install the project. -""" - -from setuptools import find_packages, setup - -NAME = "HinetPy" -AUTHOR = "Dongdong Tian" -AUTHOR_EMAIL = "seisman.info@gmail.com" -LICENSE = "MIT License" -URL = "https://github.com/seisman/HinetPy" -DESCRIPTION = ( - "A Python package to request and process seismic waveform data from NIED Hi-net" -) -KEYWORDS = "Seismology, NIED, Hi-net, Waveform" -with open("README.rst", "r", encoding="utf8") as f: - LONG_DESCRIPTION = "".join(f.readlines()) - -PACKAGES = find_packages(exclude=["docs", "tests"]) -SCRIPTS = [] - -CLASSIFIERS = [ - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "Intended Audience :: Education", - f"License :: OSI Approved :: {LICENSE}", - "Operating System :: POSIX :: Linux", - "Programming Language :: Python", - "Programming Language :: Python :: 3.7", - "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", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Utilities", -] -INSTALL_REQUIRES = ["requests"] -# Configuration for setuptools-scm -SETUP_REQUIRES = ["setuptools_scm"] -USE_SCM_VERSION = {"local_scheme": "node-and-date", "fallback_version": "unknown"} - -if __name__ == "__main__": - setup( - name=NAME, - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - use_scm_version=USE_SCM_VERSION, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - license=LICENSE, - url=URL, - scripts=SCRIPTS, - packages=PACKAGES, - classifiers=CLASSIFIERS, - keywords=KEYWORDS, - install_requires=INSTALL_REQUIRES, - setup_requires=SETUP_REQUIRES, - )