From def7e23b84c070b0dcd6fd01f0a9385a391b8746 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Thu, 16 Jan 2025 15:57:40 -0600 Subject: [PATCH] Migrate to pyproject.toml --- CHANGELOG.md | 4 ++++ pyproject.toml | 39 +++++++++++++++++++++++++++++++++++++++ requirements_dev.txt | 1 + script/package | 2 +- setup.py | 40 ---------------------------------------- tox.ini | 13 +++++++++++++ 6 files changed, 58 insertions(+), 41 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py create mode 100644 tox.ini diff --git a/CHANGELOG.md b/CHANGELOG.md index dd213b1..454b745 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.0.1 + +- Migrate to pyproject.toml + ## 1.0.0 - Initial version diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..471a346 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["setuptools>=62.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyring_buffer" +version = "1.0.1" +license = {text = "MIT"} +description = "A pure Python ring buffer for bytes" +readme = "README.md" +authors = [ + {name = "Michael Hansen", email = "mike@rhasspy.org"} +] +keywords = ["ring", "circular", "buffer"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Topic :: Text Processing :: Linguistic", + "License :: OSI Approved :: MIT License", + "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", +] +requires-python = ">=3.8.0" + +[project.urls] +"Source Code" = "http://github.com/rhasspy/pyring-buffer" + +[tool.setuptools] +platforms = ["any"] +zip-safe = true +include-package-data = true + +[tool.setuptools.packages.find] +include = ["pyring_buffer"] +exclude = ["tests", "tests.*"] diff --git a/requirements_dev.txt b/requirements_dev.txt index 18755a4..8a4df7b 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -4,3 +4,4 @@ isort==5.11.3 mypy==0.991 pylint==2.15.9 pytest==7.4.3 +build==1.2.2 diff --git a/script/package b/script/package index 1f04c1f..b124a6b 100755 --- a/script/package +++ b/script/package @@ -8,4 +8,4 @@ _PROGRAM_DIR = _DIR.parent _VENV_DIR = _PROGRAM_DIR / ".venv" context = venv.EnvBuilder().ensure_directories(_VENV_DIR) -subprocess.check_call([context.env_exe, _PROGRAM_DIR / "setup.py", "bdist_wheel"]) +subprocess.check_call([context.env_exe, "-m", "build", "--wheel", "--sdist"]) diff --git a/setup.py b/setup.py deleted file mode 100644 index 0b1ad56..0000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 -from pathlib import Path - -import setuptools -from setuptools import setup - -this_dir = Path(__file__).parent - -# ----------------------------------------------------------------------------- - -# Load README in as long description -long_description: str = "" -readme_path = this_dir / "README.md" -if readme_path.is_file(): - long_description = readme_path.read_text(encoding="utf-8") - -# ----------------------------------------------------------------------------- - -setup( - name="pyring_buffer", - version="1.0.0", - description="A pure Python ring buffer for bytes", - long_description=long_description, - long_description_content_type="text/markdown", - url="http://github.com/rhasspy/pyring-buffer", - author="Michael Hansen", - author_email="mike@rhasspy.org", - packages=setuptools.find_packages(), - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "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", - ], - keywords="ring circular buffer", -) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..1164e23 --- /dev/null +++ b/tox.ini @@ -0,0 +1,13 @@ +[tox] +env_list = + py{38,39,310,311,312,313} +minversion = 4.12.1 + +[testenv] +description = run the tests with pytest +package = wheel +wheel_build_env = .pkg +deps = + pytest>=6 +commands = + pytest {tty:--color=yes} {posargs}