From 8ff589184cdc0a2face9bd3430757f672292462c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 31 May 2025 19:22:56 +0200 Subject: [PATCH 1/2] Use standard setuptools `attr:` feature, fixing Python 3.14 compat Use the standard setuptools `attr:` feature to obtain the version via setuptools' built-in AST parser rather than writing a custom AST parser in `setup.py`. This fixes compatibility with Python 3.14, since the custom parser is not compatible with the new `ast.Constant` type. --- setup.cfg | 1 + setup.py | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg index 10332bd..ae01e92 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = curtsies +version = attr: curtsies.__version__ description = Curses-like terminal wrapper, with colored strings! long_description = file: README.md, long_description_content_type = text/markdown diff --git a/setup.py b/setup.py deleted file mode 100644 index 0a2f524..0000000 --- a/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -from setuptools import setup -import ast -import os - - -def version(): - """Return version string.""" - with open(os.path.join("curtsies", "__init__.py")) as input_file: - for line in input_file: - if line.startswith("__version__"): - return ast.parse(line).body[0].value.s - - -setup( - version=version(), -) From cc7d50d148e141436b5558f4cb00d27ac58082f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sat, 31 May 2025 20:08:36 +0200 Subject: [PATCH 2/2] Bump setuptools dependency to 46.4.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6f7e474..ed70437 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools >= 43", + "setuptools >= 46.4.0", ] build-backend = "setuptools.build_meta"