diff --git a/.github/workflows/bindings_python_ci.yml b/.github/workflows/bindings_python_ci.yml index 9ea2ac0b9..55e7e5bbd 100644 --- a/.github/workflows/bindings_python_ci.yml +++ b/.github/workflows/bindings_python_ci.yml @@ -56,17 +56,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 + - uses: astral-sh/setup-uv@v6 + with: + version: "0.9.3" + enable-cache: true - name: Install tools run: | - pip install ruff + uv tool install ruff - name: Check format working-directory: "bindings/python" run: | - ruff format . --diff + uvx ruff format . --diff - name: Check style working-directory: "bindings/python" run: | - ruff check . + uvx ruff check . test: runs-on: ${{ matrix.os }} @@ -86,15 +90,15 @@ jobs: working-directory: "bindings/python" command: build args: --out dist --sdist - - name: Install uv - shell: bash - run: | - python -m pip install uv==0.9.3 + - uses: astral-sh/setup-uv@v6 + with: + version: "0.9.3" + enable-cache: true - name: Sync dependencies working-directory: "bindings/python" shell: bash run: | - uv sync --group dev --no-install-project + make install - name: Install built wheel working-directory: "bindings/python" shell: bash @@ -104,4 +108,4 @@ jobs: working-directory: "bindings/python" shell: bash run: | - uv run --group dev --no-sync pytest + make test diff --git a/bindings/python/Makefile b/bindings/python/Makefile new file mode 100644 index 000000000..c36a1091d --- /dev/null +++ b/bindings/python/Makefile @@ -0,0 +1,26 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + + +install: + uv sync --group dev --no-install-project + +build: + uv run maturin develop + +test: + uv run --no-sync pytest diff --git a/bindings/python/README.md b/bindings/python/README.md index a91599d9a..320a9a401 100644 --- a/bindings/python/README.md +++ b/bindings/python/README.md @@ -32,17 +32,17 @@ pip install uv==0.9.3 Set up the development environment: ```shell -uv sync --group dev +make install ``` ## Build ```shell -uv run --group dev maturin develop +make build ``` ## Test ```shell -uv run --group dev pytest +make test ```