From f41fbbb504ff75792a35bf16d5f2872c80c19269 Mon Sep 17 00:00:00 2001 From: Malte Franken Date: Fri, 11 Oct 2024 23:12:32 +1100 Subject: [PATCH] migrate to pyproject.toml --- .github/workflows/ci.yaml | 6 ++-- MANIFEST.in | 1 + aio_georss_client/__version__.py | 3 -- codecov.yml | 2 -- pyproject.toml | 53 ++++++++++++++++++++++++++++++++ requirements-test.txt | 6 ---- requirements.txt | 4 --- setup.py | 44 -------------------------- tests/test_init.py | 8 ----- 9 files changed, 56 insertions(+), 71 deletions(-) create mode 100644 MANIFEST.in delete mode 100644 aio_georss_client/__version__.py delete mode 100644 requirements-test.txt delete mode 100644 requirements.txt delete mode 100644 setup.py delete mode 100644 tests/test_init.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed111c8..983abb7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,12 +28,10 @@ jobs: python -VV python -m site python -m pip install --upgrade pip setuptools wheel - python -m pip install -r requirements.txt - python -m pip install -r requirements-test.txt + python -m pip install -e . + python -m pip install -e .[tests] - name: "Run tests for ${{ matrix.python-version }}" run: | - pip install pytest-cov - pip install coverage pytest \ -qq \ --timeout=9 \ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..1eeef06 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +prune tests diff --git a/aio_georss_client/__version__.py b/aio_georss_client/__version__.py deleted file mode 100644 index 8641576..0000000 --- a/aio_georss_client/__version__.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Define a version constant.""" - -__version__ = "0.13" diff --git a/codecov.yml b/codecov.yml index 63346c6..69cb760 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1 @@ comment: false -ignore: - - "**/__version__.py" diff --git a/pyproject.toml b/pyproject.toml index 1dff7e3..fe504c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,56 @@ +[build-system] +requires = [ + "setuptools", + "wheel" +] +build-backend = "setuptools.build_meta" + +[project] +name = "aio_georss_client" +version = "0.13" +requires-python = ">= 3.9" +authors = [ + {name = "Malte Franken", email = "coding@subspace.de"}, +] +description = "An async GeoRSS client library." +readme = "README.md" +license = {file = "LICENSE"} +keywords = ["homeassistant", "georss"] +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Development Status :: 5 - Production/Stable", +] +dependencies = [ + "aiohttp>=3.7.4,<4", + "haversine>=2.8.1", + "xmltodict>=0.13.0", + "python-dateutil>=2.9.0", +] + +[project.optional-dependencies] +tests = [ + "pytest-asyncio", + "pytest-timeout", + "pytest-xdist", + "pytest-cov", + "coverage", + "mock", + "aioresponses", +] + +[project.urls] +Repository = "https://github.com/exxamalte/python-aio-georss-client" +Issues = "https://github.com/exxamalte/python-aio-georss-client/issues" +Changelog = "https://github.com/exxamalte/python-aio-georss-client/blob/main/CHANGELOG.md" + +[tool.setuptools.packages.find] +include = ["aio_georss_client*"] + [tool.ruff.lint] select = [ "A001", # Variable {name} is shadowing a Python builtin diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index 925d447..0000000 --- a/requirements-test.txt +++ /dev/null @@ -1,6 +0,0 @@ -pytest-asyncio -pytest-timeout -pytest-xdist -pytest-cov -mock -aioresponses diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 5fa4da4..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -aiohttp>=3.7.4,<4 -haversine>=2.8.1 -xmltodict>=0.13.0 -python-dateutil>=2.9.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 6134544..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Setup of aio_georss_client library.""" - -from setuptools import find_packages, setup - -from aio_georss_client.__version__ import __version__ - -NAME = "aio_georss_client" -AUTHOR = "Malte Franken" -AUTHOR_EMAIL = "coding@subspace.de" -DESCRIPTION = "An async GeoRSS client library." -URL = "https://github.com/exxamalte/python-aio-georss-client" - -REQUIRES = [ - "aiohttp>=3.7.4,<4", - "haversine>=2.8.1", - "xmltodict>=0.13.0", - "python-dateutil>=2.9.0", -] - - -with open("README.md") as fh: - long_description = fh.read() - -setup( - name=NAME, - version=__version__, - author=AUTHOR, - author_email=AUTHOR_EMAIL, - description=DESCRIPTION, - license="Apache-2.0", - long_description=long_description, - long_description_content_type="text/markdown", - url=URL, - packages=find_packages(exclude=("tests",)), - classifiers=[ - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], - install_requires=REQUIRES, -) diff --git a/tests/test_init.py b/tests/test_init.py deleted file mode 100644 index a9d951f..0000000 --- a/tests/test_init.py +++ /dev/null @@ -1,8 +0,0 @@ -"""Tests for general setup.""" - -from aio_georss_client import __version__ - - -def test_version(): - """Test for version tag.""" - assert __version__ is not None