Skip to content

Commit c84129d

Browse files
committed
Add support for python3.14, drop support for 3.9 and 3.10
1 parent 308a677 commit c84129d

9 files changed

Lines changed: 27 additions & 38 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest, macos-latest, windows-latest]
1818
# Test with the earliest and the latest python versions supported
19-
python-version: ["3.9", "3.13"]
19+
python-version: ["3.11", "3.14"]
2020

2121
steps:
2222
- uses: actions/checkout@v6
@@ -40,7 +40,7 @@ jobs:
4040
--cov-report=xml
4141
4242
- name: Upload coverage to Codecov
43-
if: success() && (github.event_name == 'push' && runner.os == 'Linux' && matrix.python-version == 3.9)
43+
if: success() && (github.event_name == 'push' && runner.os == 'Linux' && matrix.python-version == 3.11)
4444
uses: codecov/codecov-action@v5
4545
with:
4646
fail_ci_if_error: true
@@ -59,7 +59,7 @@ jobs:
5959
matrix:
6060
os: [ubuntu-latest, macos-latest, windows-latest]
6161
# Test with the earliest and the latest python versions supported
62-
python-version: ["3.9", "3.13"]
62+
python-version: ["3.11", "3.14"]
6363

6464
steps:
6565
- uses: actions/checkout@v6

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v6
1515
with:
16-
python-version: 3.13
16+
python-version: 3.14
1717
- name: Install dependencies
1818
run: |
1919
sudo apt update -y

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
fail-fast: false
8686
matrix:
8787
os: [windows-latest]
88-
python-version: ["3.9"]
88+
python-version: ["3.11"]
8989

9090
steps:
9191
- uses: actions/checkout@v6

.github/workflows/regression_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
1313
# Test with the earliest and the latest python versions supported
14-
python-version: ["3.9", "3.13"]
14+
python-version: ["3.11", "3.14"]
1515

1616
steps:
1717
- uses: actions/checkout@v6

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-20.04
1111
tools:
12-
python: "3.9"
12+
python: "3.11"
1313
apt_packages:
1414
- graphviz
1515
- pandoc

docs/installation/pipx-based.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pipx-based installation
66
To help you installing MUSE in your system we will follow these steps:
77

88
- `Launching a terminal`_: Needed to both install and run MUSE.
9-
- `Installing a compatible Python version`_: MUSE works with Python 3.9 to 3.13.
9+
- `Installing a compatible Python version`_: MUSE works with Python 3.11 to 3.14.
1010
- `Installing pipx`_: A Python application manager that facilitates installing, keeping applications updated and run them in their own isolated environments.
1111
- `Installing MUSE itself`_
1212

@@ -22,8 +22,8 @@ In the following sections, we will guide you step by step in configuring your sy
2222

2323
.. code-block::
2424
25-
pyenv install 3.9.13
26-
pyenv shell 3.9.13
25+
pyenv install 3.11.0
26+
pyenv shell 3.11.0
2727
python -m pip install pipx
2828
python -m pipx ensurepath
2929
python -m pipx install muse-os
@@ -67,7 +67,7 @@ Once you have launched the Terminal, the window that opens will show the command
6767
Installing a compatible Python version
6868
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6969

70-
MUSE needs Python to run and it works with versions 3.9 to 3.13, so the next step is to install a suitable version of Python.
70+
MUSE needs Python to run and it works with versions 3.11 to 3.14, so the next step is to install a suitable version of Python.
7171

7272
.. note::
7373

@@ -92,7 +92,7 @@ The first thing will be to check if you already have a suitable python version i
9292
9393
python --version
9494
95-
If the output is ``Python 3.Y.X`` or ``Python 3.Y.X``, where ``X`` is any number and ``Y`` is 9, 10, 11 or 12, then **you have a version of Python compatible with MUSE and you can skip this section altogether**. Move to `Installing pipx`_. In any other case, keep reading.
95+
If the output is ``Python 3.Y.X`` or ``Python 3.Y.X``, where ``X`` is any number and ``Y`` is 11, 12, 13 or 14, then **you have a version of Python compatible with MUSE and you can skip this section altogether**. Move to `Installing pipx`_. In any other case, keep reading.
9696

9797
There are multiple ways of installing Python, as well as multiple distributions. Here we have opted for the one that we believe is simplest, requires the smallest downloads and gives the maximum flexibility: using ``pyenv``.
9898

@@ -189,38 +189,38 @@ With ``pyenv`` installed and correctly configured, it is now easy to install any
189189
190190
pyenv install -l
191191
192-
You should see a long list of versions to choose from. Let's install one of the later versions of the 3.9 family:
192+
You should see a long list of versions to choose from. Let's install 3.11.0 as an example:
193193

194194
.. code-block:: bash
195195
196-
pyenv install 3.9.13
196+
pyenv install 3.11.0
197197
198198
The command will take a minute or two to complete, depending on your internet connection, and show an output similar to the following (this is an example from Windows):
199199

200200
.. code-block:: output
201201
202202
:: [Info] :: Mirror: https://www.python.org/ftp/python
203-
:: [Downloading] :: 3.9.13 ...
204-
:: [Downloading] :: From https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe
205-
:: [Downloading] :: To C:\Users\your_username\.pyenv\pyenv-win\install_cache\python-3.9.13-amd64.exe
206-
:: [Installing] :: 3.9.13 ...
207-
:: [Info] :: completed! 3.9.13
203+
:: [Downloading] :: 3.11.0 ...
204+
:: [Downloading] :: From https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe
205+
:: [Downloading] :: To C:\Users\your_username\.pyenv\pyenv-win\install_cache\python-3.11.0-amd64.exe
206+
:: [Installing] :: 3.11.0 ...
207+
:: [Info] :: completed! 3.11.0§
208208
209209
Now, we have a new Python version in our system, but it is still not available (if you run ``python --version`` you will get the same result as before). There are two options moving forward:
210210

211211
- If you want to set it as the global python version, available system wide (only do this if you really want to set is as your main Python!) run:
212212

213213
.. code-block:: bash
214214
215-
pyenv global 3.9.13
215+
pyenv global 3.11.0
216216
217217
- If you just want it momentarily to install MUSE run instead the following command:
218218

219219
.. code-block:: bash
220220
221-
pyenv shell 3.9.13
221+
pyenv shell 3.11.0
222222
223-
In both cases, if you run ``python --version`` afterwards, you should get ``Python 3.9.13``.
223+
In both cases, if you run ``python --version`` afterwards, you should get ``Python 3.11.0``.
224224

225225
Installing ``pipx``
226226
~~~~~~~~~~~~~~~~~~~

docs/installation/virtual-env-based.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To create an environment called ``muse_env`` run:
3434

3535
.. code-block:: bash
3636
37-
conda create -n muse_env python=3.9
37+
conda create -n muse_env python=3.11
3838
3939
Now, you can activate the environment with:
4040

@@ -95,7 +95,7 @@ Creating a virtual environment with ``pyenv + venv``
9595

9696
Alternatively to creating virtual environments in ``conda``, you can also make use of two well-tested and maintained libraries.
9797
We met the first one, ``pyenv``, already in the :ref:`pipx-based <pipx-based>` under the section :ref:`Installing pyenv <pipx-based-installing-pyenv>` and the installation procedure is exactly the same.
98-
If you go down that route, please follow the steps outlined there and chose a recent version ``Python``, say 3.9.
98+
If you go down that route, please follow the steps outlined there and chose a recent version ``Python``, say 3.13.
9999

100100
The second package we need to create virtual environments for any specific ``Python`` version is called
101101
``venv``, and it ships with ``Python`` by default. To create such an environment, we first need to ensure that the

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ name = "MUSE_OS"
1111
description = "Energy System Model"
1212
readme = "README.md"
1313
license = {file = "LICENSE"}
14-
requires-python = ">= 3.9, <3.14"
14+
requires-python = ">= 3.11, <3.15"
1515
keywords = ["energy", "modelling"]
1616
classifiers = [
1717
"Development Status :: 4 - Beta",
18-
"Programming Language :: Python :: 3.9",
19-
"Programming Language :: Python :: 3.10",
2018
"Programming Language :: Python :: 3.11",
2119
"Programming Language :: Python :: 3.12",
2220
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: Python :: 3.14",
2322
"Intended Audience :: Science/Research",
2423
"Intended Audience :: Other Audience",
2524
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)"

tests/conftest.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def drop_optionals(settings):
524524

525525
@fixture(autouse=True)
526526
def warnings_as_errors(request):
527-
from warnings import filterwarnings, simplefilter
527+
from warnings import simplefilter
528528

529529
# disable fixture for some tests
530530
if (
@@ -538,16 +538,6 @@ def warnings_as_errors(request):
538538
simplefilter("error", DeprecationWarning)
539539
simplefilter("error", PendingDeprecationWarning)
540540

541-
# The following warning is safe to ignore (raised by adhoc solver with Python 3.9)
542-
# TODO: may be able to remove this once support for Python 3.9 is dropped
543-
if request.module.__name__ == "test_fullsim_regression":
544-
filterwarnings(
545-
"ignore",
546-
message="__array__ implementation doesn't accept a copy keyword",
547-
category=DeprecationWarning,
548-
module="xarray.core.variable",
549-
)
550-
551541

552542
@fixture
553543
def save_registries():

0 commit comments

Comments
 (0)