diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4af28bc..52b0e68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,11 +82,16 @@ jobs: strategy: fail-fast: false matrix: - python-version: [cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312] + # cp38 dropped: Python 3.8 is EOL and its leg fails outright. + python-version: [cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312] runs-on: ubuntu-latest env: py: /opt/python/${{ matrix.python-version }}/bin/python - img: quay.io/pypa/manylinux2014_aarch64 + # manylinux_2_28, not manylinux2014: cbor2 (a hard dependency via + # autobahn) ships only manylinux_2_28 aarch64 wheels for cp311+, so the + # 2014 (glibc 2.17) container can't use them and falls back to a + # from-source C build that fails under QEMU. + img: quay.io/pypa/manylinux_2_28_aarch64 steps: diff --git a/setup.py b/setup.py index 91c1b4a..bcd9cc3 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ ], ext_modules=extensions, install_requires=install_requires, - python_requires=">=3.7", + python_requires=">=3.8", package_data={'vpython': ['vpython_data/*', 'vpython_libraries/*', 'vpython_libraries/images/*']}, diff --git a/vpython/__init__.py b/vpython/__init__.py index 1c17f05..e46c197 100644 --- a/vpython/__init__.py +++ b/vpython/__init__.py @@ -1,17 +1,20 @@ -from pkg_resources import get_distribution, DistributionNotFound +# importlib.metadata, not pkg_resources: fresh Python 3.12+ environments no +# longer ship setuptools, so `import pkg_resources` raises ModuleNotFoundError +# the moment `import vpython` runs (caught by CI's macos-3.12 leg). +from importlib.metadata import version as _dist_version, PackageNotFoundError from .gs_version import glowscript_version try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: + __version__ = _dist_version(__name__) +except PackageNotFoundError: # package is not installed pass __gs_version__ = glowscript_version() del glowscript_version -del get_distribution -del DistributionNotFound +del _dist_version +del PackageNotFoundError # Keep the remaining imports later to ensure that __version__ and # __gs_version__ exist before importing vpython, which itself imports