Skip to content

Commit

Permalink
Remove deprecated call to pkg_resources (#36)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
-----
  • Loading branch information
jfoster17 authored Aug 11, 2023
1 parent 35f3c7d commit 9747254
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
12 changes: 7 additions & 5 deletions echo/version.py
Original file line number Diff line number Diff line change
@@ -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')
10 changes: 6 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 =
Expand All @@ -39,4 +41,4 @@ docs =
numpydoc
sphinx-rtd-theme
qt =
PyQt5>=5.9
PyQt5>=5.14
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 9747254

Please sign in to comment.