-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tket2-hseries): cli extension dumping #584
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e997eca
wip
doug-q c14792b
Merge remote-tracking branch 'origin/main' into doug/tket2-hseries-cli
ss2165 7bc2fb5
fix!: quantum extension name wrong way round (#582)
ss2165 988f5d5
fix and format
ss2165 bf1462a
Merge branch 'main' into doug/tket2-hseries-cli
ss2165 931bacf
Merge remote-tracking branch 'origin/main' into doug/tket2-hseries-cli
ss2165 1cf7ed8
Merge remote-tracking branch 'origin/main' into doug/tket2-hseries-cli
ss2165 3da95ff
Merge branch 'main' into doug/tket2-hseries-cli
ss2165 5729d2b
feat: hseries cli command for dumping extensions
ss2165 7141d51
justfile command and generate extensions jsons
ss2165 6a3d951
add extensions change check to ci
ss2165 57f5465
add angle extension to generated registry
ss2165 948273b
regen with hseries reqs
ss2165 a68bde5
remove extensions.rs
ss2165 c784e17
remove pass running from cli
ss2165 8bed3a3
remove unused file
ss2165 bdc164c
add just setup to ci
ss2165 ef9f076
add rust toolchain
ss2165 e600f68
cleanup deps and docstrng
ss2165 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! CLI for tket2-hseries | ||
|
||
use clap::Parser as _; | ||
use hugr::extension::ExtensionRegistry; | ||
use tket2_hseries::cli::CliArgs; | ||
|
||
fn main() { | ||
match CliArgs::parse() { | ||
CliArgs::GenExtensions(args) => { | ||
let reg = ExtensionRegistry::try_new([ | ||
tket2::extension::TKET2_EXTENSION.to_owned(), | ||
tket2::extension::angle::ANGLE_EXTENSION.to_owned(), | ||
tket2_hseries::extension::hseries::EXTENSION.to_owned(), | ||
tket2_hseries::extension::futures::EXTENSION.to_owned(), | ||
tket2_hseries::extension::result::EXTENSION.to_owned(), | ||
]) | ||
.unwrap(); | ||
|
||
args.run_dump(®); | ||
} | ||
_ => { | ||
eprintln!("Unknown command"); | ||
std::process::exit(1); | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//! CLI tools for tket2-hseries. | ||
|
||
use clap::Parser; | ||
|
||
/// CLI arguments. | ||
#[derive(Parser, Debug)] | ||
#[clap(version = "1.0", long_about = None)] | ||
#[clap(about = "tket2-hseries CLI tools.")] | ||
#[group(id = "tket2-hseries")] | ||
#[non_exhaustive] | ||
pub enum CliArgs { | ||
/// Generate serialized extensions. | ||
GenExtensions(hugr_cli::extensions::ExtArgs), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To extend the hugr cli this should be called something prefixed with
hugr-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this naturally extends the hugr cli, I think its fine stand alone for now. It's main use is within the repo anyway (using the justfile)