From 8790e7840b69adf08be36e591e9a759abbcab581 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Thu, 15 Aug 2024 14:31:39 +0100 Subject: [PATCH 01/15] Added Python CI and tests --- .github/workflows/python.yaml | 159 ++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- optirustic-py/Cargo.lock | 2 +- optirustic-py/tests/test_api.py | 54 +++++++++++ 5 files changed, 216 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/python.yaml create mode 100644 optirustic-py/tests/test_api.py diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml new file mode 100644 index 0000000..7c72974 --- /dev/null +++ b/.github/workflows/python.yaml @@ -0,0 +1,159 @@ +# This file is autogenerated by maturin v1.7.0 +# To update, run +# +# maturin generate-ci github +# +name: Python + +on: + push: + branches: + - main + - master + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 + - runner: ubuntu-latest + target: s390x + - runner: ubuntu-latest + target: ppc64le + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml + sccache: 'true' + manylinux: auto + - name: Test Python API + run: | + pip install matplotlib numpy + pip install optirustic --no-index --find-links dist --force-reinstall --no-deps + python optirustic-py/tests/test_api.py + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.platform.target }} + path: dist + + musllinux: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: ubuntu-latest + target: x86_64 + - runner: ubuntu-latest + target: x86 + - runner: ubuntu-latest + target: aarch64 + - runner: ubuntu-latest + target: armv7 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml + sccache: 'true' + manylinux: musllinux_1_2 + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-musllinux-${{ matrix.platform.target }} + path: dist + + windows: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: windows-latest + target: x64 + - runner: windows-latest + target: x86 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + architecture: ${{ matrix.platform.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-windows-${{ matrix.platform.target }} + path: dist + + macos: + runs-on: ${{ matrix.platform.runner }} + strategy: + matrix: + platform: + - runner: macos-12 + target: x86_64 + - runner: macos-14 + target: aarch64 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.platform.target }} + args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml + sccache: 'true' + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-macos-${{ matrix.platform.target }} + path: dist + + release: + name: Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [ linux, musllinux, windows, macos ] + steps: + - uses: actions/download-artifact@v4 + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing wheels-*/* diff --git a/Cargo.lock b/Cargo.lock index 0be3bcf..b929e18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -801,7 +801,7 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "optirustic" -version = "0.3.4" +version = "0.4.0" dependencies = [ "chrono", "env_logger", diff --git a/Cargo.toml b/Cargo.toml index b840a5d..eb22090 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "optirustic" -version = "0.3.4" +version = "0.4.0" authors = ["Stefano Simoncelli <16114781+s-simoncelli@users.noreply.github.com>"] edition = "2021" rust-version = "1.80" diff --git a/optirustic-py/Cargo.lock b/optirustic-py/Cargo.lock index a91c7c4..beff5cc 100644 --- a/optirustic-py/Cargo.lock +++ b/optirustic-py/Cargo.lock @@ -813,7 +813,7 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "optirustic" -version = "0.3.4" +version = "0.4.0" dependencies = [ "chrono", "env_logger", diff --git a/optirustic-py/tests/test_api.py b/optirustic-py/tests/test_api.py new file mode 100644 index 0000000..4d104ca --- /dev/null +++ b/optirustic-py/tests/test_api.py @@ -0,0 +1,54 @@ +import unittest +from pathlib import Path + +import matplotlib.pyplot as plt +from optirustic import NSGA3, ObjectiveDirection, NSGA2 + + +class PythonTest(unittest.TestCase): + root_folder = Path(__file__).parent.parent.parent + + def test_reader(self): + file = self.root_folder / "examples" / "results" / "DTLZ1_3obj_NSGA3_gen400.json" + data = NSGA3(file.as_posix()) + p = data.problem + + self.assertEqual(p.number_of_variables, 7) + self.assertEqual(p.variables["x1"].min_value, 0) + + self.assertEqual(len(p.objectives), 3) + self.assertEqual(p.objectives["f1"].direction, ObjectiveDirection.Minimise) + + self.assertTrue("g" in p.constraints.keys()) + self.assertEqual(data.algorithm, "NSGA3") + self.assertEqual(data.generation, 400) + self.assertEqual(data.took.seconds, 4) + self.assertEqual(data.exported_on.day, 10) + + self.assertEqual(data.individuals[0].constraint_violation, 0) + self.assertAlmostEqual(data.individuals[0].get_objective_value("f2"), 0.167, 3) + self.assertTrue("x5" in data.individuals[0].variables.keys()) + self.assertTrue("reference_point_index" in data.individuals[0].data.keys()) + + self.assertAlmostEqual(data.hyper_volume([100, 100, 100]), 999999.97, 2) + + def test_plot(self): + self.assertTrue(isinstance(NSGA2( + (self.root_folder / "examples" / "results" / "SCH_2obj_NSGA2_gen250.json").as_posix() + ).plot(), plt.Figure)) + + self.assertTrue(isinstance(NSGA3( + (self.root_folder / "examples" / "results" / "DTLZ1_3obj_NSGA3_gen400.json").as_posix() + ).plot(), plt.Figure)) + + self.assertTrue(isinstance(NSGA3( + (self.root_folder / "examples" / "results" / "DTLZ1_8obj_NSGA3_gen750.json").as_posix() + ).plot(), plt.Figure)) + + self.assertTrue(isinstance(NSGA2.plot_convergence( + (self.root_folder / "examples" / "results" / "convergence").as_posix(), [10000, 10000] + ), plt.Figure)) + + +if __name__ == "__main__": + unittest.main() From 3cb0aef2e57c36259ef5716c692f54fef412328a Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 07:13:36 +0100 Subject: [PATCH 02/15] Included matplotlib and numpy as required py dependencies --- optirustic-py/pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/optirustic-py/pyproject.toml b/optirustic-py/pyproject.toml index d35c009..8da97aa 100644 --- a/optirustic-py/pyproject.toml +++ b/optirustic-py/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=1.5,<2.0", "matplotlib"] +requires = ["maturin>=1.5,<2.0"] build-backend = "maturin" [project] @@ -11,5 +11,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dynamic = ["version"] +dependencies = ["matplotlib~=3.9.2", "numpy~=2.0.1"] + [tool.maturin] features = ["pyo3/extension-module"] From 874b77edd4940e521720878877d51811b61c85e7 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 07:48:00 +0100 Subject: [PATCH 03/15] Install fontconfig in ubuntu CI --- .github/workflows/python.yaml | 56 ++++++++++------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 7c72974..eacd60f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -30,13 +30,20 @@ jobs: target: x86 - runner: ubuntu-latest target: aarch64 - - runner: ubuntu-latest - target: armv7 - - runner: ubuntu-latest - target: s390x - - runner: ubuntu-latest - target: ppc64le steps: + # Enable this when testing with nektos/act + # - name: Install rust + # uses: actions-rs/toolchain@v1 + # with: + # toolchain: stable + # override: true + # - name: Add Cargo to PATH + # run: . "$HOME/.cargo/env" + # - name: Install Clang + # run: sudo apt update && sudo apt install --yes clang + + - name: Install maturin sysem deps + run: apt install fontconfig - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: @@ -59,37 +66,6 @@ jobs: name: wheels-linux-${{ matrix.platform.target }} path: dist - musllinux: - runs-on: ${{ matrix.platform.runner }} - strategy: - matrix: - platform: - - runner: ubuntu-latest - target: x86_64 - - runner: ubuntu-latest - target: x86 - - runner: ubuntu-latest - target: aarch64 - - runner: ubuntu-latest - target: armv7 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml - sccache: 'true' - manylinux: musllinux_1_2 - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-musllinux-${{ matrix.platform.target }} - path: dist - windows: runs-on: ${{ matrix.platform.runner }} strategy: @@ -147,13 +123,13 @@ jobs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ linux, musllinux, windows, macos ] + needs: [ linux, windows, macos ] steps: - uses: actions/download-artifact@v4 - name: Publish to PyPI uses: PyO3/maturin-action@v1 - env: - MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + # env: + # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: command: upload args: --non-interactive --skip-existing wheels-*/* From 80af75b19b34b487229d2ab806d5c25cbbe527cb Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 07:53:36 +0100 Subject: [PATCH 04/15] Made plot feature optional --- .github/workflows/python.yaml | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index eacd60f..8620afa 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -42,8 +42,8 @@ jobs: # - name: Install Clang # run: sudo apt update && sudo apt install --yes clang - - name: Install maturin sysem deps - run: apt install fontconfig + - name: Install maturin system deps + run: sudo apt update && sudo apt install --yes fontconfig - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: diff --git a/Cargo.toml b/Cargo.toml index eb22090..0f63367 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ nalgebra = "0.33.0" float-cmp = "0.9.0" [features] -default = ["plot"] +default = [] plot = ["dep:plotters"] [package.metadata.docs.rs] From 2755904fcc02b8ab1701c21d7a308815473afa8a Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:00:36 +0100 Subject: [PATCH 05/15] Require clang on ubuntu workflow Fixed crete requirements without plot feature --- .github/workflows/python.yaml | 9 ++++----- src/algorithms/algorithm.rs | 5 ++++- src/utils/reference_points.rs | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 8620afa..30a0b79 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -39,11 +39,10 @@ jobs: # override: true # - name: Add Cargo to PATH # run: . "$HOME/.cargo/env" - # - name: Install Clang - # run: sudo apt update && sudo apt install --yes clang - - - name: Install maturin system deps - run: sudo apt update && sudo apt install --yes fontconfig + - name: Install Clang + run: sudo apt update && sudo apt install --yes clang + # - name: Install maturin system deps + # run: sudo apt update && sudo apt install --yes fontconfig - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: diff --git a/src/algorithms/algorithm.rs b/src/algorithms/algorithm.rs index 9056343..65e804f 100644 --- a/src/algorithms/algorithm.rs +++ b/src/algorithms/algorithm.rs @@ -1,8 +1,11 @@ use std::collections::HashMap; +#[cfg(feature = "plot")] use std::ffi::OsStr; use std::fmt::{Debug, Display, Formatter}; use std::fs::read_dir; -use std::path::{Path, PathBuf}; +#[cfg(feature = "plot")] +use std::path::Path; +use std::path::PathBuf; use std::sync::Arc; use std::time::Instant; use std::{fmt, fs}; diff --git a/src/utils/reference_points.rs b/src/utils/reference_points.rs index f1583ac..1f44baa 100644 --- a/src/utils/reference_points.rs +++ b/src/utils/reference_points.rs @@ -1,12 +1,12 @@ #[cfg(feature = "plot")] use std::error::Error; +#[cfg(feature = "plot")] use std::path::PathBuf; #[cfg(feature = "plot")] use plotters::prelude::*; use serde::{Deserialize, Serialize}; -#[cfg(feature = "plot")] use crate::core::OError; /// Calculate the binomial coefficient. This gives the number of `k`-subsets possible out of a From 61e67f695ac254a32b011eb98215a6245ae557b5 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 08:50:39 +0100 Subject: [PATCH 06/15] Require clang-dev on ubuntu workflow Run tests with all features --- .github/workflows/python.yaml | 2 +- .github/workflows/tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 30a0b79..9e2b11e 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -40,7 +40,7 @@ jobs: # - name: Add Cargo to PATH # run: . "$HOME/.cargo/env" - name: Install Clang - run: sudo apt update && sudo apt install --yes clang + run: sudo apt update && sudo apt install --yes clang libclang-dev build-essential # - name: Install maturin system deps # run: sudo apt update && sudo apt install --yes fontconfig - uses: actions/checkout@v4 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3918eec..7ccfe98 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,7 +23,7 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test --verbose --all + run: cargo test --verbose --all --all-features # NOTE disabled due to compiler failure in hv-fonseca crate # test-windows: # name: Cargo check and test on Windows From cf557ad27643a4ff9720527acaa87693e332c0cc Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:02:48 +0100 Subject: [PATCH 07/15] Force install clang in maturin action in python workflow --- .github/workflows/python.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 9e2b11e..ffc135d 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -40,7 +40,7 @@ jobs: # - name: Add Cargo to PATH # run: . "$HOME/.cargo/env" - name: Install Clang - run: sudo apt update && sudo apt install --yes clang libclang-dev build-essential + run: sudo apt update && sudo apt install --yes clang libclang-dev build-essential clang-11 # - name: Install maturin system deps # run: sudo apt update && sudo apt install --yes fontconfig - uses: actions/checkout@v4 @@ -54,6 +54,9 @@ jobs: args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml sccache: 'true' manylinux: auto + before-script-linux: | + sudo apt-get update + sudo apt-get install -y libclang-dev - name: Test Python API run: | pip install matplotlib numpy From b4b74ae42fda222decd6747e48a93d5442bee6ed Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:08:47 +0100 Subject: [PATCH 08/15] Force install rust toolchain --- .github/workflows/python.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index ffc135d..66ab7c8 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -47,6 +47,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x + - uses: dtolnay/rust-toolchain@stable - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -54,9 +55,6 @@ jobs: args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml sccache: 'true' manylinux: auto - before-script-linux: | - sudo apt-get update - sudo apt-get install -y libclang-dev - name: Test Python API run: | pip install matplotlib numpy From 0d06ad6db3e488c28e962fe254cea2b64d36d6a0 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:14:20 +0100 Subject: [PATCH 09/15] Disabled sccache in linux workflow --- .github/workflows/python.yaml | 58 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 66ab7c8..a75c795 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -47,13 +47,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x - - uses: dtolnay/rust-toolchain@stable - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml - sccache: 'true' + # sccache: 'true' manylinux: auto - name: Test Python API run: | @@ -66,32 +65,32 @@ jobs: name: wheels-linux-${{ matrix.platform.target }} path: dist - windows: - runs-on: ${{ matrix.platform.runner }} - strategy: - matrix: - platform: - - runner: windows-latest - target: x64 - - runner: windows-latest - target: x86 - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - architecture: ${{ matrix.platform.target }} - - name: Build wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.platform.target }} - args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml - sccache: 'true' - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheels-windows-${{ matrix.platform.target }} - path: dist + # windows: + # runs-on: ${{ matrix.platform.runner }} + # strategy: + # matrix: + # platform: + # - runner: windows-latest + # target: x64 + # - runner: windows-latest + # target: x86 + # steps: + # - uses: actions/checkout@v4 + # - uses: actions/setup-python@v5 + # with: + # python-version: 3.x + # architecture: ${{ matrix.platform.target }} + # - name: Build wheels + # uses: PyO3/maturin-action@v1 + # with: + # target: ${{ matrix.platform.target }} + # args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml + # sccache: 'true' + # - name: Upload wheels + # uses: actions/upload-artifact@v4 + # with: + # name: wheels-windows-${{ matrix.platform.target }} + # path: dist macos: runs-on: ${{ matrix.platform.runner }} @@ -123,7 +122,8 @@ jobs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ linux, windows, macos ] + needs: [ linux, macos ] + # needs: [ linux, windows, macos ] steps: - uses: actions/download-artifact@v4 - name: Publish to PyPI From 9e59b385a666e16b0e951dcc1caaabb43e130e11 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:54:56 +0100 Subject: [PATCH 10/15] Disabled container with maturin build --- .github/workflows/python.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index a75c795..c0a7488 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -41,18 +41,18 @@ jobs: # run: . "$HOME/.cargo/env" - name: Install Clang run: sudo apt update && sudo apt install --yes clang libclang-dev build-essential clang-11 - # - name: Install maturin system deps - # run: sudo apt update && sudo apt install --yes fontconfig - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: 3.x + - uses: dtolnay/rust-toolchain@stable - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml - # sccache: 'true' + container: off + sccache: 'true' manylinux: auto - name: Test Python API run: | From 4e544c8b1cb25d11b92c7e5768f3468b8cace1b7 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 10:10:52 +0100 Subject: [PATCH 11/15] Renamed py package Do not build wheel for x86 --- .github/workflows/python.yaml | 7 +- optirustic-py/Cargo.lock | 496 +--------------------------------- optirustic-py/pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 494 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index c0a7488..6a476e8 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -26,8 +26,6 @@ jobs: platform: - runner: ubuntu-latest target: x86_64 - - runner: ubuntu-latest - target: x86 - runner: ubuntu-latest target: aarch64 steps: @@ -51,13 +49,14 @@ jobs: with: target: ${{ matrix.platform.target }} args: --release --out dist --find-interpreter --manifest-path optirustic-py/Cargo.toml + # run w/o container to prevent issue with missing clang lib container: off sccache: 'true' manylinux: auto + # Run tests only in linux env - name: Test Python API run: | - pip install matplotlib numpy - pip install optirustic --no-index --find-links dist --force-reinstall --no-deps + pip install optirustic --no-index --find-links dist --force-reinstall python optirustic-py/tests/test_api.py - name: Upload wheels uses: actions/upload-artifact@v4 diff --git a/optirustic-py/Cargo.lock b/optirustic-py/Cargo.lock index beff5cc..fcc5354 100644 --- a/optirustic-py/Cargo.lock +++ b/optirustic-py/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "aho-corasick" version = "1.1.3" @@ -68,7 +62,7 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -78,7 +72,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -102,7 +96,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.6.0", + "bitflags", "cexpr", "clang-sys", "itertools", @@ -119,12 +113,6 @@ dependencies = [ "which", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -200,79 +188,18 @@ dependencies = [ "libloading", ] -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - [[package]] name = "colorchoice" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" -[[package]] -name = "core-graphics" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-graphics-types", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "libc", -] - -[[package]] -name = "core-text" -version = "20.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d2790b5c08465d49f8dc05c8bcae9fea467855947db39b0f8145c091aaced5" -dependencies = [ - "core-foundation", - "core-graphics", - "foreign-types", - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -298,58 +225,6 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" -[[package]] -name = "cstr" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68523903c8ae5aacfa32a0d9ae60cadeb764e1da14ee0d26b1f3089f13a54636" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dlib" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" -dependencies = [ - "libloading", -] - -[[package]] -name = "dwrote" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" -dependencies = [ - "lazy_static", - "libc", - "winapi", - "wio", -] - [[package]] name = "either" version = "1.13.0" @@ -386,95 +261,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fdeflate" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "flate2" -version = "1.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "float-ord" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce81f49ae8a0482e4c55ea62ebbd7e5a686af544c00b9d090bba3ff9be97b3d" - -[[package]] -name = "font-kit" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2845a73bbd781e691ab7c2a028c579727cd254942e8ced57ff73e0eafd60de87" -dependencies = [ - "bitflags 2.6.0", - "byteorder", - "core-foundation", - "core-graphics", - "core-text", - "dirs-next", - "dwrote", - "float-ord", - "freetype-sys", - "lazy_static", - "libc", - "log", - "pathfinder_geometry", - "pathfinder_simd", - "walkdir", - "winapi", - "yeslogic-fontconfig-sys", -] - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "freetype-sys" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7edc5b9669349acfda99533e9e0bcf26a51862ab43b08ee7745c55d28eb134" -dependencies = [ - "cc", - "libc", - "pkg-config", + "windows-sys", ] [[package]] @@ -488,16 +275,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gif" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" -dependencies = [ - "color_quant", - "weezl", -] - [[package]] name = "glob" version = "0.3.1" @@ -516,7 +293,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -564,20 +341,6 @@ dependencies = [ "cc", ] -[[package]] -name = "image" -version = "0.24.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "jpeg-decoder", - "num-traits", - "png", -] - [[package]] name = "indoc" version = "2.0.5" @@ -614,12 +377,6 @@ dependencies = [ "libc", ] -[[package]] -name = "jpeg-decoder" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" - [[package]] name = "js-sys" version = "0.3.69" @@ -657,16 +414,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -710,16 +457,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", - "simd-adler32", -] - [[package]] name = "nalgebra" version = "0.33.0" @@ -823,7 +560,6 @@ dependencies = [ "nalgebra", "optirustic-macros", "ordered-float", - "plotters", "rand", "rand_chacha", "rayon", @@ -866,90 +602,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pathfinder_geometry" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" -dependencies = [ - "log", - "pathfinder_simd", -] - -[[package]] -name = "pathfinder_simd" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cf07ef4804cfa9aea3b04a7bbdd5a40031dbb6b4f2cbaf2b011666c80c5b4f2" -dependencies = [ - "rustc_version", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "plotters" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15b6eccb8484002195a3e44fe65a4ce8e93a625797a063735536fd59cb01cf3" -dependencies = [ - "chrono", - "font-kit", - "image", - "lazy_static", - "num-traits", - "pathfinder_geometry", - "plotters-backend", - "plotters-bitmap", - "plotters-svg", - "ttf-parser", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414cec62c6634ae900ea1c56128dfe87cf63e7caece0852ec76aba307cebadb7" - -[[package]] -name = "plotters-bitmap" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e7f6fb8302456d7c264a94dada86f76d76e1a03e2294ee86ca7da92983b0a6" -dependencies = [ - "gif", - "image", - "plotters-backend", -] - -[[package]] -name = "plotters-svg" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b30686a7d9c3e010b84284bdd26a29f2138574f52f5eb6f794fc0ad924e705" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "png" -version = "0.17.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - [[package]] name = "portable-atomic" version = "1.7.0" @@ -1113,17 +765,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - [[package]] name = "regex" version = "1.10.6" @@ -1159,26 +800,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1196,21 +828,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - [[package]] name = "serde" version = "1.0.206" @@ -1262,12 +879,6 @@ dependencies = [ "wide", ] -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - [[package]] name = "syn" version = "2.0.74" @@ -1305,12 +916,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ttf-parser" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" - [[package]] name = "typenum" version = "1.17.0" @@ -1335,16 +940,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1405,22 +1000,6 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" -[[package]] -name = "web-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "weezl" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" - [[package]] name = "which" version = "4.4.2" @@ -1443,37 +1022,6 @@ dependencies = [ "safe_arch", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-core" version = "0.52.0" @@ -1492,15 +1040,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -1565,27 +1104,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - -[[package]] -name = "yeslogic-fontconfig-sys" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb6b23999a8b1a997bf47c7bb4d19ad4029c3327bb3386ebe0a5ff584b33c7a" -dependencies = [ - "cstr", - "dlib", - "once_cell", - "pkg-config", -] - [[package]] name = "zerocopy" version = "0.7.35" diff --git a/optirustic-py/pyproject.toml b/optirustic-py/pyproject.toml index 8da97aa..689167b 100644 --- a/optirustic-py/pyproject.toml +++ b/optirustic-py/pyproject.toml @@ -3,7 +3,7 @@ requires = ["maturin>=1.5,<2.0"] build-backend = "maturin" [project] -name = "optirustic-py" +name = "optirustic" requires-python = ">=3.8" classifiers = [ "Programming Language :: Rust", From 4997eed74e9aefc4c1c3ca93d228af821ea3bf6b Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:26:32 +0100 Subject: [PATCH 12/15] Fixed wheel installation --- .github/workflows/python.yaml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 6a476e8..b1bd8ef 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -19,24 +19,16 @@ permissions: contents: read jobs: - linux: + Linux (build and tests): runs-on: ${{ matrix.platform.runner }} strategy: matrix: platform: - runner: ubuntu-latest target: x86_64 - - runner: ubuntu-latest - target: aarch64 + # - runner: ubuntu-latest + # target: aarch64 steps: - # Enable this when testing with nektos/act - # - name: Install rust - # uses: actions-rs/toolchain@v1 - # with: - # toolchain: stable - # override: true - # - name: Add Cargo to PATH - # run: . "$HOME/.cargo/env" - name: Install Clang run: sudo apt update && sudo apt install --yes clang libclang-dev build-essential clang-11 - uses: actions/checkout@v4 @@ -56,7 +48,7 @@ jobs: # Run tests only in linux env - name: Test Python API run: | - pip install optirustic --no-index --find-links dist --force-reinstall + pip install optirustic --find-links dist --force-reinstall python optirustic-py/tests/test_api.py - name: Upload wheels uses: actions/upload-artifact@v4 @@ -64,6 +56,7 @@ jobs: name: wheels-linux-${{ matrix.platform.target }} path: dist + # TODO MSVC is broken with binding files # windows: # runs-on: ${{ matrix.platform.runner }} # strategy: @@ -91,7 +84,7 @@ jobs: # name: wheels-windows-${{ matrix.platform.target }} # path: dist - macos: + MaxOS (build only): runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -118,10 +111,10 @@ jobs: path: dist release: - name: Release + name: Wheel release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ linux, macos ] + needs: [ Linux (build and tests), MaxOS (build only) ] # needs: [ linux, windows, macos ] steps: - uses: actions/download-artifact@v4 From 549462c158fa310090d9424f98d0c21df4c5ce68 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:29:15 +0100 Subject: [PATCH 13/15] Fixed job names --- .github/workflows/python.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index b1bd8ef..92788b3 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -19,7 +19,7 @@ permissions: contents: read jobs: - Linux (build and tests): + Linux - build and tests: runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -84,7 +84,7 @@ jobs: # name: wheels-windows-${{ matrix.platform.target }} # path: dist - MaxOS (build only): + MaxOS - build only: runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -114,7 +114,7 @@ jobs: name: Wheel release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ Linux (build and tests), MaxOS (build only) ] + needs: [ Linux - build and tests, MaxOS - build only ] # needs: [ linux, windows, macos ] steps: - uses: actions/download-artifact@v4 From 5b60569289ba99618f4573867c2fc5662aa5e864 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:31:11 +0100 Subject: [PATCH 14/15] Fixed job names #2 --- .github/workflows/python.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 92788b3..3338869 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -19,7 +19,7 @@ permissions: contents: read jobs: - Linux - build and tests: + Build and tests on Linux: runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -84,7 +84,7 @@ jobs: # name: wheels-windows-${{ matrix.platform.target }} # path: dist - MaxOS - build only: + Build on MacOS: runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -114,7 +114,7 @@ jobs: name: Wheel release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ Linux - build and tests, MaxOS - build only ] + needs: [ Build and tests on Linux, Build on MacOS ] # needs: [ linux, windows, macos ] steps: - uses: actions/download-artifact@v4 From a06db714cef93d5df804107ca5157b2c48462526 Mon Sep 17 00:00:00 2001 From: Stefano Simonelli <16114781+s-simoncelli@users.noreply.github.com> Date: Sun, 18 Aug 2024 13:33:15 +0100 Subject: [PATCH 15/15] Fixed job names #3 --- .github/workflows/python.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 3338869..1ee013b 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -19,7 +19,8 @@ permissions: contents: read jobs: - Build and tests on Linux: + linux-build-and-test: + name: Linux (build and test) runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -84,7 +85,8 @@ jobs: # name: wheels-windows-${{ matrix.platform.target }} # path: dist - Build on MacOS: + macos-build: + name: Mac OS (build only) runs-on: ${{ matrix.platform.runner }} strategy: matrix: @@ -114,7 +116,7 @@ jobs: name: Wheel release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [ Build and tests on Linux, Build on MacOS ] + needs: [ linux-build-and-test, macos-build ] # needs: [ linux, windows, macos ] steps: - uses: actions/download-artifact@v4