feat: add reusable GitHub Release binary installer framework#325
Merged
feat: add reusable GitHub Release binary installer framework#325
Conversation
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: de5dc58 | Previous: 67fa7ca | Ratio |
|---|---|---|---|
tests/benchmarks/test_bench_core.py::test_bench_greet_default |
8915740.663347503 iter/sec (stddev: 1.045047665948324e-8) |
8028010.666531343 iter/sec (stddev: 1.2844789793973327e-8) |
0.90 |
tests/benchmarks/test_bench_core.py::test_bench_greet_with_name |
8984220.838640621 iter/sec (stddev: 1.0655546739217191e-8) |
8555061.455777109 iter/sec (stddev: 1.0720310573196015e-8) |
0.95 |
tests/benchmarks/test_bench_core.py::test_bench_greet_long_name |
5401220.5019876035 iter/sec (stddev: 1.756926515539787e-8) |
5405940.513984225 iter/sec (stddev: 2.9791131609054912e-8) |
1.00 |
tests/benchmarks/test_bench_logging.py::test_bench_get_logger |
1672708.3804903491 iter/sec (stddev: 2.5689462554489816e-7) |
1626518.8868520118 iter/sec (stddev: 2.7748832059429893e-7) |
0.97 |
tests/benchmarks/test_bench_logging.py::test_bench_setup_logging |
495741.12334466365 iter/sec (stddev: 5.093802226899766e-7) |
506261.6526102393 iter/sec (stddev: 4.610588757791842e-7) |
1.02 |
This comment was automatically generated by workflow using github-action-benchmark.
chmod is a no-op on Windows, so the permission assertion fails.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Extract the inline direnv installation logic from
tools/doit/install.pyinto a reusable framework (tools/doit/install_tools.py) with 5 public functions for installing any tool from GitHub releases. Refactor the existingtask_install_direnvto use the new framework.Related Issue
Addresses #293
Type of Change
Changes Made
tools/doit/install_tools.pywith 5 public functions:get_latest_github_release()- query GitHub API for latest release versionget_install_dir()- return standard~/.local/binpath, creating if neededdownload_github_release_binary()- download and chmod a release assetinstall_tool()- orchestrate check-or-install for a named toolcreate_install_task()- factory that returns a doit task dicttools/doit/install.pyto remove inline helpers and usecreate_install_task()for the direnv tasktests/test_doit_install_tools.pywith 20 tests covering all 5 public functionsTesting
Checklist
doit format)doit lint)doit type_check)doit test)Additional Notes
The framework uses
urllib.request(stdlib only) to avoid adding dependencies. macOS falls back tobrew installfor all tools; Linux downloads the binary directly from GitHub releases. Theasset_patternsdict makes it straightforward to add new tools by defining only the platform-specific asset filenames.