From 3e4d31ef14b9ee22f42bcad32ad53212de8ee6a4 Mon Sep 17 00:00:00 2001 From: Bob Myhill Date: Sat, 11 Oct 2025 20:14:06 +0100 Subject: [PATCH 1/2] enable python 3.14 --- Readme.md | 2 +- burnman/__init__.py | 2 +- burnman/classes/material.py | 43 ++----------------------------------- pyproject.toml | 10 ++++++--- 4 files changed, 11 insertions(+), 46 deletions(-) diff --git a/Readme.md b/Readme.md index 8a511740a..8c5fa9761 100644 --- a/Readme.md +++ b/Readme.md @@ -53,7 +53,7 @@ If you use BurnMan in your work, we ask that you cite the following publications ## Installation requirements -* Python 3.8+ +* Python 3.10+ * Python modules: NumPy, SciPy, SymPy, Matplotlib diff --git a/burnman/__init__.py b/burnman/__init__.py index 1ec064aa6..0e0f8604e 100644 --- a/burnman/__init__.py +++ b/burnman/__init__.py @@ -81,7 +81,7 @@ Requirements ------------ - - Python 3.8+ + - Python 3.10+ - Python modules: NumPy, SciPy, SymPy, Sparse, Matplotlib Optional modules diff --git a/burnman/classes/material.py b/burnman/classes/material.py index a5adb563e..923c9aac7 100644 --- a/burnman/classes/material.py +++ b/burnman/classes/material.py @@ -7,48 +7,9 @@ from copy import deepcopy from ..utils.math import bracket from scipy.optimize import brentq +from functools import cached_property - -# TODO: When we require Python 3.8+, replace with -# functools.cached_property decorator -class cached_property(property): - """A decorator that converts a function into a lazy property. The - function wrapped is called the first time to retrieve the result - and then that calculated result is used the next time you access - the value:: - - class Foo(object): - - @cached_property - def foo(self): - # calculate something important here - return 42 - - The class has to have a `__dict__` in order for this property to - work. - - This decorator is adapted slightly from the one in the werkzeug module: - https://tedboy.github.io/flask/_modules/werkzeug/utils.html#cached_property - """ - - def __init__(self, func, name=None, doc=None): - self.__name__ = name or func.__name__ - self.__module__ = func.__module__ - self.__doc__ = doc or func.__doc__ - self.func = func - - def __set__(self, obj, value): - obj.__dict__[self.__name__] = value - - def __get__(self, obj, type=None): - if obj is None: - return self - try: - value = obj.__dict__[self.__name__] - except KeyError: - value = self.func(obj) - obj.__dict__[self.__name__] = value - return value +cached_property = cached_property # for easier access def material_property(func): diff --git a/pyproject.toml b/pyproject.toml index e0bfe88f4..b91e6a26a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,23 +11,27 @@ documentation = "https://burnman.readthedocs.io/" classifiers = [ "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.10" numpy = "^2" scipy = "^1.10" sympy = "^1.12" cvxpy = "^1.3" matplotlib = "^3.7" -numba = ">=0.59,^0" +numba = [ + { version = ">=0.59,^0", python = "<3.14" }, + { version = ">=0.63.0b1", python = ">=3.14" } +] pycddlib-standalone = {version = "^3.0", optional = true} + [tool.poetry.dev-dependencies] ipython = "^8.5" numba = ">=0.59,^0" From 8c70eb63f8206c90a56f8be03ed6fdf67d256373 Mon Sep 17 00:00:00 2001 From: Bob Myhill Date: Sat, 11 Oct 2025 20:16:48 +0100 Subject: [PATCH 2/2] workflow python version bump --- .github/workflows/coverage.yml | 2 +- .github/workflows/main.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3e99789b5..cea3eac0f 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - python-versions: ['3.12'] + python-versions: ['3.13'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd921a120..6258ad423 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-versions: ['3.12'] + python-versions: ['3.13'] steps: - uses: actions/checkout@v4 @@ -38,7 +38,7 @@ jobs: strategy: matrix: - python-versions: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-versions: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@v4 @@ -65,7 +65,7 @@ jobs: strategy: matrix: - python-versions: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-versions: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@v4