diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cf7d526..10227d12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,14 +29,22 @@ jobs: with: components: rustfmt, clippy - uses: mozilla-actions/sccache-action@v0.0.3 - - name: Check formatting + - name: Check rust formatting run: cargo fmt -- --check + - name: Check python formatting + uses: chartboost/ruff-action@v1 + with: + args: format --check - name: Run clippy run: cargo clippy --all-targets --all-features --workspace -- -D warnings - name: Build docs run: cargo doc --no-deps --all-features env: RUSTDOCFLAGS: "-Dwarnings" + - name: Python lints + uses: chartboost/ruff-action@v1 + with: + args: check benches: # Not required, we can ignore it for the merge queue check. @@ -102,12 +110,11 @@ jobs: - name: Build pyo3 bindings run: | pip install -r requirements.txt - cd pyrs - maturin build - pip install ../target/wheels/*.whl + maturin build -m pytket-tk2/Cargo.toml + pip install target/wheels/*.whl - name: Test pyo3 bindings run: | - cd pyrs + pip install pytest -r pytket-tk2/dev-requirements.txt pytest coverage: @@ -151,13 +158,10 @@ jobs: run: | pip install -r requirements.txt pip install pytest-cov - cd pyrs - maturin build - pip install ../target/wheels/*.whl + maturin build -m pytket-tk2/Cargo.toml + pip install target/wheels/*.whl - name: Run python tests with coverage instrumentation - run: | - cd pyrs - pytest --cov=./ --cov-report=xml + run: pytest --cov=./ --cov-report=xml - name: Upload python coverage to codecov.io uses: codecov/codecov-action@v3 with: diff --git a/pytket-tk2/dev-requirements.txt b/pytket-tk2/dev-requirements.txt index 2406e2fe..9768808e 100644 --- a/pytket-tk2/dev-requirements.txt +++ b/pytket-tk2/dev-requirements.txt @@ -3,7 +3,7 @@ # Development requirements maturin # Build wheels -black # Code formatting +ruff # Code formatting pytket # TKET1 jupyterlab # For running the examples graphviz # Visualisation of Hugrs in the notebooks \ No newline at end of file diff --git a/pytket-tk2/pytket_tk2/__init__.py b/pytket-tk2/pytket_tk2/__init__.py index 47d28f97..afab926b 100644 --- a/pytket-tk2/pytket_tk2/__init__.py +++ b/pytket-tk2/pytket_tk2/__init__.py @@ -1,5 +1,5 @@ -from .pytket_tk2 import * +from .pytket_tk2 import * # noqa: F403,F405 -__doc__ = pytket_tk2.__doc__ -if hasattr(pytket_tk2, "__all__"): - __all__ = pytket_tk2.__all__ +__doc__ = pytket_tk2.__doc__ # noqa: F405 +if hasattr(pytket_tk2, "__all__"): # noqa: F405 + __all__ = pytket_tk2.__all__ # noqa: F405