Skip to content

Commit

Permalink
Require Python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen committed Oct 17, 2024
1 parent 6043827 commit 3cfb27f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [windows-latest, ubuntu-22.04]
uses: ./.github/workflows/unit_tests.yml
with:
Expand All @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [windows-latest, ubuntu-22.04]
uses: ./.github/workflows/execution_tests.yml
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)

## [Unreleased]

This version of Spine Toolbox requires Python version 3.9 or later.

### Added

### Changed
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Spine Toolbox
Link to the documentation: [https://spine-toolbox.readthedocs.io/en/latest/?badge=latest](https://spine-toolbox.readthedocs.io/en/latest/?badge=latest)

[![Python](https://img.shields.io/badge/python-3.8%20|%203.9%20|%203.10%20|%203.11|%203.12-blue.svg)](https://www.python.org/downloads/release/python-379/)
[![Python](https://img.shields.io/badge/python-3.9%20|%203.10%20|%203.11%20|%203.12%20|%203.13-blue.svg)](https://www.python.org/downloads/release/python-379/)
[![Documentation Status](https://readthedocs.org/projects/spine-toolbox/badge/?version=latest)](https://spine-toolbox.readthedocs.io/en/latest/?badge=latest)
[![Test suite](https://github.com/spine-tools/Spine-Toolbox/actions/workflows/test_runner.yml/badge.svg)](https://github.com/spine-tools/Spine-Toolbox/actions/workflows/test_runner.yml)
[![codecov](https://codecov.io/gh/spine-tools/Spine-Toolbox/branch/master/graph/badge.svg)](https://codecov.io/gh/spine-tools/Spine-Toolbox)
Expand Down Expand Up @@ -244,7 +244,7 @@ run it, and follow the instructions to install Spine Toolbox.

### About requirements

Python 3.8.1 or later is required. Python 3.8.0 is not supported due to problems in DLL loading on Windows.
Python 3.9 or later is required.

See the files `pyproject.toml` and `requirements.txt` for packages required to run Spine Toolbox.
(Additional packages needed for development are listed in `dev-requirements.txt`.)
Expand Down Expand Up @@ -277,7 +277,7 @@ also [Problems in starting the application](#problems-in-starting-the-applicatio

#### Installation fails

Please make sure you are using Python 3.8.1 or later to install the requirements.
Please make sure you are using Python 3.9 or later to install the requirements.

#### 'No Python' error when installing with pipx

Expand Down Expand Up @@ -317,8 +317,6 @@ The required `qtconsole` package from the ***conda-forge*** channel also
installs `qt` and `PyQt` packages. Since this is a `PySide6` application, those
are not needed and there is a chance of conflicts between the packages.

**Note**: Python 3.8.0 is not supported. Use Python 3.8.1 or later.

## Recorded Webinars showing the use of Spine Tools

### Spine Toolbox: Data, workflow and scenario management for modelling
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ classifiers = [
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: OS Independent",
]
requires-python = ">=3.8.1"
requires-python = ">=3.9"
dependencies = [
"PySide6 >= 6.5.0, != 6.5.3, != 6.6.3, != 6.7.0, != 6.8.0, != 6.8.0.1",
"jupyter_client >=6.0",
Expand Down
12 changes: 0 additions & 12 deletions spinetoolbox/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def main():
)
if not pyside6_version_check():
return 1
_add_pywin32_system32_to_path()
parser = _make_argument_parser()
args = parser.parse_args()
if args.execute_only or args.list_items or args.execute_remotely:
Expand Down Expand Up @@ -98,14 +97,3 @@ def _make_argument_parser():
)
parser.add_argument("--execute-remotely", help="execute remotely", action="append", metavar="SERVER CONFIG FILE")
return parser


def _add_pywin32_system32_to_path():
"""Adds a directory to PATH on Windows that is required to make pywin32 work
on (Conda) Python 3.8. See https://github.com/spine-tools/Spine-Toolbox/issues/1230."""
if sys.platform != "win32":
return
if sys.version_info[0:2] == (3, 8):
p = os.path.join(sys.exec_prefix, "Lib", "site-packages", "pywin32_system32")
if os.path.exists(p):
os.environ["PATH"] = p + ";" + os.environ["PATH"]
9 changes: 4 additions & 5 deletions spinetoolbox/ui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def init_tasks(self, project_dir_from_args):
"""
self._display_welcome_message()
if sys.version_info < (3, 9):
self._display_python_38_deprecation_message()
self._display_deprecated_python_warning()
self.init_project(project_dir_from_args)

def _display_welcome_message(self):
Expand All @@ -455,12 +455,11 @@ def _display_welcome_message(self):
welcome_msg = f"Welcome to Spine Toolbox! If you need help, please read the {getting_started_anchor} guide."
self.msg.emit(welcome_msg)

def _display_python_38_deprecation_message(self):
"""Shows Python 3.8 deprecation message in the event log."""
def _display_deprecated_python_warning(self):
"""Shows a warning message in Event log."""
self.msg_warning.emit("Please upgrade your Python.")
self.msg_warning.emit(
f"Looks like you are running Python {sys.version_info[0]}.{sys.version_info[1]}. "
f"Support for <b>Python older than 3.9 </b> will be dropped in September 2024."
f"Your Python version {sys.version_info[0]}.{sys.version_info[1]} is unsupported. Expect trouble."
)

def init_project(self, project_dir):
Expand Down

0 comments on commit 3cfb27f

Please sign in to comment.