-
-
Notifications
You must be signed in to change notification settings - Fork 25
Move from doit to just
#160
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 all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2fbea1f
Add a justfile with targets from doit
FollowTheProcess 655fa5f
Use just in GitHub actions
FollowTheProcess dcdbcfd
Fix label for default recipe in justfile
FollowTheProcess f1ec60f
Fix `cargo.toml` case
FollowTheProcess f56b460
Include reference to just in contributing guide
FollowTheProcess c758521
Make suggested review changes
FollowTheProcess dd81af7
Fix typo in dot-sag help string
FollowTheProcess 7b38c87
Fix help string of man just target
FollowTheProcess ae6680f
Update Dockerfile, ensure compatible python and remove doit
FollowTheProcess 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 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 |
|---|---|---|
| @@ -1,7 +1,11 @@ | ||
| FROM mcr.microsoft.com/vscode/devcontainers/rust:1 | ||
|
|
||
| RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
| && apt-get -y install --no-install-recommends graphviz pandoc python3-doit python3-dev python3-venv python3-pip | ||
| && apt-get -y install --no-install-recommends graphviz pandoc python3-dev python3-venv python3-pip | ||
|
|
||
| RUN python3 -m pip install --disable-pip-version-check --quiet scriv \ | ||
| && rm -rf ~/.local/pip | ||
|
|
||
| USER vscode | ||
|
|
||
| RUN cargo install just |
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 |
|---|---|---|
|
|
@@ -4,5 +4,4 @@ | |
| __pycache__ | ||
| .venv | ||
| .pytest_cache | ||
| .doit.db | ||
| *.tar.xz | ||
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,41 @@ | ||
| <!-- | ||
| A new scriv changelog fragment. | ||
|
|
||
| Uncomment the section that is right (remove the HTML comment wrapper). | ||
| --> | ||
|
|
||
| <!-- | ||
| ### Removed | ||
|
|
||
| - A bullet item for the Removed category. | ||
|
|
||
| --> | ||
| <!-- | ||
| ### Added | ||
|
|
||
| - A bullet item for the Added category. | ||
|
|
||
| --> | ||
|
|
||
| ### Changed | ||
|
|
||
| - Replace doit with [just](https://github.com/casey/just) as a command runner. | ||
|
|
||
| <!-- | ||
| ### Deprecated | ||
|
|
||
| - A bullet item for the Deprecated category. | ||
|
|
||
| --> | ||
| <!-- | ||
| ### Fixed | ||
|
|
||
| - A bullet item for the Fixed category. | ||
|
|
||
| --> | ||
| <!-- | ||
| ### Security | ||
|
|
||
| - A bullet item for the Security category. | ||
|
|
||
| --> |
This file was deleted.
Oops, something went wrong.
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,80 @@ | ||
| #!/usr/bin/env just --justfile | ||
| # Written for https://github.com/casey/just/tree/0.10.2 . | ||
|
|
||
| ROOT := justfile_directory() | ||
| DOCS := join(ROOT, "docs") | ||
| MAN_DIR := join(DOCS, "man-page") | ||
| MAN_MD := join(MAN_DIR, "py.1.md") | ||
| MAN_FILE := join(MAN_DIR, "py.1") | ||
| CARGO_TOML := join(ROOT, "Cargo.toml") | ||
| DOT_DIR := join(DOCS, "control-flow") | ||
| DOT_FILE := join(DOT_DIR, "control_flow.dot") | ||
| DOT_FILE_NO_STEM := without_extension(DOT_FILE) | ||
| DOT_SVG := DOT_FILE_NO_STEM + ".svg" | ||
| DOT_PNG := DOT_FILE_NO_STEM + ".png" | ||
|
|
||
| # TODO: `just` release after 0.10.2 will make `join` accept variadic parameters; | ||
| # would clean up the variables quite a bit. | ||
|
|
||
| # Set default recipes | ||
| _default: lint test man dot | ||
|
|
||
| # Run the unit tests | ||
| test: | ||
| cargo --quiet test | ||
|
|
||
| # Run linting on source files | ||
| lint: | ||
| cargo fmt --quiet --all -- --check | ||
| cargo clippy --quiet --all-targets --all-features -- -D warnings | ||
|
|
||
| # Install from source | ||
| install: | ||
| cargo install --quiet --path . | ||
|
|
||
| # Convert the markdown-formatted man page to the man file format | ||
| _man-md: | ||
| pandoc {{ MAN_MD }} --standalone -t man -o {{ MAN_FILE }} | ||
|
|
||
| # Build the man page | ||
| man: _man-md | ||
| #!/usr/bin/env python3 | ||
|
|
||
| import datetime | ||
| import pathlib | ||
| import re | ||
|
|
||
| VERSION_REGEX = re.compile(r'version\s*=\s*"(?P<version>[\d.]+)"') | ||
|
|
||
| with open("{{ CARGO_TOML }}", "r", encoding="utf-8") as file: | ||
| cargo_lines = file.readlines() | ||
|
|
||
| for line in cargo_lines: | ||
| version_match = VERSION_REGEX.match(line) | ||
| if version_match: | ||
| version = version_match.group("version") | ||
| break | ||
| else: | ||
| raise ValueError("'version' not found in {{ CARGO_TOML }}") | ||
|
|
||
| with open("{{ MAN_FILE }}", "r", encoding="utf-8") as file: | ||
| man_text = file.read() | ||
|
|
||
| man_text_with_version = man_text.replace("LAUNCHER_VERSION", version) | ||
| new_man_text = man_text_with_version.replace( | ||
| "CURRENT_DATE", datetime.date.today().isoformat() | ||
| ) | ||
|
|
||
| with open("{{ MAN_FILE }}", "w", encoding="utf-8") as file: | ||
| file.write(new_man_text) | ||
|
|
||
| # Build the control flow diagram as a SVG | ||
| dot_svg: | ||
| dot -T "svg" -o {{ DOT_SVG }} {{ DOT_FILE }} | ||
|
|
||
| # Build the control flow diagram as a PNG | ||
| dot_png: | ||
| dot -T "png" -o {{ DOT_PNG }} {{ DOT_FILE }} | ||
|
|
||
| # Build the control flow diagram | ||
| dot: dot_svg dot_png | ||
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.