Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pyproject.toml #3301

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
7d4c8cf
#3049 initial draft: metadata, dependencies, extras, entry points
agriyakhetarpal Aug 30, 2023
aca9a6a
#3049 Fix LICENSE spelling
agriyakhetarpal Aug 30, 2023
3af5092
#3049 Temporarily build wheels on pull requests
agriyakhetarpal Aug 30, 2023
8768ed7
#3049 Add CMakeBuild steps to `setup.py` instead of importing it
agriyakhetarpal Aug 30, 2023
66e9302
#3049 Temporarily install `casadi` before installing editable
agriyakhetarpal Aug 30, 2023
8b6a184
#3049 Better error message if `casadi` path is not found
agriyakhetarpal Aug 30, 2023
3bec0ba
#3049 Rename wheel build workflow name
agriyakhetarpal Aug 30, 2023
bfafc75
#3049 Temporarily use `--no-build-isolation` in CI
agriyakhetarpal Aug 30, 2023
f4d148a
#3049 add `cmake` to build-system requirements
agriyakhetarpal Aug 30, 2023
60caf0b
Revert "#3049 add `cmake` to build-system requirements"
agriyakhetarpal Aug 30, 2023
d8d6194
#3049 Clarify author emails
agriyakhetarpal Aug 31, 2023
bdd191e
#3049 clarify idaklu attributes (`setuptools` API)
agriyakhetarpal Aug 31, 2023
9f0f250
#3049 Specify `casadi` as a build-time dependency to overcome venv is…
agriyakhetarpal Aug 31, 2023
1e480ee
Revert "#3049 Temporarily use `--no-build-isolation` in CI"
agriyakhetarpal Aug 31, 2023
c2e2734
#3049 Remove `casadi` installation prior to editable
agriyakhetarpal Aug 31, 2023
2cd36af
#3049 specify `cmake`, fix `casadi` build-time requirements
agriyakhetarpal Aug 31, 2023
0cdfd5a
#3049 Fix doctests, trigger example notebook tests
agriyakhetarpal Aug 31, 2023
fc222ca
#3049 Remove non-colour `nox` output in the CI
agriyakhetarpal Aug 31, 2023
5cfc07a
#3049 Force colour output on GitHub Actions
agriyakhetarpal Aug 31, 2023
82197eb
#3049 Remove inessential editable install job in favour of `nox`
agriyakhetarpal Aug 31, 2023
13ed52d
#3049 Remove improper CMake message, add for macOS
agriyakhetarpal Sep 1, 2023
24fbb8f
#3049 Fix installation link
agriyakhetarpal Sep 2, 2023
2561a6e
#3049 Remove casadi rpath fix because its shared object cannot be found
agriyakhetarpal Sep 2, 2023
921010e
#3049 Remove `cmake` from macOS in CI
agriyakhetarpal Sep 2, 2023
1ee48c1
Revert "#3049 Remove casadi rpath fix because its shared object canno…
agriyakhetarpal Sep 3, 2023
e4ea199
#3049 Fix macOS universal ABI and platform wheels creation bug
agriyakhetarpal Sep 3, 2023
a91885a
#3049 Add a Fortran compiler via Homebrew
agriyakhetarpal Sep 3, 2023
ab246c6
#3049 Install optional solvers for macOS `nox` sessions
agriyakhetarpal Sep 3, 2023
60ac7bf
#3049 Add remaining `pybamm-requires` caches
agriyakhetarpal Sep 3, 2023
95d72e5
#3049 Fix failing doctests
agriyakhetarpal Sep 3, 2023
5dae55f
#3049 Speed up solvers installation without extras
agriyakhetarpal Sep 3, 2023
4c53cc5
#3049 Cleanup scheduled tests workflow
agriyakhetarpal Sep 3, 2023
0c611d9
#3049 Remove dependence on deprecated `pkg_resources`
agriyakhetarpal Sep 3, 2023
82082f2
#3049 Improvements to scheduled test workflow
agriyakhetarpal Sep 3, 2023
ee4080f
#3049 Remove separate CMakeBuild file
agriyakhetarpal Sep 3, 2023
f2a8724
#3049 Add configuration for package data files
agriyakhetarpal Sep 3, 2023
4a3a03c
#3049 Check links in `toml`, `yaml`, and `json` files
agriyakhetarpal Sep 4, 2023
7c64841
#3049 clean up some project configuration options
agriyakhetarpal Sep 4, 2023
2e332b5
#3049, #3249, #2881 Update version in `pyproject.toml`
agriyakhetarpal Sep 4, 2023
b51bea7
Clean up PyPI publishing workflow jobs
agriyakhetarpal Sep 6, 2023
378eed1
Add rpath config for `casadi` directory
agriyakhetarpal Sep 6, 2023
324c316
#3049 Add gcc reinstall step again otherwise Fortran compiler is not …
agriyakhetarpal Sep 6, 2023
5976ec3
#3049 Fix cibuildwheel job
agriyakhetarpal Sep 7, 2023
8d88f5b
#3049 Revert "Add rpath config for `casadi` directory"
agriyakhetarpal Sep 7, 2023
91efeab
#3049 Fix `gcc`/`gfortran` installation (Homebrew)
agriyakhetarpal Sep 7, 2023
fd0c1a5
#3049 Copy `libcasadi.3.7.dylib` to `LD_LIBRARY_PATH`
agriyakhetarpal Sep 11, 2023
e7dd32a
#3049 Add `libc++.1.0.dylib` as well
agriyakhetarpal Sep 11, 2023
8388ac6
#3049 Refactor casadi lib rpaths
agriyakhetarpal Sep 11, 2023
cbba6b9
Update link checker with job summary
agriyakhetarpal Sep 11, 2023
9432e61
#3049 Run rpath fixes on macOS and Linux
agriyakhetarpal Sep 12, 2023
c099385
#3049 Add repair script to cibuildwheel
agriyakhetarpal Sep 12, 2023
3502303
#3049 Fix casadi rpath on macOS
agriyakhetarpal Sep 12, 2023
51db35f
#3049 try to move casadi shared objects to local path
agriyakhetarpal Sep 12, 2023
78bff9a
#3049 fix copying script for Linux
agriyakhetarpal Sep 12, 2023
cc07fc4
#3049 fix LD_LIBRARY_PATH for `nox`
agriyakhetarpal Sep 28, 2023
1e164ae
#3049 add custom wheel repair command for Linux
agriyakhetarpal Sep 28, 2023
587c3bd
Merge changes from develop
agriyakhetarpal Sep 28, 2023
f30d372
#3049 remove Linux rpath fix script
agriyakhetarpal Sep 28, 2023
c069e44
#3049 Add MSMR parameters entry point
agriyakhetarpal Sep 28, 2023
4bf4537
Set up MANIFEST.in
agriyakhetarpal Sep 28, 2023
1c20274
#3049 some installation cleanups (`nox`)
agriyakhetarpal Sep 28, 2023
ddac82e
#3049 #3121 sync jax, jaxlib version requirements
agriyakhetarpal Sep 28, 2023
8016c71
#3049 Improve docs about project installation infrastructure
agriyakhetarpal Sep 28, 2023
9307ee4
#3049 Update cache hashes to include `nox` changes
agriyakhetarpal Sep 28, 2023
3720f04
#3049 temporarily skip i686 Linux builds
agriyakhetarpal Sep 28, 2023
aa86d72
#3049 Fix UNKNOWN name error on SDist
agriyakhetarpal Sep 28, 2023
588496f
#3049 keep solvers extras in sync, don't install yanked versions
agriyakhetarpal Oct 1, 2023
d0b425f
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Oct 1, 2023
690b814
#3049 Fix up authors name and email in project
agriyakhetarpal Oct 1, 2023
2d6e302
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Oct 2, 2023
b18d666
Cleanup extras list, resolve conflicts
agriyakhetarpal Oct 2, 2023
a91c87b
#3049 add `pipx` for doctests job
agriyakhetarpal Oct 2, 2023
14c3c61
#3049 try to bump `pybind11`, `vcpkg` versions (Windows)
agriyakhetarpal Oct 5, 2023
df2c212
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Oct 5, 2023
30d76cd
#3049 add OKane2022 parameter entry points
agriyakhetarpal Oct 5, 2023
5c18e22
#3049 correctly specify inclusion of packages
agriyakhetarpal Oct 6, 2023
c016a64
#3049 Remove unneeded files (used for old manylinux)
agriyakhetarpal Oct 7, 2023
b70e0a6
#3049 move SUNDIALS installation to `scripts/`
agriyakhetarpal Oct 7, 2023
5583d01
#3049 delete older SUNDIALS CMake files
agriyakhetarpal Oct 7, 2023
f2c0c64
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Oct 17, 2023
45b85a7
#3049 add `pyproject.toml` to release workflows
agriyakhetarpal Oct 17, 2023
37c991d
#3049 remove `setup.py` as CI cache dependency path
agriyakhetarpal Oct 17, 2023
925d390
#3049 add note about new file to manage deps
agriyakhetarpal Oct 17, 2023
1d16f5d
#3049 clarify usage of `cmake` and `casadi`
agriyakhetarpal Oct 17, 2023
15c4a8b
#3049 update version to 23.9rc0
agriyakhetarpal Oct 17, 2023
39ee77b
#3049 make cmake a bit verbose about sundials and suitesparse
agriyakhetarpal Oct 17, 2023
449bf02
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Oct 21, 2023
62ed4c4
#3049 add suggestions from code review
agriyakhetarpal Oct 21, 2023
db91a88
#3049 clarify extension language
agriyakhetarpal Oct 21, 2023
0768609
#3049 include citation file in source distribution
agriyakhetarpal Oct 21, 2023
f56e366
#3049 remove note about requirements.txt
agriyakhetarpal Oct 21, 2023
e311029
#3049 fix docs indentation
agriyakhetarpal Oct 21, 2023
052a163
#3049 specify lower bounds for `setuptools`
agriyakhetarpal Oct 21, 2023
5e587c0
#3049 cleanup and clarify user installation page
agriyakhetarpal Oct 21, 2023
3b00b18
#3049 fix whitespace in `pybamm-requires` session
agriyakhetarpal Oct 21, 2023
b49b6f3
#3049 code review suggestions from Eric
agriyakhetarpal Oct 21, 2023
e838fb5
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Nov 20, 2023
09c4942
Bump new minimum versions of dependencies
agriyakhetarpal Nov 20, 2023
cfc550b
A sentence about package data and extra files
agriyakhetarpal Nov 20, 2023
7537c73
Merge branch 'develop' into pyproject-toml-migration
agriyakhetarpal Nov 20, 2023
0aa469b
Install `nox` with `pip` instead of `pipx`
agriyakhetarpal Nov 20, 2023
8e91218
Remove `brew update` from wheels and disable wheels on PRs
agriyakhetarpal Nov 20, 2023
f1fd05f
Update version to 23.9
agriyakhetarpal Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/release_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This file contains the workflow required to make a `PyBaMM` release on GitHub, P
- `pybamm/version.py`
- `docs/conf.py`
- `CITATION.cff`
- `pyproject.toml`
- `vcpkg.json`
- `docs/_static/versions.json`
- `CHANGELOG.md`
Expand All @@ -32,6 +33,7 @@ If a new release candidate is required after the release of `rc0` -
- `pybamm/version.py`
- `docs/conf.py`
- `CITATION.cff`
- `pyproject.toml`
- `vcpkg.json`
- `docs/_static/versions.json`
- `CHANGELOG.md`
Expand All @@ -53,6 +55,7 @@ Once satisfied with the release candidates -
- `pybamm/version.py`
- `docs/conf.py`
- `CITATION.cff`
- `pyproject.toml`
- `vcpkg.json`
- `docs/_static/versions.json`
- `CHANGELOG.md`
Expand All @@ -70,7 +73,7 @@ Once satisfied with the release candidates -
Some other essential things to check throughout the release process -

- If updating our custom vcpkg registory entries [pybamm-team/sundials-vcpkg-registry](https://github.com/pybamm-team/sundials-vcpkg-registry) or [pybamm-team/casadi-vcpkg-registry](https://github.com/pybamm-team/casadi-vcpkg-registry) (used to build Windows wheels), make sure to update the baseline of the registories in vcpkg-configuration.json to the latest commit id.
- Update jax and jaxlib to the latest version in `pybamm.util` and `setup.py`, fixing any bugs that arise
- Update jax and jaxlib to the latest version in `pybamm.util` and `pyproject.toml`, fixing any bugs that arise
- Make sure the URLs in `docs/_static/versions.json` are valid
- As the release workflow is initiated by the `release` event, it's important to note that the default `GITHUB_REF` used by `actions/checkout` during the checkout process will correspond to the tag created during the release process. Consequently, the workflows will consistently build PyBaMM based on the commit associated with this tag. Should new commits be introduced to the `vYY.MM` branch, such as those addressing build issues, it becomes necessary to manually update this tag to point to the most recent commit -
```
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/lychee_url_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ jobs:
--accept 200,429
--exclude-path ./CHANGELOG.md
--exclude-path ./scripts/update_version.py
--exclude-path asv.conf.json
--exclude-path docs/conf.py
'./**/*.rst'
'./**/*.md'
'./**/*.py'
'./**/*.ipynb'
'./**/*.json'
'./**/*.toml'
# fail the action on broken links
fail: true
jobSummary: true
format: markdown
env:
# to be used in case rate limits are surpassed
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
62 changes: 24 additions & 38 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Build and publish package to PyPI

on:
release:
types: [published]
Expand Down Expand Up @@ -27,22 +26,18 @@ jobs:
with:
python-version: 3.8

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.3

agriyakhetarpal marked this conversation as resolved.
Show resolved Hide resolved
- name: Clone pybind11 repo (no history)
run: git clone --depth 1 --branch v2.10.4 https://github.com/pybind/pybind11.git
run: git clone --depth 1 --branch v2.11.1 https://github.com/pybind/pybind11.git
agriyakhetarpal marked this conversation as resolved.
Show resolved Hide resolved

# remove when a new vcpkg version is released
- name: Install the latest commit of vcpkg on windows
- name: Install 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
- name: Cache packages installed through vcpkg on Windows
uses: actions/cache@v3
env:
cache-name: vckpg_binary_cache
Expand All @@ -55,14 +50,13 @@ jobs:
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Build 64 bits wheels on Windows
run: |
python -m cibuildwheel --output-dir wheelhouse
- name: Build 64-bit wheels on Windows
run: pipx run cibuildwheel --output-dir wheelhouse
env:
CIBW_ENVIRONMENT: 'PYBAMM_USE_VCPKG=ON VCPKG_ROOT_DIR=C:\vcpkg VCPKG_DEFAULT_TRIPLET=x64-windows-static-md VCPKG_FEATURE_FLAGS=manifests,registries CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM=x64'
CIBW_ARCHS: "AMD64"

- name: Upload windows wheels
- name: Upload Windows wheels
uses: actions/upload-artifact@v3
with:
name: windows_wheels
Expand All @@ -82,42 +76,34 @@ jobs:
with:
python-version: 3.8

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.3

- name: Clone pybind11 repo (no history)
run: git clone --depth 1 --branch v2.10.4 https://github.com/pybind/pybind11.git
run: git clone --depth 1 --branch v2.11.1 https://github.com/pybind/pybind11.git

- name: Install SUNDIALS on macOS
# sometimes gfortran cannot be found, so reinstall gcc just to be sure
agriyakhetarpal marked this conversation as resolved.
Show resolved Hide resolved
- name: Install SuiteSparse and SUNDIALS on macOS
if: matrix.os == 'macos-latest'
run: |
# https://github.com/actions/virtual-environments/issues/1280
rm -f /usr/local/bin/2to3*
rm -f /usr/local/bin/idle3*
rm -f /usr/local/bin/pydoc3*
rm -f /usr/local/bin/python3*
brew update
brew install graphviz openblas libomp
brew reinstall gcc
agriyakhetarpal marked this conversation as resolved.
Show resolved Hide resolved
brew install libomp
python -m pip install cmake wget
python scripts/install_KLU_Sundials.py

- name: Build wheels on Linux and MacOS
run: python -m cibuildwheel --output-dir wheelhouse
- name: Build wheels on ${{ matrix.os }}
run: pipx run cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: x86_64
CIBW_BEFORE_ALL_LINUX: >
yum -y install openblas-devel lapack-devel &&
bash build_manylinux_wheels/install_sundials.sh 6.0.3 6.5.0

CIBW_BEFORE_BUILD_LINUX: "python -m pip install cmake casadi numpy"
bash scripts/install_sundials.sh 6.0.3 6.5.0
CIBW_BEFORE_BUILD_LINUX: >
python -m pip install cmake casadi numpy
# override; point to casadi install path so that it can be found by the repair command
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$(python -c 'import casadi; print(casadi.__path__[0])')" auditwheel repair -w {dest_dir} {wheel}
CIBW_BEFORE_BUILD_MACOS: >
python -m pip
install cmake casadi numpy &&
python scripts/fix_casadi_rpath_mac.py &&
scripts/fix_suitesparse_rpath_mac.sh
# got error "re.error: multiple repeat at position 104" on python 3.7 when --require-archs added, so remove
# it for mac
python scripts/fix_casadi_rpath_mac.py && scripts/fix_suitesparse_rpath_mac.sh
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
delocate-listdeps {wheel} &&
delocate-wheel -v -w {dest_dir} {wheel}
Expand All @@ -131,7 +117,7 @@ jobs:
if-no-files-found: error

build_sdist:
name: Build sdist
name: Build SDist
runs-on: ubuntu-latest

steps:
Expand All @@ -141,12 +127,12 @@ jobs:
python-version: 3.11

- name: Install dependencies
run: pip install --upgrade pip setuptools wheel build
run: pip install --upgrade pip setuptools wheel

- name: Build sdist
run: python -m build --sdist
- name: Build SDist
run: pipx run build --sdist

- name: Upload sdist
- name: Upload SDist
uses: actions/upload-artifact@v3
with:
name: sdist
Expand Down
39 changes: 17 additions & 22 deletions .github/workflows/run_periodic_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,19 @@ on:
schedule:
- cron: "0 3 * * *"

jobs:
pre_job:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: "never"
cancel_others: "true"
paths_ignore: '["**/README.md"]'
env:
FORCE_COLOR: 3

concurrency:
# github.workflow: name of the workflow, so that we don't cancel other workflows
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# Cancel in-progress runs when a new workflow with the same group name is triggered
# This avoids workflow runs on both pushes and PRs
cancel-in-progress: true

jobs:
style:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -69,19 +64,19 @@ jobs:
- name: Install macOS system dependencies
if: matrix.os == 'macos-latest'
run: |
brew install graphviz openblas
brew analytics off
brew install graphviz openblas libomp
brew reinstall gcc

- name: Install Windows system dependencies
if: matrix.os == 'windows-latest'
run: choco install graphviz --version=2.38.0.20190211

- name: Install standard Python dependencies
run: |
python -m pip install --upgrade pip wheel setuptools nox
- name: Install nox
run: python -m pip install nox

- name: Install SuiteSparse and SUNDIALS on GNU/Linux
if: matrix.os == 'ubuntu-latest'
- name: Install SuiteSparse and SUNDIALS on GNU/Linux and macOS
agriyakhetarpal marked this conversation as resolved.
Show resolved Hide resolved
if: matrix.os != 'windows-latest'
run: python -m nox -s pybamm-requires

- name: Run unit tests for GNU/Linux with Python 3.8, 3.9, and 3.10, and for macOS and Windows with all Python versions
Expand Down
Loading
Loading