From f75c4d8ef00a9b7b440cab73fef408416685a3d7 Mon Sep 17 00:00:00 2001 From: Laurent Farvacque Date: Thu, 21 Sep 2023 12:41:27 +0200 Subject: [PATCH 1/4] Update of the build process --- .github/workflows/build-python-wheels.yml | 20 ++---- .github/workflows/docs.yml | 4 +- .github/workflows/matlab-tests.yml | 2 +- .github/workflows/python-tests.yml | 2 +- githubproject.toml | 84 ----------------------- pyproject.toml | 12 ++-- 6 files changed, 13 insertions(+), 111 deletions(-) delete mode 100644 githubproject.toml diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index a170241d6..0a32dda94 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -16,7 +16,7 @@ jobs: os: [ubuntu-20.04, macos-11, windows-2019] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Necessary to fetch tags and allow setuptools_scm # see: https://github.com/pypa/setuptools_scm/issues/480 @@ -27,21 +27,11 @@ jobs: with: python-version: '3.9' - - name: Get version - # Get the version before modifying the repository - shell: bash - run: | - python -m pip install setuptools-scm - echo "SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm)" >> $GITHUB_ENV - - - name: Set build configuration - run: cp githubproject.toml pyproject.toml - - name: Build wheels - uses: pypa/cibuildwheel@v2.3.1 + uses: pypa/cibuildwheel@v2.16.0 - name: Upload wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: ./wheelhouse/*.whl @@ -51,7 +41,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Necessary to fetch tags and allow setuptools_scm # see: https://github.com/pypa/setuptools_scm/issues/480 @@ -69,7 +59,7 @@ jobs: run: python -m build --sdist - name: Upload sdist - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: tar.gz path: ./dist/*.tar.gz diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 556d52328..ca9eca5f5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Necessary to fetch tags and allow setuptools_scm # see: https://github.com/pypa/setuptools_scm/issues/480 @@ -32,7 +32,7 @@ jobs: working-directory: docs - name: Publish Docs to gh-pages - uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 + uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/_build/html \ No newline at end of file diff --git a/.github/workflows/matlab-tests.yml b/.github/workflows/matlab-tests.yml index 6afce1d14..a48f0ca28 100644 --- a/.github/workflows/matlab-tests.yml +++ b/.github/workflows/matlab-tests.yml @@ -24,7 +24,7 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up python 3.9 uses: actions/setup-python@v4 diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 14edf40a5..04ff5e7b9 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -24,7 +24,7 @@ jobs: steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 diff --git a/githubproject.toml b/githubproject.toml deleted file mode 100644 index 4b2d568b8..000000000 --- a/githubproject.toml +++ /dev/null @@ -1,84 +0,0 @@ -# This configuration is used to build wheels with GitHub Actions -# It differs from the standard pyproject.toml by fixing the numpy versions -# to make sure that the binaries are compiled with the oldest compatible -# version - -[build-system] -requires = [ - "numpy ~= 1.16.6;python_version<'3.8'", - "numpy ~= 1.17.3;python_version=='3.8'", - "numpy ~= 1.19.3;python_version=='3.9'", - "numpy ~= 1.21.3;python_version>='3.10'", - "numpy ~= 1.23.4;python_version>='3.11'", - "setuptools >= 62", - "setuptools_scm >= 7", - "mpi4py; extra=='mpi'", # Does not work yet, so we need in-tree backend - "wheel", -] -# build-backend = "setuptools.build_meta" -build-backend = "backend" -backend-path = ["_custom_build"] - -[project] -name = "accelerator-toolbox" -authors = [{name="The AT collaboration", email="atcollab-general@lists.sourceforge.net"}] -description = "Accelerator Toolbox" -readme = "pyat/README.rst" -dynamic = ["version"] -classifiers = [ - "Development Status :: 4 - Beta", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11" -] -requires-python = ">=3.7" -dependencies = [ - "importlib-resources;python_version<'3.9'", - "numpy>=1.16.6", - "scipy>=1.4.0" -] - -[project.urls] -GitHub = "https://github.com/atcollab/at" -Home="https://atcollab.github.io/at/" - -[project.optional-dependencies] -mpi = ["mpi4py"] -plot = ["matplotlib"] -dev = ["pytest >= 2.9", "pytest-lazy-fixture", "pytest-cov", "flake8"] -doc = ["Sphinx ~= 5.3", "myst-parser", "pydata-sphinx-theme ~= 0.11.0", "sphinx-copybutton"] - -# tool.setuptools is still in BETA, so we keep temporarily setup.cfg - -#[tool.setuptools] -#zip-safe = false -#include-package-data = false - -#[tool.setuptools.packages.find] -#where = ["pyat"] -#namespaces = false - -#[tool.setuptools.package-data] -#machine_data = ["*.m", "*.mat"] - -[tool.cibuildwheel] -# Pypy does not have Scipy so we cannot support it. -build = ["cp3{7,8,9}*", "cp310*"] -build-verbosity = "1" -# "build" frontend fails on windows -# build-frontend = "build" - -[tool.cibuildwheel.macos] -archs = ["x86_64", "arm64"] - -[tool.cibuildwheel.linux] -# Pass the detected PyAT version to the linux docker containers -environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"] - -[tool.setuptools_scm] -write_to = "pyat/at/_version.py" -git_describe_command = "git describe --dirty --tags --long --match pyat-[0-9]*" -fallback_version = "0.0.0" diff --git a/pyproject.toml b/pyproject.toml index 5edb1fbed..5e4bec0ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,8 @@ [build-system] requires = [ - "numpy >= 1.16.6;python_version<'3.8'", - "numpy >= 1.17.3;python_version=='3.8'", - "numpy >= 1.19.3;python_version=='3.9'", - "numpy >= 1.21.3;python_version=='3.10'", - "numpy >= 1.23.4;python_version>='3.11'", "setuptools >= 62", "setuptools_scm >= 7", + "oldest-supported-numpy", "mpi4py; extra=='mpi'", # Does not work yet, so we need in-tree backend "wheel", ] @@ -69,9 +65,9 @@ build-verbosity = "1" [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] -[tool.cibuildwheel.linux] -# Pass the detected PyAT version to the linux docker containers -environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"] +#[tool.cibuildwheel.linux] +## Pass the detected PyAT version to the linux docker containers +#environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"] [tool.setuptools_scm] write_to = "pyat/at/_version.py" From 1eb74066a81f68727ee92913fce0db96cebae0e4 Mon Sep 17 00:00:00 2001 From: Laurent Farvacque Date: Thu, 21 Sep 2023 14:54:25 +0200 Subject: [PATCH 2/4] Fix cp310 cp311 --- .github/workflows/build-python-wheels.yml | 2 +- .github/workflows/docs.yml | 2 +- pyproject.toml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index 0a32dda94..8279b7a9f 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-11, windows-2019] + os: [ubuntu-22.04, macos-12, windows-2022] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ca9eca5f5..96eb20e8e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build_and_run_tests: + build_and_publish_doc: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 5e4bec0ee..f67eb792e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,8 @@ doc = ["Sphinx ~= 5.3", "myst-parser", "pydata-sphinx-theme ~= 0.11.0", "sphinx- [tool.cibuildwheel] # Pypy does not have Scipy so we cannot support it. -build = ["cp3{7,8,9}*", "cp31{0, 1}*"] +build = ["cp3{7,8,9}*", "cp31{0,1}*"] +#skip = ["*-musllinux*", "*_i686", "*win32"] build-verbosity = "1" # "build" frontend fails on windows # build-frontend = "build" From ef363902214c3a100cd369bfa863ce24a19666a5 Mon Sep 17 00:00:00 2001 From: Laurent Farvacque Date: Thu, 21 Sep 2023 15:09:49 +0200 Subject: [PATCH 3/4] simplify --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f67eb792e..e2ff2d1fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ doc = ["Sphinx ~= 5.3", "myst-parser", "pydata-sphinx-theme ~= 0.11.0", "sphinx- [tool.cibuildwheel] # Pypy does not have Scipy so we cannot support it. -build = ["cp3{7,8,9}*", "cp31{0,1}*"] +build = ["cp3{7,8,9,10,11}*"] #skip = ["*-musllinux*", "*_i686", "*win32"] build-verbosity = "1" # "build" frontend fails on windows From 1b701863ab93fe2605c1440cd47f6ca73dc19b75 Mon Sep 17 00:00:00 2001 From: Laurent Farvacque Date: Fri, 22 Sep 2023 15:00:05 +0200 Subject: [PATCH 4/4] revert ubuntu version to 20.04 --- .github/workflows/build-python-wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-python-wheels.yml b/.github/workflows/build-python-wheels.yml index 8279b7a9f..29a3de8f0 100644 --- a/.github/workflows/build-python-wheels.yml +++ b/.github/workflows/build-python-wheels.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-12, windows-2022] + os: [ubuntu-20.04, macos-12, windows-2022] steps: - uses: actions/checkout@v4