From 18b789e3904ec050e9a6890dab342de9cbd8ad29 Mon Sep 17 00:00:00 2001 From: Mike Schmidt Date: Tue, 30 Apr 2024 16:25:10 -0600 Subject: [PATCH] chore: Updated CI's maturin, ARM building on MacOS 14, and book versions --- .github/scripts/find_compatible_wheel.py | 20 +++++++++++------ .github/workflows/python-build-test.yaml | 24 +++++++++++---------- book/lace_preprocess_mdbook_yaml/Cargo.toml | 4 ++-- pylace/pyproject.toml | 2 +- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/.github/scripts/find_compatible_wheel.py b/.github/scripts/find_compatible_wheel.py index af3a9a34..08857173 100644 --- a/.github/scripts/find_compatible_wheel.py +++ b/.github/scripts/find_compatible_wheel.py @@ -10,23 +10,29 @@ description="Program to find wheels in a directory compatible with the current version of Python" ) -parser.add_argument("package", help="The name of the package that you are searching for a wheel for") +parser.add_argument( + "package", help="The name of the package that you are searching for a wheel for" +) parser.add_argument("dir", help="the directory under which to search for the wheels") -args=parser.parse_args() +args = parser.parse_args() -wheel=None +wheel = None for tag in sys_tags(): print(f"Looking for file matching tag {tag}", file=sys.stderr) - matches=glob.glob(args.package + "*" + str(tag) + "*.whl", root_dir=args.dir) + matches = glob.glob(args.package + "*" + str(tag) + "*.whl", root_dir=args.dir) if len(matches) == 1: - wheel=matches[0] + wheel = matches[0] break elif len(matches) > 1: - print("Found multiple matches for the same tag " + str(tag), matches, file=sys.stderr) + print( + f"Found multiple matches for the same tag `{tag}`", + matches, + file=sys.stderr, + ) -if wheel: +if wheel: print(os.path.join(args.dir, wheel)) else: sys.exit("Did not find compatible wheel") diff --git a/.github/workflows/python-build-test.yaml b/.github/workflows/python-build-test.yaml index caecdb8a..0259ba33 100644 --- a/.github/workflows/python-build-test.yaml +++ b/.github/workflows/python-build-test.yaml @@ -20,7 +20,7 @@ jobs: defaults: run: working-directory: pylace - + steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: python-version: '3.12' cache: 'pip' cache-dependency-path: "pylace/requirements-lint.txt" - + - name: Install Python dependencies run: | pip install --upgrade pip @@ -102,10 +102,11 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.5.1 target: ${{ matrix.target }} args: --release --out dist -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --manifest-path pylace/Cargo.toml manylinux: auto - + - name: Install dev dependencies run: | pip install --upgrade pip @@ -113,7 +114,6 @@ jobs: - name: Install pylace run: | - ls -l ./dist WHEEL_FILE=$(python3 .github/scripts/find_compatible_wheel.py pylace ./dist) echo "Installing $WHEEL_FILE" pip install $WHEEL_FILE @@ -147,9 +147,10 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.5.1 target: ${{ matrix.target }} args: --release --out dist -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --manifest-path pylace/Cargo.toml - + - name: Install dev dependencies run: | pip install --upgrade pip @@ -157,7 +158,6 @@ jobs: - name: Install pylace run: | - ls -l ./dist $WHEEL_FILE = (python3 .github/scripts/find_compatible_wheel.py pylace ./dist) echo "Installing $WHEEL_FILE" pip install $WHEEL_FILE @@ -172,11 +172,15 @@ jobs: path: dist macos: - runs-on: macos-latest needs: ["lint-python", "lint-rust"] strategy: matrix: - target: [x86_64, aarch64] + include: + - os: macos-latest + target: aarch64 + - os: macos-13 + target: x86_64 + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -190,24 +194,22 @@ jobs: - name: Build wheels uses: PyO3/maturin-action@v1 with: + maturin-version: 1.5.1 target: ${{ matrix.target }} args: --release --out dist -i python3.8 -i python3.9 -i python3.10 -i python3.11 -i python3.12 --manifest-path pylace/Cargo.toml - name: Install dev dependencies - if: ${{ matrix.target != 'aarch64' }} run: | pip install --upgrade pip pip install -r pylace/requirements-dev.txt - name: Install pylace - if: ${{ matrix.target != 'aarch64' }} run: | WHEEL_FILE=$(python3 .github/scripts/find_compatible_wheel.py pylace ./dist) echo "Installing $WHEEL_FILE" pip install $WHEEL_FILE - name: Run Tests - if: ${{ matrix.target != 'aarch64' }} run: pytest pylace/tests - name: Upload wheels diff --git a/book/lace_preprocess_mdbook_yaml/Cargo.toml b/book/lace_preprocess_mdbook_yaml/Cargo.toml index b202e30a..7a3c0a9e 100644 --- a/book/lace_preprocess_mdbook_yaml/Cargo.toml +++ b/book/lace_preprocess_mdbook_yaml/Cargo.toml @@ -16,8 +16,8 @@ path = "src/main.rs" anyhow = "1.0" clap = "4.2" env_logger = "0.10" -lace_codebook = { path = "../../lace/lace_codebook", version = "0.6.0" } -lace_stats = { path = "../../lace/lace_stats", version = "0.3.0" } +lace_codebook = { path = "../../lace/lace_codebook", version = "0.7.0" } +lace_stats = { path = "../../lace/lace_stats", version = "0.4.0" } log = "0.4" mdbook = "0.4" pulldown-cmark = { version = "0.9", default-features = false } diff --git a/pylace/pyproject.toml b/pylace/pyproject.toml index b827dba9..6651421b 100644 --- a/pylace/pyproject.toml +++ b/pylace/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.13,<0.14"] +requires = ["maturin>=1.0,<2"] build-backend = "maturin" [project]