Skip to content

Commit

Permalink
Merge branch 'master' into issue_2794
Browse files Browse the repository at this point in the history
# Fixed conflicts in:
#	spinetoolbox/resources_icons_rc.py
#	spinetoolbox/ui/mainwindow.py
#	spinetoolbox/ui/mainwindow.ui
#	spinetoolbox/ui_main.py
#	spinetoolbox/widgets/custom_qtextbrowser.py
#	tests/mock_helpers.py
#	tests/test_SpineToolboxProject.py
#	tests/test_ToolboxUI.py
  • Loading branch information
ptsavol committed Nov 19, 2024
2 parents cc91082 + a90b8aa commit 89ffdf4
Show file tree
Hide file tree
Showing 131 changed files with 2,235 additions and 1,627 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/execution_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Execution tests

on:
workflow_call:
inputs:
host-os:
required: true
type: string
python-version:
required: true
type: string
repository:
required: false
type: string
default: ${{ github.repository }}
post-installation-command:
required: false
type: string
default: ""
secrets:
CODECOV_TOKEN:
required: true

jobs:
execution-tests:
name: Run execution tests
runs-on: ${{ inputs.host-os }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
dev-requirements.txt
- name: Install additional packages for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libegl1
- name: Install dependencies
env:
PYTHONUTF8: 1
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r dev-requirements.txt
- name: Run post-install command
if: ${{ inputs.post-installation-command }}
run:
${{ inputs.post-installation-command }}
- name: Run tests
run:
python -m unittest discover --pattern execution_test.py --verbose
94 changes: 14 additions & 80 deletions .github/workflows/test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,93 +12,27 @@ on:
- "execution_tests/**"

jobs:
unit-tests:
call-unit-tests:
name: Unit tests
runs-on: ${{ matrix.os }}
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"]
os: [windows-latest, ubuntu-22.04]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Version from Git tags
run: git describe --tags
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
dev-requirements.txt
- name: Display Python version
run:
python -c "import sys; print(sys.version)"
- name: Install additional packages for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libegl1
- name: Install dependencies
env:
PYTHONUTF8: 1
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: Run tests
run: |
if [ "$RUNNER_OS" != "Windows" ]; then
export QT_QPA_PLATFORM=offscreen
fi
coverage run -m unittest discover --verbose
shell: bash
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
execution-tests:
uses: ./.github/workflows/unit_tests.yml
with:
host-os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
secrets: inherit
call-execution-tests:
name: Execution tests
runs-on: ${{ matrix.os }}
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"]
os: [windows-latest, ubuntu-22.04]
# needs: unit-tests
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
dev-requirements.txt
- name: Install additional packages for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libegl1
- name: Install dependencies
env:
PYTHONUTF8: 1
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: Run tests
run:
python -m unittest discover --pattern execution_test.py --verbose
uses: ./.github/workflows/execution_tests.yml
with:
host-os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
secrets: inherit
75 changes: 75 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Unit tests

on:
workflow_call:
inputs:
host-os:
required: true
type: string
python-version:
required: true
type: string
repository:
required: false
type: string
default: ${{ github.repository }}
coverage:
required: false
type: boolean
default: true
post-installation-command:
required: false
type: string
default: ""
secrets:
CODECOV_TOKEN:
required: true

jobs:
unit-tests:
name: Run unit tests
runs-on: ${{ inputs.host-os }}
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
fetch-depth: 0
- name: Version from Git tags
run: git describe --tags
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
dev-requirements.txt
- name: Install additional packages for Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libegl1
- name: Install dependencies
env:
PYTHONUTF8: 1
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r dev-requirements.txt
- name: Run post-install command
if: ${{ inputs.post-installation-command }}
run:
${{ inputs.post-installation-command }}
- name: Run tests
run: |
if [ "$RUNNER_OS" != "Windows" ]; then
export QT_QPA_PLATFORM=offscreen
fi
${{ inputs.coverage && 'coverage run' || 'python' }} -m unittest discover --verbose
shell: bash
- name: Upload coverage report to Codecov
if: ${{ inputs.coverage }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
50 changes: 49 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Changelog
All **notable** changes to this project are documented here.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)

## [Unreleased]

Expand All @@ -13,8 +13,56 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

### Removed

- The Filter button has been removed from Spine Database Editor's toolbar.
The functionality was broken anyhow and has been superseded by filtering from the Scenario tree.

### Fixed

### Security

## [0.9.1]

### Changed

- **Add/Update SpineOpt** wizard in **File->Settings->Tools** now installs SpineOpt v0.9.0
from Julia's General Registry. Previously SpineOpt was installed from a custom
SpineJuliaRegistry registry.

### Removed

- Removed support for MSSQL dialect. It did not work anyway.

## [0.9.0]

Dropped support for Python 3.8.
This version of Spine Toolbox requires Python version from 3.9 to 3.12.

### Changed

- **Add/Update SpineOpt** wizard in **File->Settings->Tools** now requires SpineOpt v0.8.3 or higher.

## [0.8.5]

### Changed

- Execution button shortcuts have been changed because F5 is traditionally reserved for refreshing.
The shortcuts are now:

- **Shift+F9** to execute project
- **F9** to execute selection
- **F10** to stop execution

### Fixed

- Fixed a bug where scenario filters could cause Tracebacks in tools that were using ``spinedb_api``.

## [0.8.4]

### Changed

- ``gamsapi`` replaced the ancient ``gdxcc`` package.
You may need to have a relatively recent GAMS installed to utilize .gdx import/export functionalities.

## [0.8.3]

### Added
Expand Down
13 changes: 6 additions & 7 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-blue.svg)](https://www.python.org/downloads/release/python-3120/)
[![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 @@ -51,6 +51,7 @@ These steps apply to both [Python/pipx](#installation-with-python-and-pipx) opti

1. If you don't have Python installed, please install it e.g. from
[Python.org](https://www.python.org/downloads/).
Please note that we support Python versions from 3.9 to 3.12. (As of 21st Oct. 2024, Python 3.13 has issues with some of our dependencies)

2. Test that python is now in your PATH. Open a new terminal (e.g. Command Prompt) window and type

Expand Down Expand Up @@ -145,10 +146,10 @@ anywhere on your system. <br><br>
Optional: Instead of venv, one can also use a
[miniconda](https://docs.conda.io/projects/conda/en/stable/glossary.html#miniconda-glossary) environment.
You can [download miniconda from here](https://docs.conda.io/en/latest/miniconda.html). **Note: Anaconda
environments are not supported.** Create a new Python 3.11 miniconda environment without linking packages from the
environments are not supported.** Create a new Python 3.12 (check the supported Python versions above) miniconda environment without linking packages from the
base environment using

conda create -n spinetoolbox python=3.11
conda create -n spinetoolbox python=3.12

4. Activate the venv environment on Windows (provided that you are in `Spine-Toolbox` directory) using

Expand Down Expand Up @@ -244,7 +245,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 (check above for supported Python versions).

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 +278,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 (check above for supported Python versions).

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

Expand Down Expand Up @@ -317,8 +318,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
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ classifiers = [
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Operating System :: OS Independent",
]
requires-python = ">=3.8.1"
requires-python = ">=3.9, <3.13"
dependencies = [
"PySide6 >= 6.5.0, != 6.5.3, != 6.6.3, != 6.7.0",
"PySide6 >= 6.5.0, != 6.5.3, != 6.6.3, != 6.7.0, < 6.8",
"jupyter_client >=6.0",
"qtconsole >=5.1",
"spinedb_api>=0.31.3",
"spine_engine>=0.24.2",
"spinedb_api>=0.32.1",
"spine_engine>=0.25.0",
"numpy >=1.20.2",
"matplotlib >= 3.5",
"scipy >=1.7.1",
Expand All @@ -26,7 +26,7 @@ dependencies = [
"Pygments >=2.8",
"jill >=0.9.2",
"pyzmq >=21.0",
"spine_items>=0.22.3",
"spine_items>=0.23.1",
]

[project.urls]
Expand Down
Loading

0 comments on commit 89ffdf4

Please sign in to comment.