From d5cd57221e47929972b5ac982b7dcd8ca2d26dfd Mon Sep 17 00:00:00 2001 From: sametz Date: Fri, 8 Dec 2023 21:15:07 -0500 Subject: [PATCH] version cleanup: removed py37 shims (though tests still pass for it), made py38-py311 requirements (numba not out yet for py312), and limited tox/GH Actions to testing oly py3.8-3.11. --- .github/workflows/tox-cross-platform.yml | 2 +- setup.cfg | 15 +++++++-------- src/nmrsim/__init__.py | 2 +- src/nmrsim/qm.py | 10 ++-------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tox-cross-platform.yml b/.github/workflows/tox-cross-platform.yml index 2cbe34f..1a2f041 100644 --- a/.github/workflows/tox-cross-platform.yml +++ b/.github/workflows/tox-cross-platform.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: os: [macos-latest, windows-latest, ubuntu-latest] - python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/setup.cfg b/setup.cfg index dbe7139..12bba71 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,7 +22,7 @@ classifiers = Topic :: Scientific/Engineering :: Visualization [options] -python_requires = >=3.7 +python_requires = >=3.8, <3.12 package_dir = = src packages = find: @@ -31,7 +31,6 @@ install_requires = matplotlib numpy sparse!=0.11, !=1.12 - importlib_resources ; python_version<"3.7" [options.packages.find] where = src @@ -93,7 +92,7 @@ source = */site-packages/nmrsim/ [tox:tox] -envlist = py37, py38, py39, py310, py311, py312 +envlist = py38, py39, py310, py311 isolated_build = True [testenv] @@ -109,11 +108,11 @@ commands = # usedevelop=True should = "pip install -e ." usedevelop=True -[testenv:py312] -commands = - download = true - virtualenv --upgrade-embed-wheels - pytest {posargs} +;[testenv:py312] +;commands = +; download = true +; virtualenv --upgrade-embed-wheels +; pytest {posargs} [testenv:format] skip_install = True diff --git a/src/nmrsim/__init__.py b/src/nmrsim/__init__.py index 4ce0e3e..b92dd3c 100644 --- a/src/nmrsim/__init__.py +++ b/src/nmrsim/__init__.py @@ -64,5 +64,5 @@ __version__ = "0.6.0" -# When Python 5.7 sunsets, consider the following for dynamic versioning: +# When Python 3.7 sunsets, consider the following for dynamic versioning: # __version__ = __import__('importlib.metadata').metadata.version(__package__) diff --git a/src/nmrsim/qm.py b/src/nmrsim/qm.py index cef2494..64427c3 100644 --- a/src/nmrsim/qm.py +++ b/src/nmrsim/qm.py @@ -40,16 +40,10 @@ calculating second-order spectra: one using pydata/sparse and caching, and the other using neither. """ -import sys - -import scipy.sparse - -if sys.version_info >= (3, 7): - from importlib import resources -else: - import importlib_resources as resources +from importlib import resources import numpy as np # noqa: E402 +import scipy.sparse import sparse # noqa: E402 import nmrsim.bin # noqa: E402