From 5afd5db9b30e18331384da8b8b40f83d4c3cea19 Mon Sep 17 00:00:00 2001 From: Antti Soininen Date: Fri, 26 Jan 2024 10:39:36 +0200 Subject: [PATCH] Enable support for Python 3.12 All developer requirements (including for building documentation) are now in dev-requirements.txt. Also, cleaned up dependencies after Dagster removal. Re #2522 --- .github/workflows/make_bundle.yml | 7 +++++-- .github/workflows/test_runner.yml | 19 ++++++++----------- dev-requirements.txt | 17 +++++++---------- docs/requirements.txt | 8 -------- pyproject.toml | 5 ++--- requirements.txt | 6 +++--- spinetoolbox/ui/settings.py | 14 +++++++------- 7 files changed, 32 insertions(+), 44 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/.github/workflows/make_bundle.yml b/.github/workflows/make_bundle.yml index 6598c8acb..2626c0f20 100644 --- a/.github/workflows/make_bundle.yml +++ b/.github/workflows/make_bundle.yml @@ -21,8 +21,11 @@ jobs: - name: "Set up Python" uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.12" cache: pip + cache-dependency-path: | + pyproject.toml + requirements.txt - name: Install dependencies run: | python -m pip install --upgrade pip @@ -37,7 +40,7 @@ jobs: run: | mkdir embedded-python cd embedded-python - curl -o python.zip https://www.python.org/ftp/python/3.11.9/python-3.11.9-embed-amd64.zip + curl -o python.zip https://www.python.org/ftp/python/3.12.3/python-3.12.3-embed-amd64.zip tar xf python.zip del python.zip - name: Build bundle diff --git a/.github/workflows/test_runner.yml b/.github/workflows/test_runner.yml index 5ca43dedb..0c8ae02d0 100644 --- a/.github/workflows/test_runner.yml +++ b/.github/workflows/test_runner.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: true matrix: - python-version: [3.8, 3.9, "3.10", 3.11] + python-version: [3.8, 3.9, "3.10", 3.11, 3.12] os: [windows-latest, ubuntu-22.04] steps: - uses: actions/checkout@v4 @@ -32,8 +32,9 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | - requirements.txt pyproject.toml + requirements.txt + dev-requirements.txt - name: Display Python version run: python -c "import sys; print(sys.version)" @@ -48,16 +49,10 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r requirements.txt + python -m pip install -r dev-requirements.txt - name: List packages run: python -m pip list - - name: Install python3 kernelspecs - run: | - python -m pip install ipykernel - python -m ipykernel install --user - - name: Install coverage - run: - python -m pip install coverage[toml] - name: Run tests run: | if [ "$RUNNER_OS" != "Windows" ]; then @@ -75,7 +70,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10", 3.11] + python-version: [3.8, 3.9, "3.10", 3.11, 3.12] os: [windows-latest, ubuntu-22.04] # needs: unit-tests steps: @@ -86,8 +81,9 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | - requirements.txt pyproject.toml + requirements.txt + dev-requirements.txt - name: Install additional packages for Linux if: runner.os == 'Linux' run: | @@ -99,6 +95,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r requirements.txt + python -m pip install -r dev-requirements.txt - name: List packages run: python -m pip list diff --git a/dev-requirements.txt b/dev-requirements.txt index 7e949b5b8..338df871c 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,12 +1,9 @@ -black == 24.4.2 -pre-commit == 2.0.1 -PyYAML >= 5.4 -pylint >= 2.3.0 -setuptools >=64 -setuptools_scm[toml] >= 6.2 -build -wheel >=0.36.2 -twine >= 3.4.1 coverage[toml] +black == 21.12b0 +pre-commit == 2.0.1 +pylint pyperf --r "docs/requirements.txt" +sphinx +sphinx_rtd_theme +sphinx-autoapi +recommonmark diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index a80a2762e..000000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -markupsafe < 2.1 # Jinja2<3.0 tries to import soft_unicode, which has been removed in markupsafe 2.1 -jinja2 < 3.0 # Dagster 0.12.8 requires Jinja2<3.0 -docutils < 0.17 -sphinx < 5.2 -sphinx_rtd_theme -recommonmark -astroid < 3.0 # sphinx-autoapi installs the latest astroid. We are not compatible with astroid v3.0 -sphinx-autoapi < 2.1 # 2.1 removed support for sphinx < 5.2.0 diff --git a/pyproject.toml b/pyproject.toml index 28ddff26f..ec7ad6fe7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,12 +11,11 @@ classifiers = [ "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", + "pyside6 >= 6.5.0, != 6.5.3, != 6.6.3, != 6.7.0", "jupyter-client >=6.0", "qtconsole >=5.1", - "sqlalchemy >=1.3", "spinedb_api>=0.31.1", "spine_engine>=0.24.0", "numpy >=1.20.2", diff --git a/requirements.txt b/requirements.txt index 0ff41d492..93ee2dc10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ --e git+https://github.com/spine-tools/Spine-Database-API.git#egg=spinedb_api --e git+https://github.com/spine-tools/spine-engine.git#egg=spine_engine --e git+https://github.com/spine-tools/spine-items.git#egg=spine_items +-e git+https://github.com/spine-tools/Spine-Database-API.git@toolbox_2522_enable_python_3.12#egg=spinedb_api +-e git+https://github.com/spine-tools/spine-engine.git@toolbox_2522_enable_python_3.12#egg=spine_engine +-e git+https://github.com/spine-tools/spine-items.git@2522_enable_python_3.12#egg=spine_items -e . diff --git a/spinetoolbox/ui/settings.py b/spinetoolbox/ui/settings.py index ead0c2f83..1cc454478 100644 --- a/spinetoolbox/ui/settings.py +++ b/spinetoolbox/ui/settings.py @@ -14,7 +14,7 @@ ################################################################################ ## Form generated from reading UI file 'settings.ui' ## -## Created by: Qt User Interface Compiler version 6.7.0 +## Created by: Qt User Interface Compiler version 6.6.3 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -406,8 +406,8 @@ def setupUi(self, SettingsForm): self.line_3 = QFrame(self.groupBox_julia) self.line_3.setObjectName(u"line_3") - self.line_3.setFrameShape(QFrame.Shape.VLine) - self.line_3.setFrameShadow(QFrame.Shadow.Sunken) + self.line_3.setFrameShape(QFrame.VLine) + self.line_3.setFrameShadow(QFrame.Sunken) self.horizontalLayout_14.addWidget(self.line_3) @@ -489,8 +489,8 @@ def setupUi(self, SettingsForm): self.line = QFrame(self.groupBox_julia) self.line.setObjectName(u"line") - self.line.setFrameShape(QFrame.Shape.HLine) - self.line.setFrameShadow(QFrame.Shadow.Sunken) + self.line.setFrameShape(QFrame.HLine) + self.line.setFrameShadow(QFrame.Sunken) self.verticalLayout_10.addWidget(self.line) @@ -543,8 +543,8 @@ def setupUi(self, SettingsForm): self.line_2 = QFrame(self.groupBox_python) self.line_2.setObjectName(u"line_2") - self.line_2.setFrameShape(QFrame.Shape.VLine) - self.line_2.setFrameShadow(QFrame.Shadow.Sunken) + self.line_2.setFrameShape(QFrame.VLine) + self.line_2.setFrameShadow(QFrame.Sunken) self.horizontalLayout_5.addWidget(self.line_2)