-
Notifications
You must be signed in to change notification settings - Fork 1
New CLI to install clang-format and clang-tidy Python wheels #133
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
Merged
Merged
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
24eb2e7
feat: support install python wheels
shenxianpeng 1679bac
fix: Update python-test.yml to upload only clang-tools wheel
shenxianpeng f15f170
chore: save progress
shenxianpeng 84f20d3
fix: remove duplicate code
shenxianpeng 8736bd2
test: add test to test wheel
shenxianpeng a21141d
test: add condition to test
shenxianpeng 28994b0
test: add condition to test
shenxianpeng 036159c
docs: update readme
shenxianpeng 735240c
Update clang_tools/wheel.py
shenxianpeng 0f3c940
Update clang_tools/wheel.py
shenxianpeng d70b181
fix: add version_str to show version
shenxianpeng df41efc
fix: update dependencies and use public function
shenxianpeng 5d9b364
docs: udpate README.rst
shenxianpeng dd6befe
docs: udpate README.rst
shenxianpeng aa417d4
fix: add required=True and update test.yml
shenxianpeng 819ef8d
test: update to fix test
shenxianpeng a4f89d9
Update clang_tools/wheel.py
shenxianpeng a907e82
Update README.rst
shenxianpeng f9c71c8
fix: update if condition using fromJSON
shenxianpeng 1ab92d5
fix: skip 12.0.1
shenxianpeng 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,37 @@ | ||
| from argparse import ArgumentParser | ||
| from cpp_linter_hooks.util import resolve_install | ||
|
|
||
|
|
||
| def get_parser() -> ArgumentParser: | ||
| """Get a parser to interpret CLI args.""" | ||
| parser = ArgumentParser(description="Install specified clang tool wheel") | ||
| parser.add_argument( | ||
| "--tool", | ||
| default="clang-format", | ||
| required=True, | ||
| choices=["clang-format", "clang-tidy"], | ||
| help="Tool to install (clang-format or clang-tidy)", | ||
| ) | ||
shenxianpeng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| parser.add_argument( | ||
| "--version", | ||
| default=None, | ||
| help="Version to install (e.g., 21 or 21.1.2). Defaults to latest compatible version.", | ||
| ) | ||
| return parser | ||
|
|
||
|
|
||
| def main() -> int: | ||
| parser = get_parser() | ||
| args = parser.parse_args() | ||
| path = resolve_install(args.tool, args.version) | ||
| version_str = f" version {args.version}" if args.version else " latest version" | ||
| if path: | ||
| print(f"{args.tool}{version_str} installed at: {path}") | ||
| return 0 | ||
| else: | ||
| print(f"Failed to install {args.tool}{version_str}") | ||
| return 1 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| raise SystemExit(main()) | ||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -9,3 +9,6 @@ API Reference | |
|
|
||
| .. automodule:: clang_tools.util | ||
| :members: | ||
|
|
||
| .. automodule:: clang_tools.wheel | ||
| :members: | ||
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.