Skip to content

Commit

Permalink
dev: Add support for Python 3.10 and test against 3.10-3.12
Browse files Browse the repository at this point in the history
Python > 3.10 can cause issues with Fluidity which I keep running into.
Angus is on the case, but in the meantime, it wasn't much work to add
support for Python 3.10 (assuming the CI behaves).
  • Loading branch information
adigitoleo committed Apr 17, 2024
1 parent c38091f commit a6af0ec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
install-linux:
name: (Linux) Install package and run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- name: Checkout repository
Expand All @@ -20,7 +23,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ matrix.python-version }}

- name: Install and test
run: |
Expand All @@ -34,6 +37,9 @@ jobs:
install-macos:
name: (MacOS) Install package and run tests
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- name: Checkout repository
Expand All @@ -42,7 +48,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ matrix.python-version }}

- name: Install and test
run: |
Expand All @@ -53,6 +59,9 @@ jobs:
install-windows:
name: (Windows) Install package and run tests
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- name: Checkout repository
Expand All @@ -61,7 +70,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: ${{ matrix.python-version }}

- name: Install and test
run: |
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ name = "pydrex"
dynamic = ["version"] # Managed by setuptools_scm.
description = "Dynamic CPO calculations for olivine-enstatite polycrystal aggregates"
readme = "README.md"
requires-python = ">=3.11" # We use tomllib: <https://docs.python.org/3/library/tomllib.html>.
requires-python = ">=3.10" # We use tomllib on 3.11: <https://docs.python.org/3/library/tomllib.html>.
license = {file = "LICENSE"}
authors = [
{name = "Thomas Duvernay", email = "td75013@hotmail.fr"},
Expand All @@ -33,6 +33,7 @@ classifiers = [
]

dependencies = [
"tomli >= 1.1.0 ; python-version < '3.11'", # https://github.com/hukkin/tomli?tab=readme-ov-file#building-a-tomlitomllib-compatibility-layer
"numpy >= 1.8", # <https://numpy.org/doc/stable/reference/generated/numpy.linalg.eigvalsh.html>
"numba >= 0.57", # <https://numba.readthedocs.io/en/stable/release-notes.html#version-0-57-0-1-may-2023>
"scipy >= 1.2", # <https://github.com/scipy/scipy/pull/9176>
Expand Down
8 changes: 7 additions & 1 deletion src/pydrex/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
import io
import os
import pathlib
import tomllib
import sys

if sys.version_info >= (3, 11):
import tomllib
else:
import tomli as tomllib

from importlib.resources import files

import h5py
Expand Down

0 comments on commit a6af0ec

Please sign in to comment.