From 6201755bb65a4a6dfbf6652b4965e9e48d7141e6 Mon Sep 17 00:00:00 2001 From: Noemi Frisina <54588199+noemifrisina@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:54:24 +0100 Subject: [PATCH] Drop python 3.9 and more CI fixes (#230) --- .bumpversion.cfg | 2 +- .github/actions/install_requirements/action.yml | 10 +++++----- .github/workflows/code.yml | 4 ++-- CHANGELOG.md | 3 +++ pyproject.toml | 5 ++--- src/nexgen/__init__.py | 2 +- src/nexgen/command_line/phil_files_cli.py | 8 +------- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 67ad4750..1201fcec 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.1 +current_version = 0.9.0 commit = True tag = True diff --git a/.github/actions/install_requirements/action.yml b/.github/actions/install_requirements/action.yml index 42ede5d7..b1730775 100644 --- a/.github/actions/install_requirements/action.yml +++ b/.github/actions/install_requirements/action.yml @@ -16,7 +16,7 @@ runs: steps: - name: Setup python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python_version }} @@ -26,19 +26,19 @@ runs: # -c uses requirements.txt as constraints, see 'Validate requirements file' pip install -c ${{ inputs.requirements_file }} ${{ inputs.install_options }} shell: bash - + - name: Create lockfile run: | mkdir -p lockfiles pip freeze --exclude-editable > lockfiles/${{ inputs.requirements_file }} # delete the self referencing line and make sure it isn't blank - sed -i '/file:/d' lockfiles/${{ inputs.requirements_file }} + sed -i'' -e '/file:/d' lockfiles/${{ inputs.requirements_file }} shell: bash - name: Upload lockfiles - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4.0.0 with: - name: lockfiles + name: lockfiles-${{ inputs.python_version }}-${{ inputs.artifact_name }}-${{ github.sha }} path: lockfiles # This eliminates the class of problems where the requirements being given no diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 1202c9f3..171519f8 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -45,12 +45,12 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] # can add windows-latest, macos-latest - python: ["3.10", "3.11"] + python: ["3.11"] install: ["-e .[dev]"] # Make one version be non-editable to test both paths of version code include: - os: "ubuntu-latest" - python: "3.9" + python: "3.10" install: ".[dev]" runs-on: ${{ matrix.os }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d89cd53..e3972c1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ ### Changed - Small CI updates +### Removed +- Dropped Python 3.9 support + ## 0.9.0 diff --git a/pyproject.toml b/pyproject.toml index 9a043383..3476937c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,14 +4,13 @@ build-backend = "setuptools.build_meta" [project] name = "nexgen" -version = "0.9.1" +version = "0.9.0" description = "Next Generation Nexus Generator" classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", ] @@ -29,7 +28,7 @@ dependencies = [ ] license.file = "LICENSE" readme = "README.rst" -requires-python = ">=3.8" +requires-python = ">=3.10" [project.optional-dependencies] dev = [ diff --git a/src/nexgen/__init__.py b/src/nexgen/__init__.py index e1ab96a9..f66b2330 100644 --- a/src/nexgen/__init__.py +++ b/src/nexgen/__init__.py @@ -6,5 +6,5 @@ __author__ = "Diamond Light Source - Scientific Software" __email__ = "data_analysis@diamond.ac.uk" -__version__ = "0.9.1" +__version__ = "0.9.0" __version_tuple__ = tuple(int(x) for x in __version__.split(".")) diff --git a/src/nexgen/command_line/phil_files_cli.py b/src/nexgen/command_line/phil_files_cli.py index 53078031..51a7a349 100644 --- a/src/nexgen/command_line/phil_files_cli.py +++ b/src/nexgen/command_line/phil_files_cli.py @@ -7,6 +7,7 @@ import logging import shutil import sys +from importlib.resources import files from pathlib import Path import freephil @@ -14,13 +15,6 @@ from .. import log, templates from . import config_parser, nexus_parser, version_parser -try: - from importlib.resources import files -except ImportError: - # Python < 3.9 compatibility - from importlib_resources import files - - # Define a logger object logger = logging.getLogger("nexgen.NeXusGenerator")