From 81c852c1610681eaa6d1433bc3aa201f39431164 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Mon, 7 Nov 2022 22:22:47 +0530 Subject: [PATCH 1/7] Support Python 3.10 --- .github/workflows/publish_pypi.yml | 9 --------- .github/workflows/test_on_push.yml | 2 +- docs/source/user_guide/installation/GNU-linux.rst | 4 ++-- .../installation/install-from-source.rst | 4 ++-- docs/source/user_guide/installation/windows.rst | 2 +- setup.py | 15 ++++++++++++++- tox.ini | 1 + 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 22a0ed569d..2ea8e31a01 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -25,15 +25,6 @@ jobs: - name: Clone pybind11 repo (no history) run: git clone --depth 1 --branch v2.6.2 https://github.com/pybind/pybind11.git - # remove when a new vcpkg version is released - - name: Install the latest commit of vcpkg on windows - run: | - cd C:\ - rm -r -fo 'C:\vcpkg' - git clone https://github.com/microsoft/vcpkg - cd vcpkg - .\bootstrap-vcpkg.bat - - name: Cache packages installed through vcpkg on windows uses: actions/cache@v2 env: diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index 3698261630..1aeb04ec56 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -46,7 +46,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.8, 3.9] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 diff --git a/docs/source/user_guide/installation/GNU-linux.rst b/docs/source/user_guide/installation/GNU-linux.rst index e5a73ffc77..5adea5fb58 100644 --- a/docs/source/user_guide/installation/GNU-linux.rst +++ b/docs/source/user_guide/installation/GNU-linux.rst @@ -7,7 +7,7 @@ Prerequisites ============= -To use and/or contribute to PyBaMM, you must have Python 3.8 or 3.9 installed. +To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, or 3.10 installed. To install Python 3 on Debian-based distribution (Debian, Ubuntu, Linux mint), open a terminal and run @@ -46,7 +46,7 @@ User install We recommend to install PyBaMM within a virtual environment, in order not to alter any distribution Python files. -First, make sure you are using Python 3.8 or 3.9. +First, make sure you are using Python 3.8, 3.9, or 3.10. To create a virtual environment ``env`` within your current directory type: .. code:: bash diff --git a/docs/source/user_guide/installation/install-from-source.rst b/docs/source/user_guide/installation/install-from-source.rst index 569351a47b..f6e1665a1a 100644 --- a/docs/source/user_guide/installation/install-from-source.rst +++ b/docs/source/user_guide/installation/install-from-source.rst @@ -25,8 +25,8 @@ or download the source archive on the repository's homepage. To install PyBaMM, you will need: -- Python 3 (PyBaMM supports versions 3.8 and 3.9) -- The Python headers file for your current Python version. +- Python 3 (PyBaMM supports versions 3.8, 3.9, and 3.10) +- The python headers file for your current Python version. - A BLAS library (for instance `openblas `_). - A C compiler (ex: ``gcc``). - A Fortran compiler (ex: ``gfortran``). diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index 399a8e5ea2..6c39889035 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -6,7 +6,7 @@ Windows Prerequisites ------------- -To use and/or contribute to PyBaMM, you must have Python 3.8 or 3.9 installed. +To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, or 3.10 installed. To install Python 3 download the installation files from `Python’s website `__. Make sure to diff --git a/setup.py b/setup.py index 5d4079d062..26d4ee0a71 100644 --- a/setup.py +++ b/setup.py @@ -186,7 +186,20 @@ def compile_KLU(): }, package_data={"pybamm": pybamm_data}, # Python version - python_requires=">=3.8,<3.10", + python_requires=">=3.8,<3.11", + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Scientific/Engineering", + ], # List of dependencies install_requires=[ "numpy>=1.16", diff --git a/tox.ini b/tox.ini index f47e8fa1e5..e83bb80c55 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = {windows}-{tests,unit,dev},tests,unit,dev [testenv] +pip_pre = true skipsdist = true usedevelop = true passenv = !windows-!mac: SUNDIALS_INST From 911194c3b85bb26590c543a6a08fc201629600c2 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 5 Apr 2023 22:37:14 +0530 Subject: [PATCH 2/7] Support for Python 3.11 --- .github/workflows/publish_pypi.yml | 9 +++++++++ .github/workflows/test_on_push.yml | 4 ++-- docs/source/user_guide/installation/GNU-linux.rst | 4 ++-- .../user_guide/installation/install-from-source.rst | 2 +- docs/source/user_guide/installation/windows.rst | 2 +- setup.py | 3 ++- tox.ini | 1 - 7 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 2ea8e31a01..107610ed0d 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -25,6 +25,15 @@ jobs: - name: Clone pybind11 repo (no history) run: git clone --depth 1 --branch v2.6.2 https://github.com/pybind/pybind11.git + # remove when a new vcpkg version is released + - name: Install the latest commit of vcpkg on windows + run: | + cd C:\ + rm -r -fo 'C:\vcpkg' + git clone https://github.com/microsoft/vcpkg + cd vcpkg + .\bootstrap-vcpkg.bat + - name: Cache packages installed through vcpkg on windows uses: actions/cache@v2 env: diff --git a/.github/workflows/test_on_push.yml b/.github/workflows/test_on_push.yml index 1aeb04ec56..c562fff6b4 100644 --- a/.github/workflows/test_on_push.yml +++ b/.github/workflows/test_on_push.yml @@ -46,7 +46,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 @@ -89,7 +89,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: tox -e pybamm-requires - - name: Run unit tests for GNU/Linux with Python 3.8 + - name: Run unit tests for GNU/Linux with Python 3.8, 3.10, and 3.11 if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.9 run: python -m tox -e unit diff --git a/docs/source/user_guide/installation/GNU-linux.rst b/docs/source/user_guide/installation/GNU-linux.rst index 5adea5fb58..8d15c3130a 100644 --- a/docs/source/user_guide/installation/GNU-linux.rst +++ b/docs/source/user_guide/installation/GNU-linux.rst @@ -7,7 +7,7 @@ Prerequisites ============= -To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, or 3.10 installed. +To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, 3.10, or 3.11 installed. To install Python 3 on Debian-based distribution (Debian, Ubuntu, Linux mint), open a terminal and run @@ -46,7 +46,7 @@ User install We recommend to install PyBaMM within a virtual environment, in order not to alter any distribution Python files. -First, make sure you are using Python 3.8, 3.9, or 3.10. +First, make sure you are using Python 3.8, 3.9, 3.10, or 3.11. To create a virtual environment ``env`` within your current directory type: .. code:: bash diff --git a/docs/source/user_guide/installation/install-from-source.rst b/docs/source/user_guide/installation/install-from-source.rst index f6e1665a1a..5937cb11f8 100644 --- a/docs/source/user_guide/installation/install-from-source.rst +++ b/docs/source/user_guide/installation/install-from-source.rst @@ -25,7 +25,7 @@ or download the source archive on the repository's homepage. To install PyBaMM, you will need: -- Python 3 (PyBaMM supports versions 3.8, 3.9, and 3.10) +- Python 3 (PyBaMM supports versions 3.8, 3.9, 3.10, and 3.11) - The python headers file for your current Python version. - A BLAS library (for instance `openblas `_). - A C compiler (ex: ``gcc``). diff --git a/docs/source/user_guide/installation/windows.rst b/docs/source/user_guide/installation/windows.rst index 6c39889035..2f84c3a8a6 100644 --- a/docs/source/user_guide/installation/windows.rst +++ b/docs/source/user_guide/installation/windows.rst @@ -6,7 +6,7 @@ Windows Prerequisites ------------- -To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, or 3.10 installed. +To use and/or contribute to PyBaMM, you must have Python 3.8, 3.9, 3.10, or 3.11 installed. To install Python 3 download the installation files from `Python’s website `__. Make sure to diff --git a/setup.py b/setup.py index 26d4ee0a71..19a53d239f 100644 --- a/setup.py +++ b/setup.py @@ -186,7 +186,7 @@ def compile_KLU(): }, package_data={"pybamm": pybamm_data}, # Python version - python_requires=">=3.8,<3.11", + python_requires=">=3.8,<3.12", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -198,6 +198,7 @@ def compile_KLU(): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Scientific/Engineering", ], # List of dependencies diff --git a/tox.ini b/tox.ini index e83bb80c55..f47e8fa1e5 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ envlist = {windows}-{tests,unit,dev},tests,unit,dev [testenv] -pip_pre = true skipsdist = true usedevelop = true passenv = !windows-!mac: SUNDIALS_INST From c94dcfbaca7c3672a988283897b5f30ec2e4b357 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 5 Apr 2023 22:40:40 +0530 Subject: [PATCH 3/7] Indent YAML block --- .github/workflows/publish_pypi.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 107610ed0d..22a0ed569d 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -26,13 +26,13 @@ jobs: run: git clone --depth 1 --branch v2.6.2 https://github.com/pybind/pybind11.git # remove when a new vcpkg version is released - - name: Install the latest commit of vcpkg on windows - run: | - cd C:\ - rm -r -fo 'C:\vcpkg' - git clone https://github.com/microsoft/vcpkg - cd vcpkg - .\bootstrap-vcpkg.bat + - name: Install the latest commit of vcpkg on windows + run: | + cd C:\ + rm -r -fo 'C:\vcpkg' + git clone https://github.com/microsoft/vcpkg + cd vcpkg + .\bootstrap-vcpkg.bat - name: Cache packages installed through vcpkg on windows uses: actions/cache@v2 From 311d0886190431f53bda3712731c852d583c4272 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Wed, 5 Apr 2023 22:42:31 +0530 Subject: [PATCH 4/7] Unwanted changed --- docs/source/user_guide/installation/install-from-source.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user_guide/installation/install-from-source.rst b/docs/source/user_guide/installation/install-from-source.rst index 5937cb11f8..e3b5e8de85 100644 --- a/docs/source/user_guide/installation/install-from-source.rst +++ b/docs/source/user_guide/installation/install-from-source.rst @@ -26,7 +26,7 @@ or download the source archive on the repository's homepage. To install PyBaMM, you will need: - Python 3 (PyBaMM supports versions 3.8, 3.9, 3.10, and 3.11) -- The python headers file for your current Python version. +- The Python headers file for your current Python version. - A BLAS library (for instance `openblas `_). - A C compiler (ex: ``gcc``). - A Fortran compiler (ex: ``gfortran``). From a4aa1d78585116b8fd3983fcf96f97233321caaa Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Thu, 6 Apr 2023 18:29:42 +0530 Subject: [PATCH 5/7] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27b39d9534..02f3c70d5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # Features +- PyBaMM now support Python 3.10 and 3.11 ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435)) - Updated to casadi 3.6, which required some changes to the casadi integrator. ([#2859](https://github.com/pybamm-team/PyBaMM/pull/2859)) ## Bug fixes From bfb48b356fbe7c1c8fb2866bb053252d2247ee25 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Fri, 7 Apr 2023 13:46:03 +0530 Subject: [PATCH 6/7] Depend on casadi>=3.6 --- docs/requirements.txt | 2 +- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index b37de07bb5..672a1be504 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,7 +5,7 @@ pandas >= 0.24 anytree >= 2.4.3 autograd >= 1.2 scikit-fem >= 0.2.0 -casadi >= 3.5.0 +casadi >= 3.6.0 imageio>=2.9.0 jupyter # For example notebooks pybtex diff --git a/requirements.txt b/requirements.txt index 665b774938..d2914dc801 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ pandas >= 0.24 anytree >= 2.4.3 autograd >= 1.2 scikit-fem >= 0.2.0 -casadi >= 3.5.0 +casadi >= 3.6.0 imageio>=2.9.0 pybtex>=0.24.0 sympy >= 1.8 diff --git a/setup.py b/setup.py index 19a53d239f..110b530718 100644 --- a/setup.py +++ b/setup.py @@ -209,7 +209,7 @@ def compile_KLU(): "anytree>=2.4.3", "autograd>=1.2", "scikit-fem>=0.2.0", - "casadi>=3.5.0", + "casadi>=3.6.0", "imageio>=2.9.0", "importlib-metadata", "pybtex>=0.24.0", From c714f599bf597a1a192143e4e34228f1b77a7ae4 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Fri, 7 Apr 2023 14:41:16 +0530 Subject: [PATCH 7/7] CHANGELOG for Macs --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02f3c70d5b..8e7fe5dc78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ # Features -- PyBaMM now support Python 3.10 and 3.11 ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435)) +- PyBaMM is now natively supported on Apple silicon chips (`M1/M2`) ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435)) +- PyBaMM is now supported on Python `3.10` and `3.11` ([#2435](https://github.com/pybamm-team/PyBaMM/pull/2435)) - Updated to casadi 3.6, which required some changes to the casadi integrator. ([#2859](https://github.com/pybamm-team/PyBaMM/pull/2859)) ## Bug fixes