From 9e1286fffb8b31a5d1c5e4a901910acd26ea734c Mon Sep 17 00:00:00 2001 From: Antti Soininen Date: Thu, 25 Jan 2024 17:07:56 +0100 Subject: [PATCH] Lift Python version upper limit Re spine-tools/Spine-Toolbox#2522 --- .github/workflows/run_unit_tests.yml | 7 ++----- pyproject.toml | 23 ++++++++++------------ spine_items/importer/flattened_mappings.py | 2 +- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index c610bedb..3821e9c4 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-22.04] - python-version: [3.8, 3.9, "3.10", 3.11] + python-version: [3.8, 3.9, "3.10", 3.11, 3.12] steps: - uses: actions/checkout@v4 with: @@ -37,15 +37,12 @@ jobs: PYTHONUTF8: 1 run: | python -m pip install --upgrade pip - python -m pip install wheel python -m pip install --no-deps -e . python -m pip install -r requirements.txt + python -m pip install -e .[dev] - name: List packages run: pip list - - name: Install coverage - run: - python -m pip install coverage[toml] - name: Run tests run: | if [ "$RUNNER_OS" != "Windows" ]; then diff --git a/pyproject.toml b/pyproject.toml index 1827d4c3..f29a396b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,18 +7,12 @@ description = "Spine project items" keywords = ["energy system modelling", "workflow", "optimisation", "database"] readme = {file = "README.md", content-type = "text/markdown"} classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", - "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", + "Operating System :: OS Independent", ] -requires-python = ">=3.8.1, <3.12" +requires-python = ">=3.8.1" dependencies = [ - "pyside6 >= 6.5.0, != 6.5.3, != 6.6.3", - "pyodbc >=4.0", - # v1.4 does not pass tests - "sqlalchemy >=1.3, <1.4", - "pygments >=2.8", - "numpy >=1.20.2", "spinedb_api>=0.30.0", "spine_engine>=0.23.0", # "spinetoolbox >=0.6.18", @@ -27,6 +21,9 @@ dependencies = [ [project.urls] Repository = "https://github.com/spine-tools/spine-items" +[project.optional-dependencies] +dev = ["coverage[toml]"] + [build-system] requires = ["setuptools>=64", "setuptools_scm[toml]>=6.2", "wheel", "build"] build-backend = "setuptools.build_meta" @@ -41,9 +38,9 @@ include-package-data = true [tool.setuptools.packages.find] exclude = [ - "bin*", - "fig*", - "tests*", + "bin*", + "fig*", + "tests*", ] [tool.coverage.run] diff --git a/spine_items/importer/flattened_mappings.py b/spine_items/importer/flattened_mappings.py index eeb14d09..7393d996 100644 --- a/spine_items/importer/flattened_mappings.py +++ b/spine_items/importer/flattened_mappings.py @@ -364,7 +364,7 @@ def display_position(self, row): return SpineDBManager.display_data_from_parsed(value) except ParameterValueFormatError: return None - # B) Handle all other cases cases + # B) Handle all other cases if component.position == Position.hidden: if self._display_names[row].endswith("flags") and not isinstance(component.value, bool): return string_to_bool(str(component.value))