Skip to content

Commit

Permalink
Unpin hugr
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Sep 4, 2024
1 parent d97a549 commit d43ae57
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Minimize uv cache
run: uv cache prune --ci
run: uv cache prune --ci
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ repos:
- id: end-of-file-fixer
exclude: |
(?x)^(
.*\.json
.*\.json|
.*\.err
)$
- id: trailing-whitespace
exclude: |
(?x)^(
.*\.json
.*\.json|
.*\.err
)$
# Python-specific
- id: check-ast
Expand Down
12 changes: 8 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ cargo_toml = "0.20.4"
[patch.crates-io]

# Uncomment these to test the latest dependency version during development
hugr = { git = "https://github.com/CQCL/hugr", rev = "6bf6c82c9ec9d801ab43e311e5f815a3eea7d9c1" }
hugr-cli = { git = "https://github.com/CQCL/hugr", rev = "6bf6c82c9ec9d801ab43e311e5f815a3eea7d9c1" }
#hugr = { git = "https://github.com/CQCL/hugr", rev = "6bf6c82c9ec9d801ab43e311e5f815a3eea7d9c1" }
#hugr-cli = { git = "https://github.com/CQCL/hugr", rev = "6bf6c82c9ec9d801ab43e311e5f815a3eea7d9c1" }
#hugr-llvm = { git = "https://github.com/CQCL/hugr-llvm", commit = "7245ca91b45b828ddb49456e9e0a895d79f1d739" }
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"networkx >=3.2.1,<4",
"pydantic >=2.7.0b1,<3",
"typing-extensions >=4.9.0,<5",
"hugr >=0.8.0,<0.9",
"hugr >=0.8.1,<0.9",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -53,8 +53,8 @@ members = ["execute_llvm"]
execute-llvm = { workspace = true }

# Uncomment these to test the latest dependency version during development
hugr = { git = "https://github.com/CQCL/hugr", subdirectory = "hugr-py", rev = "4cbe890ab4e72090708ff83592c0771caf2335df" }
tket2 = { git = "https://github.com/CQCL/tket2", subdirectory = "tket2-py", rev = "258a7c5ec25ee2665c524a174704944f0c19729e" }
#hugr = { git = "https://github.com/CQCL/hugr", subdirectory = "hugr-py", rev = "4cbe890ab4e72090708ff83592c0771caf2335df" }
tket2 = { git = "https://github.com/CQCL/tket2", subdirectory = "tket2-py", rev = "06a68386ce6d0b1376ed369da2a42d3b3eaa056a" }

[build-system]
requires = ["hatchling"]
Expand Down
2 changes: 1 addition & 1 deletion tests/error/array_errors/linear_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def main(qs: array[qubit, 42]) -> int:
return qs[0]


module.compile()
module.compile()
2 changes: 1 addition & 1 deletion tests/error/array_errors/linear_len.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def main(qs: array[qubit, 42]) -> int:
return len(qs)


module.compile()
module.compile()
1 change: 0 additions & 1 deletion tests/integration/test_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ def foo(x: int) -> int:
return x.__add__(2)

validate(module.compile())

16 changes: 10 additions & 6 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const BIN_NAME: &str = "hugr";
fn main() {
// Use `cargo install` to locally install the binary
let self_path = std::env::current_exe().unwrap();
let hugr_cli = if let Some(bin) = cached_bin_path(&BIN_NAME, &self_path) {
let hugr_cli = if let Some(bin) = cached_bin_path(BIN_NAME, &self_path) {
bin
} else {
cargo_install(PKG_NAME, BIN_NAME)
Expand All @@ -37,7 +37,7 @@ fn main() {
fn workspace_manifest() -> Result<Manifest, cargo_toml::Error> {
let pkg_root = env!("CARGO_MANIFEST_DIR");
let ws_root = PathBuf::from(pkg_root).join("..");
let ws_toml = PathBuf::from(ws_root).join("Cargo.toml");
let ws_toml = ws_root.join("Cargo.toml");
Manifest::from_path(&ws_toml)
}

Expand Down Expand Up @@ -87,7 +87,7 @@ fn cached_bin_path(bin_name: &str, self_path: &PathBuf) -> Option<PathBuf> {
.ok()?
.modified()
.unwrap();
let self_build_time = std::fs::symlink_metadata(&self_path)
let self_build_time = std::fs::symlink_metadata(self_path)
.ok()?
.modified()
.unwrap();
Expand All @@ -114,7 +114,7 @@ fn cargo_install(pkg: &str, bin_name: &str) -> PathBuf {
let mut cmd = std::process::Command::new("cargo");
cmd.arg("install")
.arg("--root")
.arg(&target_dir())
.arg(target_dir())
.arg("--quiet");

let pkg_name = match &dep {
Expand Down

0 comments on commit d43ae57

Please sign in to comment.