From 97472541ddb9a326b535a4d36f11294e5a5355b0 Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Fri, 11 Aug 2023 17:40:48 -0400 Subject: [PATCH] Remove deprecated call to pkg_resources (#36) * Remove deprecated call to pkg_resources * Fix import logic for older versions of Python * Drop Python 3.6 for importlib_metadata support * Fix python 3.8 * Require python>=3.8 * Require PyQt >= 5.14 in keeping with glue requirements * Add py311 test envs Co-authored-by: Derek Homeier ----- --- .github/workflows/ci_workflows.yml | 16 +++++----------- echo/version.py | 12 +++++++----- setup.cfg | 10 ++++++---- tox.ini | 2 +- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml index 655f176ee..496716b2c 100644 --- a/.github/workflows/ci_workflows.yml +++ b/.github/workflows/ci_workflows.yml @@ -34,22 +34,17 @@ jobs: envs: | # Standard tests # Linux builds - test on all supported PyQt5, PyQt6 and PySide2 versions - - linux: py37-test-pyqt510 - - linux: py37-test-pyqt511 - - linux: py37-test-pyqt512 - - linux: py37-test-pyqt513 - linux: py39-test-pyqt515 - linux: py310-test-pyqt63 + - linux: py311-test-pyqt514 - - linux: py37-test-pyside513 - linux: py38-test-pyside514 - linux: py310-test-pyside515 - linux: py310-test-pyside63 # Test a few configurations on MacOS X (ask for arm64 with py310; may not be available yet) - - macos: py37-test-pyqt513 - macos: py38-test-pyqt514 - - macos: py310-test-pyqt515 + - macos: py311-test-pyqt515 PLAT: arm64 - macos: py310-test-pyqt63 PLAT: arm64 @@ -58,7 +53,6 @@ jobs: - macos: py310-test-pyside63 # Test some configurations on Windows - - windows: py37-test-pyqt510 - windows: py38-test-pyqt514 - windows: py39-test-pyqt515 - windows: py310-test-pyqt63 @@ -67,15 +61,15 @@ jobs: - windows: py310-test-pyside63 # Try out documentation build on Linux, macOS and Windows - - linux: py39-docs-pyqt513 + - linux: py39-docs-pyqt514 coverage: false - linux: py310-docs-pyqt63 coverage: false - - macos: py37-docs-pyqt513 + - macos: py39-docs-pyqt515 coverage: false - - windows: py38-docs-pyqt513 + - windows: py38-docs-pyqt514 coverage: false publish: diff --git a/echo/version.py b/echo/version.py index df931eb04..3b6fae3f6 100644 --- a/echo/version.py +++ b/echo/version.py @@ -1,8 +1,10 @@ -from pkg_resources import get_distribution, DistributionNotFound +import sys + +if sys.version_info >= (3, 9): + import importlib.metadata as importlib_metadata +else: + import importlib_metadata __all__ = ['__version__'] -try: - __version__ = get_distribution('echo').version -except DistributionNotFound: - __version__ = 'undefined' +__version__ = importlib_metadata.version('echo') diff --git a/setup.cfg b/setup.cfg index 7bb2f0e0f..f9b432589 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,9 +11,10 @@ classifiers = Intended Audience :: Developers License :: OSI Approved :: MIT License Natural Language :: English - 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 Operating System :: OS Independent Topic :: Utilities license = MIT @@ -23,11 +24,12 @@ long_description = file: README.rst [options] zip_safe = True packages = find: -python_requires = >=3.6 +python_requires = >=3.8 setup_requires = setuptools_scm install_requires = numpy qtpy + importlib_metadata; python_version<'3.9' [options.extras_require] test = @@ -39,4 +41,4 @@ docs = numpydoc sphinx-rtd-theme qt = - PyQt5>=5.9 + PyQt5>=5.14 diff --git a/tox.ini b/tox.ini index 4cffd04ad..63ec27bef 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{37,38,39,310}-{codestyle,test,docs}-{pyqt510,pyqt511,pyqt512,pyqt513,pyqt514,pyqt515,pyside513,pyside514,pyside515,pyqt63,pyside63} + py{37,38,39,310,311}-{codestyle,test,docs}-{pyqt510,pyqt511,pyqt512,pyqt513,pyqt514,pyqt515,pyside513,pyside514,pyside515,pyqt63,pyside63} requires = pip >= 18.0 setuptools >= 30.3.0