diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21f36406c45..f4a04165d9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.9" - uses: pre-commit/action@v3.0.0 with: extra_args: --files $(git diff origin/main --name-only) @@ -33,10 +33,6 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - python-version: "3.8" - install-method: mamba - - os: ubuntu-latest python-version: "3.9" install-method: mamba @@ -48,18 +44,18 @@ jobs: - os: ubuntu-latest python-version: "3.11" - install-method: pip + install-method: mamba - os: ubuntu-latest - python-version: "3.10" + python-version: "3.11" install-method: pip - os: macos-latest - python-version: "3.10" + python-version: "3.11" install-method: mamba - os: macos-latest - python-version: "3.8" + python-version: "3.9" install-method: pip defaults: @@ -147,7 +143,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.9" - name: Install doc dependencies run: | diff --git a/.readthedocs.yml b/.readthedocs.yml index 98b2982554b..6be28ee5c85 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,7 +6,7 @@ build: - ffmpeg - graphviz tools: - python: "3.8" + python: "3.9" python: install: diff --git a/ctapipe/core/provenance.py b/ctapipe/core/provenance.py index 312f43884ee..93b41f1879b 100644 --- a/ctapipe/core/provenance.py +++ b/ctapipe/core/provenance.py @@ -4,7 +4,6 @@ TODO: have this register whenever ctapipe is loaded """ - import json import logging import os @@ -14,21 +13,16 @@ from collections import UserList from contextlib import contextmanager from importlib import import_module +from importlib.metadata import distributions, version from os.path import abspath from pathlib import Path import psutil from astropy.time import Time -import ctapipe - +from ..version import __version__ from .support import Singleton -if sys.version_info < (3, 9): - from importlib_metadata import distributions, version -else: - from importlib.metadata import distributions, version - log = logging.getLogger(__name__) __all__ = ["Provenance"] @@ -318,7 +312,7 @@ def _get_system_provenance(): bits, linkage = platform.architecture() return dict( - ctapipe_version=ctapipe.__version__, + ctapipe_version=__version__, ctapipe_resources_version=get_module_version("ctapipe_resources"), eventio_version=get_module_version("eventio"), ctapipe_svc_path=os.getenv("CTAPIPE_SVC_PATH"), diff --git a/ctapipe/tools/info.py b/ctapipe/tools/info.py index 66b28ba97c8..8ded56de360 100644 --- a/ctapipe/tools/info.py +++ b/ctapipe/tools/info.py @@ -3,17 +3,13 @@ import logging import os import sys +from importlib.resources import files from ..core import Provenance, get_module_version from ..core.plugins import detect_and_import_plugins from ..utils import datasets from .utils import get_parser -if sys.version_info < (3, 9): - from importlib_resources import files -else: - from importlib.resources import files - __all__ = ["info"] # TODO: this list should be global (or generated at install time) diff --git a/docs/changes/2342.maintenance.rst b/docs/changes/2342.maintenance.rst new file mode 100644 index 00000000000..df37bb4ebba --- /dev/null +++ b/docs/changes/2342.maintenance.rst @@ -0,0 +1 @@ +Drop support for python 3.8 in accordance with the NEP 29 schedule. diff --git a/docs/conf.py b/docs/conf.py index 4c228dc4886..d4f43125505 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -322,7 +322,7 @@ def setup(app): # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - "python": ("https://docs.python.org/3.8", None), + "python": ("https://docs.python.org/3.9", None), "numpy": ("https://numpy.org/doc/stable/", None), "scipy": ("https://docs.scipy.org/doc/scipy/", None), "astropy": ("https://docs.astropy.org/en/latest/", None), diff --git a/environment.yml b/environment.yml index 99abfdd296c..0836ac3a37b 100644 --- a/environment.yml +++ b/environment.yml @@ -4,7 +4,7 @@ channels: - conda-forge - default dependencies: - - python=3.9 + - python=3.11 - pip - astropy=5 - black @@ -19,8 +19,8 @@ dependencies: - joblib - jupyter - matplotlib - - numba=0.56 - - numpy>=1.17 + - numba>=0.56 + - numpy>=1.22 - numpydoc - pandas - pre-commit diff --git a/setup.cfg b/setup.cfg index 0d3b0af7749..73574ddac5d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,9 +11,9 @@ classifiers = Intended Audience :: Science/Research License :: OSI Approved :: BSD License Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython Topic :: Scientific/Engineering :: Astronomy Development Status :: 3 - Alpha @@ -21,7 +21,7 @@ classifiers = [options] packages = find: -python_requires = >=3.8 +python_requires = >=3.9 zip_safe = False install_requires= astropy ~=5.0