Skip to content

Commit

Permalink
Split long strings into lines
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Mar 20, 2024
2 parents 300ff4f + 3406e88 commit fe67a25
Show file tree
Hide file tree
Showing 13 changed files with 1,167 additions and 303 deletions.
45 changes: 42 additions & 3 deletions .github/workflows/ci-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
python:
- 'quantinuum-hugr-py/**'
- 'pyproject.toml'
- 'specification/schema/**'
check:
needs: changes
Expand Down Expand Up @@ -74,16 +75,54 @@ jobs:
- name: Run tests
run: poetry run pytest

# Ensure that the serialization schema is up to date
serialization-schema:
needs: [changes]
if: ${{ needs.changes.outputs.python == 'true' }}
name: Check serialization schema
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: "poetry"
- name: Install the project libraries
run: poetry install
- name: Generate the updated schema
run: |
poetry run python scripts/generate_schema.py specification/schema/
- name: Check if the schema is up to date
run: |
git diff --exit-code --name-only specification/schema/
if [ $? -ne 0 ]; then
echo "The serialization schema is not up to date"
echo "Please run 'just update-schema' and commit the changes"
exit 1
fi
# This is a meta job to mark successful completion of the required checks,
# even if they are skipped due to no changes in the relevant files.
required-checks:
name: Required checks 🐍
needs: [changes, check]
if: always()
needs: [changes, check, serialization-schema]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Fail if required checks failed
if: (failure() || cancelled())
# This condition should simply be `if: failure() || cancelled()`,
# but there seems to be a bug in the github workflow runner.
#
# See https://github.com/orgs/community/discussions/80788
if: |
needs.changes.result == 'failure' || needs.changes.result == 'cancelled' ||
needs.check.result == 'failure' || needs.check.result == 'cancelled' ||
needs.serialization-schema.result == 'failure' || needs.serialization-schema.result == 'cancelled'
run: |
echo "Required checks failed"
echo "Please check the logs for more information"
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/ci-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,18 @@ jobs:
required-checks:
name: Required checks 🦀
needs: [changes, check, tests-stable]
if: always()
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Fail if required checks failed
if: (failure() || cancelled())
# This condition should simply be `if: failure() || cancelled()`,
# but there seems to be a bug in the github workflow runner.
#
# See https://github.com/orgs/community/discussions/80788
if: |
needs.changes.result == 'failure' || needs.changes.result == 'cancelled' ||
needs.check.result == 'failure' || needs.check.result == 'cancelled' ||
needs.tests-stable.result == 'failure' || needs.tests-stable.result == 'cancelled'
run: |
echo "Required checks failed"
echo "Please check the logs for more information"
Expand Down
1 change: 0 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ line-by-line coverage report on
[codecov](https://app.codecov.io/gh/CQCL/hugr/commits?branch=All%20branches).

To run the coverage checks locally, first install `cargo-llvm-cov`.

```bash
cargo install cargo-llvm-cov
```
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage:
# Ignore tests and binaries
ignore:
- "quantinuum-hugr-py/tests"
- "scripts"

# Coverage groups config
flag_management:
Expand Down
1 change: 1 addition & 0 deletions quantinuum-hugr-py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repository = "https://github.com/CQCL/hugr"

[tool.poetry.dependencies]
python = ">=3.10"
pydantic = "^2.6.4"

[tool.pytest.ini_options]
# Lark throws deprecation warnings for `src_parse` and `src_constants`.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .serial_hugr import SerialHugr

__all__ = ["SerialHugr"]
Loading

0 comments on commit fe67a25

Please sign in to comment.