From ce07400daae4c8886724de8dc321fd4dc5a5d16b Mon Sep 17 00:00:00 2001 From: Felddy Date: Wed, 4 Dec 2024 13:42:01 -0500 Subject: [PATCH] Migrate setup.py to pyproject.toml --- pyproject.toml | 43 ++++++++++++++++++++++++++ setup.py | 84 -------------------------------------------------- 2 files changed, 43 insertions(+), 84 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..afec12b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools", "wheel"] + +[project] +authors = [{ name = "Mark Feldhousen", email = "markf@geekpad.com" }] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "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.13", + "Topic :: Scientific/Engineering :: Atmospheric Science", +] +dependencies = ["semver", "setuptools"] +description = "Containerized WeeWX" +dynamic = ["version"] +keywords = ["container", "docker", "weewx"] +license = { file = "LICENSE" } +name = "weewx-docker" +readme = "README.md" +requires-python = ">=3.6" + +[project.urls] +homepage = "https://github.com/felddy" +issues = "https://github.com/felddy/weewx-docker/issues" +source = "https://github.com/felddy/weewx-docker" + +[project.optional-dependencies] +test = ["coverage", "coveralls", "docker", "pre-commit", "pytest", "pytest-cov"] + +[tool.setuptools.dynamic] +version = { attr = "_version.__version__" } diff --git a/setup.py b/setup.py deleted file mode 100644 index b451085..0000000 --- a/setup.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -This is the setup module for the weewx docker project. - -Based on: - -- https://packaging.python.org/distributing/ -- https://github.com/pypa/sampleproject/blob/master/setup.py -- https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure -""" - -# Standard Python Libraries -from glob import glob -from os.path import basename, splitext - -# Third-Party Libraries -from setuptools import find_packages, setup - - -def readme(): - """Read in and return the contents of the project's README.md file.""" - with open("README.md", encoding="utf-8") as f: - return f.read() - - -def package_vars(version_file): - """Read in and return the variables defined by the version_file.""" - pkg_vars = {} - with open(version_file) as f: - exec(f.read(), pkg_vars) # nosec - return pkg_vars - - -setup( - name="weewx_docker", - # Versions should comply with PEP440 - version=package_vars("src/_version.py")["__version__"], - description="weewx_docker python library", - long_description=readme(), - long_description_content_type="text/markdown", - url="https://github.com/felddy", - # The project's main homepage - download_url="https://github.com/felddy/weewx-docker", - # Author details - author="Mark Feldhousen", - author_email="markf@geekpad.com", - license="License :: OSI Approved :: MIT License", - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Web Environment", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.13", - "Topic :: Scientific/Engineering :: Atmospheric Science", - ], - python_requires=">=3.6", - # What does your project relate to? - keywords="weewx", - packages=find_packages(where="src"), - package_dir={"": "src"}, - py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")], - install_requires=[ - "configobj == 5.0.9", - "pyserial == 3.5", - "pyusb == 1.2.1", - "semver == 3.0.2", - "setuptools == 75.6.0", - "weewx == 5.1.0", - "wheel == 0.45.1", - ], - extras_require={ - "test": [ - "coverage", - "coveralls", - "docker", - "pre-commit", - "pytest", - "pytest-cov", - ] - }, -)