From 3a934524927d5f9585b79cc081c6eee8ac1ba55c Mon Sep 17 00:00:00 2001 From: pdv Date: Sun, 22 Feb 2026 09:13:36 -0500 Subject: [PATCH 1/2] Drop Python <3.9 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove compat shims for asyncio.current_task and contextlib.asynccontextmanager (both available since 3.7), remove async_generator dependency, update classifiers, tox envlist, and CI matrix to reflect supported versions 3.9–3.12. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/tests.yml | 2 +- aiohappybase/pool.py | 11 ++--------- requirements.txt | 1 - setup.cfg | 8 ++++---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8278a1e..79fb3d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: container: aiudirog/aiohappybase-test-env:latest strategy: matrix: - python: ['3.6', '3.7', '3.8', '3.9'] + python: ['3.9', '3.10', '3.11', '3.12'] client: ['socket', 'http'] fail-fast: false steps: diff --git a/aiohappybase/pool.py b/aiohappybase/pool.py index f4eb5af..3d80b18 100644 --- a/aiohappybase/pool.py +++ b/aiohappybase/pool.py @@ -14,15 +14,8 @@ from .connection import Connection -try: - from asyncio import current_task -except ImportError: # < 3.7 - current_task = aio.Task.current_task - -try: - from contextlib import asynccontextmanager -except ImportError: # < 3.7 - from async_generator import asynccontextmanager +from asyncio import current_task +from contextlib import asynccontextmanager logger = logging.getLogger(__name__) diff --git a/requirements.txt b/requirements.txt index 613805d..4249af8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ thriftpy2>=0.4.11 -async_generator; python_version < '3.7' \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 39e3c0b..b714a5c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,10 +10,10 @@ classifiers = Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: MIT License - 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 Topic :: Database Topic :: Software Development :: Libraries :: Python Modules keywords = @@ -63,7 +63,7 @@ filename = *happybase*/**.py exclude = build,dist,venv,.tox,*.egg*,coverage,doc [tox:tox] -envlist = py36, py37, py38, py39 +envlist = py39, py310, py311, py312 [testenv] deps = -rtest-requirements.txt From 7b75c2053f85d45443a27198d77d5a5ab9b311b6 Mon Sep 17 00:00:00 2001 From: pdv Date: Sun, 22 Feb 2026 09:14:27 -0500 Subject: [PATCH 2/2] Migrate packaging to pyproject.toml Move all project metadata, dependencies, and tool configuration (pytest, coverage) from setup.cfg/setup.py into pyproject.toml. Keep setup.cfg for flake8 and versioneer (which still requires setup.py integration). Update Makefile to use sphinx-build directly and CI publish workflow to use python -m build instead of setup.py commands. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/publish.yml | 4 +- Makefile | 4 +- pyproject.toml | 59 +++++++++++++++++++++++++++++ setup.cfg | 71 ----------------------------------- setup.py | 1 - 5 files changed, 63 insertions(+), 76 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c9cda2d..7367be4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,12 +37,12 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - python -m pip install -U setuptools wheel autopep8 + python -m pip install -U build setuptools wheel autopep8 python -m pip install -U -r requirements.txt - name: Generate Sync Stub Files run: python make_sync_stubs.py - name: Build - run: python setup.py sdist bdist_wheel + run: python -m build - name: Publish uses: pypa/gh-action-pypi-publish@master with: diff --git a/Makefile b/Makefile index 6d0687b..d5eff19 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: doc clean doc: - python setup.py build_sphinx + sphinx-build doc/ doc/build/html/ @echo @echo Generated documentation: "file://"$$(readlink -f doc/build/html/index.html) @echo @@ -17,4 +17,4 @@ clean: find . -name '*.py[co]' -delete dist: test - python setup.py sdist + python -m build diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f6e74c6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = ["setuptools", "versioneer"] +build-backend = "setuptools.build_meta" + +[project] +name = "aiohappybase" +description = "Asyncio fork of HappyBase" +readme = "README.rst" +license = {text = "MIT"} +authors = [{name = "Roger Aiudi", email = "aiudirog@gmail.com"}] +keywords = ["hbase", "thrift", "async", "asyncio", "happybase"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Database", + "Topic :: Software Development :: Libraries :: Python Modules", +] +requires-python = ">=3.9" +dependencies = ["thriftpy2>=0.4.11"] +dynamic = ["version"] + +[project.optional-dependencies] +http = ["thriftpy2-httpx-client"] + +[project.urls] +Homepage = "https://github.com/python-happybase/aiohappybase" + +[tool.setuptools] +py-modules = ["happybase"] +include-package-data = true + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.pytest.ini_options] +junit_family = "xunit1" + +[tool.coverage.run] +source = ["."] +include = ["aiohappybase/*", "tests/*"] +omit = ["aiohappybase/_version.py"] + +[tool.coverage.html] +directory = "coverage/" + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "if TYPE_CHECKING:", + "if __name__ == .__main__.:", + "pass", +] +include = ["aiohappybase/*", "tests/*"] +omit = ["aiohappybase/_version.py"] diff --git a/setup.cfg b/setup.cfg index b714a5c..115895c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,79 +1,8 @@ -[metadata] -name = aiohappybase -description = Asyncio fork of HappyBase -long_description = file: README.rst -author = Roger Aiudi -author_email = aiudirog@gmail.com -url = https://github.com/python-happybase/aiohappybase -license = MIT -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Topic :: Database - Topic :: Software Development :: Libraries :: Python Modules -keywords = - hbase - thrift - async - asyncio - happybase - -[options] -include_package_data = True -packages = find: -py_modules = - happybase - -[options.packages.find] -exclude = - tests - -[options.extras_require] -http = thriftpy2-httpx-client - -[coverage:run] -source = . -include = aiohappybase/*,tests/* -omit = aiohappybase/_version.py - -[coverage:html] -directory = coverage/ - -[coverage:report] -exclude_lines = - pragma: no cover - if TYPE_CHECKING: - if __name__ == .__main__.: - pass -include = aiohappybase/*,tests/* -omit = aiohappybase/_version.py - -[build_sphinx] -source-dir = doc/ -build-dir = doc/build/ - [flake8] max-line-length = 80 filename = *happybase*/**.py exclude = build,dist,venv,.tox,*.egg*,coverage,doc -[tox:tox] -envlist = py39, py310, py311, py312 - -[testenv] -deps = -rtest-requirements.txt -commands = - python -m pytest - AIOHAPPYBASE_COMPAT=0.90 python -m pytest - -[tool:pytest] -junit_family = xunit1 - [versioneer] VCS = git style = pep440 diff --git a/setup.py b/setup.py index dae322b..d14fa5b 100644 --- a/setup.py +++ b/setup.py @@ -4,5 +4,4 @@ setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), - install_requires=[*filter(None, map(str.strip, open('requirements.txt')))], )