Skip to content

Commit

Permalink
Merge pull request #209 from pybop-team/206-support-python-312
Browse files Browse the repository at this point in the history
Add Python 3.12
  • Loading branch information
BradyPlanden authored Feb 21, 2024
2 parents ad9a883 + d8071f2 commit 8561c52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
shell: python

build:
needs: [create_pybamm_matrix]
needs: [create_pybamm_matrix, filter_pybamm_matrix]
name: Build (${{ matrix.os }}, Python ${{ matrix.python_version }}, PyBaMM ${{ matrix.pybamm_version }})
runs-on: ${{ matrix.os }}
strategy:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test_on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude: # We run the coverage tests on Ubuntu with Python 3.11
- os: ubuntu-latest
python-version: "3.11"
Expand All @@ -45,6 +45,8 @@ jobs:
python-version: "3.10"
- os: macos-14
python-version: "3.11"
- os: macos-14
python-version: "3.12"

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pip install -e "path/to/pybop"
To check whether PyBOP has been installed correctly, run one of the examples in the following section. For a development installation, please refer to the [contributing guide](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md#Installation).

### Prerequisites
To use and/or contribute to PyBOP, first install Python (3.8-3.11). On a Debian-based distribution, this looks like:
To use and/or contribute to PyBOP, first install Python (3.8 — 3.12). On a Debian-based distribution, this looks like:

```bash
sudo apt update
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ readme = "README.md"
license = { file = "LICENSE" }
# https://pypi.org/classifiers/
classifiers = []
requires-python = ">=3.8, <3.12"
requires-python = ">=3.8, <3.13"
dependencies = [
"pybamm>=23.5",
"numpy>=1.16",
Expand Down
10 changes: 7 additions & 3 deletions scripts/ci/build_matrix.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

# To update the matrix, the variables below can be modified as needed.

python_version=("3.8" "3.9" "3.10" "3.11")
python_version=("3.8" "3.9" "3.10" "3.11" "3.12")
os=("ubuntu-latest" "windows-latest" "macos-latest")
# This command fetches the last three PyBaMM versions excluding release candidates from PyPI
pybamm_version=($(curl -s https://pypi.org/pypi/pybamm/json | jq -r '.releases | keys[]' | grep -v rc | tail -n 3 | awk '{print "\"" $1 "\"" }' | paste -sd " " -))
pybamm_version=($(curl -s https://pypi.org/pypi/pybamm/json | jq -r '.releases | keys[]' | grep -v rc | tail -n 3 | paste -sd " " -))

# open dict
json='{
Expand All @@ -26,7 +26,7 @@ for py_ver in "${python_version[@]}"; do
json+='{
"os": "'$os_type'",
"python_version": "'$py_ver'",
"pybamm_version": '$pybamm_ver'
"pybamm_version": "'$pybamm_ver'"
},'
done
done
Expand All @@ -40,4 +40,8 @@ json+='
]
}'

# Filter out incompatible combinations
json=$(echo "$json" | jq -c 'del(.include[] | select(.pybamm_version == "23.5" and .python_version == "3.12"))')
json=$(echo "$json" | jq -c 'del(.include[] | select(.pybamm_version == "23.9" and .python_version == "3.12"))')

echo "$json" | jq -c .

0 comments on commit 8561c52

Please sign in to comment.