From 44933b417e3141e8efa2921bc9debd0bd8f35c48 Mon Sep 17 00:00:00 2001 From: David C Ellis Date: Sat, 21 Oct 2023 12:10:26 +0100 Subject: [PATCH 1/3] Test against and support all non EOL python. --- .github/workflows/auto_test.yml | 4 ++-- pyproject.toml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/auto_test.yml b/.github/workflows/auto_test.yml index 70fcecc..70dd67f 100644 --- a/.github/workflows/auto_test.yml +++ b/.github/workflows/auto_test.yml @@ -14,12 +14,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ["3.12", "3.11", "3.10", "pypy-3.10"] + python-version: ["3.12", "3.11", "3.10", "3.9", "3.8", "pypy-3.10"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/pyproject.toml b/pyproject.toml index f5caa35..2619a3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,12 @@ authors = [ { name="David C Ellis" }, ] readme="README.md" -requires-python = ">=3.10" +requires-python = ">=3.8" dependencies = [] classifiers = [ "Development Status :: 1 - Planning", + "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", From 0ddef2f0fc48370b98b6dc3126cc0fbde520567b Mon Sep 17 00:00:00 2001 From: David C Ellis Date: Sat, 21 Oct 2023 12:23:27 +0100 Subject: [PATCH 2/3] Convert type annotations that are invalid in python 3.8/3.9 to strings. --- src/ducktools/lazyimporter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ducktools/lazyimporter.py b/src/ducktools/lazyimporter.py index c273620..e615d35 100644 --- a/src/ducktools/lazyimporter.py +++ b/src/ducktools/lazyimporter.py @@ -86,7 +86,7 @@ def do_import(self, globs=None): class ModuleImport(_ImportBase): module_name: str - asname: None | str + asname: "None | str" def __init__(self, module_name, asname=None): """ @@ -197,7 +197,7 @@ def do_import(self, globs=None): class MultiFromImport(_ImportBase): module_name: str - attrib_names: list[str | tuple[str, str]] + attrib_names: "list[str | tuple[str, str]]" def __init__(self, module_name, attrib_names): """ @@ -271,7 +271,7 @@ def do_import(self, globs=None): class _SubmoduleImports(_ImportBase): module_name: str - submodules: set[str] + submodules: "set[str]" def __init__(self, module_name, submodules=None): """ @@ -361,7 +361,7 @@ def group_importers(inst): importers = {} for imp in inst._imports: # noqa - if imp.import_level > 0 and inst._globals is None: + if imp.import_level > 0 and inst._globals is None: # noqa raise ValueError( "Attempted to setup relative import without providing globals()." ) @@ -409,7 +409,7 @@ def group_importers(inst): class LazyImporter: - _imports: list[ModuleImport | FromImport | MultiFromImport] + _imports: "list[ModuleImport | FromImport | MultiFromImport]" _globals: dict _importers = _ImporterGrouper() From 843361d7c1d098b4ff0a26eed8914db504b8a951 Mon Sep 17 00:00:00 2001 From: David C Ellis Date: Sat, 21 Oct 2023 12:27:31 +0100 Subject: [PATCH 3/3] Update version, status to alpha --- pyproject.toml | 2 +- src/ducktools/lazyimporter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2619a3a..3240386 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ readme="README.md" requires-python = ">=3.8" dependencies = [] classifiers = [ - "Development Status :: 1 - Planning", + "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/src/ducktools/lazyimporter.py b/src/ducktools/lazyimporter.py index e615d35..1efcb5c 100644 --- a/src/ducktools/lazyimporter.py +++ b/src/ducktools/lazyimporter.py @@ -26,7 +26,7 @@ import abc import sys -__version__ = "v0.1.0" +__version__ = "v0.1.1" __all__ = [ "LazyImporter", "ModuleImport",