Skip to content

Commit

Permalink
Merge pull request #2 from DavidCEllis/support_older_python
Browse files Browse the repository at this point in the history
Support all non EOL Python versions
  • Loading branch information
DavidCEllis authored Oct 21, 2023
2 parents 4316b85 + 843361d commit 6cce363
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"Development Status :: 3 - Alpha",
"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",
Expand Down
12 changes: 6 additions & 6 deletions src/ducktools/lazyimporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import abc
import sys

__version__ = "v0.1.0"
__version__ = "v0.1.1"
__all__ = [
"LazyImporter",
"ModuleImport",
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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()."
)
Expand Down Expand Up @@ -409,7 +409,7 @@ def group_importers(inst):


class LazyImporter:
_imports: list[ModuleImport | FromImport | MultiFromImport]
_imports: "list[ModuleImport | FromImport | MultiFromImport]"
_globals: dict

_importers = _ImporterGrouper()
Expand Down

0 comments on commit 6cce363

Please sign in to comment.