-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: switch to uv and nox #145
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 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ce98bf5
chore: switch to uv and nox
2bndy5 9a48ec2
fix test CI
2bndy5 ea7bd16
fix rtd config
2bndy5 4481ab3
fix docs CI
2bndy5 9704f93
mv getting-started info to CONTRIBUTING.md
2bndy5 bf602b3
review changes
2bndy5 41d9ac7
bump cargo deps
2bndy5 79e3b04
yarn upgrade
2bndy5 3fcd5cb
revert nox session name in rtd config
2bndy5 25b45cc
bump astral-sh/setup-uv action to v6
2bndy5 46cff6b
bump python deps
2bndy5 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
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
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,78 @@ | ||
# Contributing | ||
|
||
This project requires the following tools installed: | ||
|
||
- :simple-rust: [rust](https://rustup.rs/) | ||
- :simple-uv: [`uv` (Python Project management tool)](https://docs.astral.sh/uv/) | ||
|
||
## Getting started | ||
|
||
After checking out the repo locally, use | ||
|
||
```sh | ||
uv sync | ||
``` | ||
|
||
This creates a venv at ".venv/" in repo root (if it doesn't exist). | ||
It also installs dev dependencies like `pre-commit`, `nox`, `ruff`, and `mypy`. | ||
|
||
See [`uv sync` docs](https://docs.astral.sh/uv/reference/cli/#uv-sync) | ||
for more detailed usage. | ||
|
||
> [!TIP] | ||
> To register the pre-commit hooks, use: | ||
> | ||
> ```shell | ||
> uv run pre-commit install | ||
> ``` | ||
|
||
## Running tests | ||
|
||
First ensure that the following cargo-managed binaries are installed: | ||
|
||
- [`cargo-llvm-cov`](https://github.com/taiki-e/cargo-llvm-cov) | ||
- [`cargo-nextest`](https://nexte.st/docs/installation/pre-built-binaries/) | ||
- [`llvm-cov-pretty`](https://crates.io/crates/llvm-cov-pretty) is used only for the optional `nox -s pretty-cov` task. Without this installed, `nox -s llvm-cov` will suffice. | ||
|
||
Use nox to run tests: | ||
|
||
```sh | ||
uv run nox -s test | ||
``` | ||
|
||
Different test profiles are still defined in .config/nextest.toml. | ||
The above command uses the "default" profile, but to mimic the CI, use: | ||
|
||
```sh | ||
uv run nox -s test -- --profile ci | ||
``` | ||
|
||
To generate a coverage report: | ||
|
||
```sh | ||
uv run nox -s llvm-cov -- --open | ||
``` | ||
|
||
The `-- --open` part is optional. It opens the built coverage report in your default browser. | ||
|
||
The uploaded codecov report is generated with | ||
|
||
```sh | ||
uv run nox -s lcov | ||
``` | ||
|
||
## Generating docs | ||
|
||
To view the docs locally, use | ||
|
||
```sh | ||
uv run nox -s docs -- --open | ||
``` | ||
|
||
The `-- --open` part is optional. It opens the built docs in your default browser. | ||
|
||
In CI, docs are built using | ||
|
||
```sh | ||
uv run nox -s docs-build | ||
``` |
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.