Skip to content

Commit ce98bf5

Browse files
committed
chore: switch to uv and nox
- Removes `just` as the default task runner in favor of `nox`. - Uses `uv` to manage dependencies, which is also used by `nox`. - Updated CI and docs/README accordingly. - Removed all requirements.txt files in favor of using `uv` to lock dependencies. - Modified dependabot config to use the new uv.lock file. - Modified RTD config to use `uv` and `nox`.
1 parent 851a435 commit ce98bf5

File tree

18 files changed

+1272
-133
lines changed

18 files changed

+1272
-133
lines changed

.config/.readthedocs.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ build:
1010
tools:
1111
rust: latest
1212
python: latest
13-
14-
mkdocs:
15-
configuration: docs/mkdocs.yml
16-
17-
18-
# Optionally declare the Python requirements required to build your docs
19-
20-
python:
21-
install:
22-
- requirements: docs/requirements.txt
23-
- method: pip
24-
path: docs/
13+
jobs:
14+
pre_create_environment:
15+
- asdf plugin add uv
16+
- asdf install uv latest
17+
- asdf global uv latest
18+
build:
19+
html:
20+
- uvx nox -s docs-build
21+
post_build:
22+
- mkdir -p $READTHEDOCS_OUTPUT/html/
23+
- mv docs/site $READTHEDOCS_OUTPUT/html/

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ updates:
1313
actions:
1414
patterns:
1515
- "*"
16-
- package-ecosystem: pip
16+
- package-ecosystem: uv
1717
directory: /
1818
schedule:
1919
interval: "weekly"
2020
groups:
21-
pip:
21+
uv-pip:
2222
patterns:
2323
- "*"
2424
- package-ecosystem: cargo

.github/workflows/build-docs.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,14 @@ jobs:
4848
with:
4949
path: ~/.cargo
5050
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }}
51-
- uses: actions/setup-python@v5
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@v5
5253
with:
53-
python-version: 3.x
54-
cache: 'pip'
55-
cache-dependency-path: docs/requirements.txt
56-
- name: Install workflow deps
57-
run: |
58-
pip install -r docs/requirements.txt
59-
pip install --force-reinstall -v docs/
54+
enable-cache: true
55+
cache-dependency-glob: "uv.lock"
6056
- name: Build docs
6157
working-directory: docs
62-
run: mkdocs build
58+
run: uvx nox -s docs-build
6359
- name: Upload docs build as artifact
6460
uses: actions/upload-artifact@v4
6561
with:
@@ -84,11 +80,9 @@ jobs:
8480
with:
8581
path: ~/.cargo
8682
key: ${{ runner.os }}-docs-cargo-${{ hashFiles('Cargo.lock') }}
87-
- name: Install just
88-
uses: taiki-e/install-action@v2
89-
with:
90-
tool: just
91-
- run: just docs-rs
83+
- name: Install uv
84+
uses: astral-sh/setup-uv@v5
85+
- run: uvx nox -s docs-rs
9286
- name: upload rustdoc build as artifact
9387
uses: actions/upload-artifact@v4
9488
with:

.github/workflows/bump-n-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
workflow_dispatch:
1313
inputs:
1414
component:
15+
description: The version component to increase
1516
type: choice
1617
required: true
1718
default: patch

.github/workflows/run-dev-tests.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ jobs:
5656
with:
5757
python-version: 3.x
5858

59-
- name: Install workflow deps
60-
run: python3 -m pip install meson
59+
- name: Install uv
60+
uses: astral-sh/setup-uv@v5
61+
with:
62+
enable-cache: true
63+
cache-dependency-glob: "uv.lock"
6164

6265
# # https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages
6366
- name: Install ninja (Linux)
@@ -88,7 +91,7 @@ jobs:
8891
if: runner.os == 'Linux'
8992
env:
9093
CLANG_VERSION: '7'
91-
run: just test ci
94+
run: uvx nox -s test -- --profile ci
9295

9396
- name: Install clang v8
9497
if: runner.os == 'Linux'
@@ -100,7 +103,7 @@ jobs:
100103
if: runner.os == 'Linux'
101104
env:
102105
CLANG_VERSION: '8'
103-
run: just test ci
106+
run: uvx nox -s test -- --profile ci
104107

105108
- name: Install clang v9
106109
uses: ./.github/install-clang-action
@@ -110,7 +113,7 @@ jobs:
110113
- name: Collect Coverage for clang v9
111114
env:
112115
CLANG_VERSION: '9'
113-
run: just test ci
116+
run: uvx nox -s test -- --profile ci
114117

115118
- name: Install clang v10
116119
uses: ./.github/install-clang-action
@@ -120,7 +123,7 @@ jobs:
120123
- name: Collect Coverage for clang v10
121124
env:
122125
CLANG_VERSION: '10'
123-
run: just test ci
126+
run: uvx nox -s test -- --profile ci
124127

125128
- name: Install clang 11
126129
uses: ./.github/install-clang-action
@@ -130,7 +133,7 @@ jobs:
130133
- name: Collect Coverage for clang v11
131134
env:
132135
CLANG_VERSION: '11'
133-
run: just test ci
136+
run: uvx nox -s test -- --profile ci
134137

135138
- name: Install clang 12
136139
uses: ./.github/install-clang-action
@@ -140,7 +143,7 @@ jobs:
140143
- name: Collect Coverage for clang v12
141144
env:
142145
CLANG_VERSION: '12'
143-
run: just test ci
146+
run: uvx nox -s test -- --profile ci
144147

145148
- name: Install clang 13
146149
uses: ./.github/install-clang-action
@@ -150,7 +153,7 @@ jobs:
150153
- name: Collect Coverage for clang v13
151154
env:
152155
CLANG_VERSION: '13'
153-
run: just test ci
156+
run: uvx nox -s test -- --profile ci
154157

155158
- name: Install clang 14
156159
uses: ./.github/install-clang-action
@@ -160,7 +163,7 @@ jobs:
160163
- name: Collect Coverage for clang v14
161164
env:
162165
CLANG_VERSION: '14'
163-
run: just test ci
166+
run: uvx nox -s test -- --profile ci
164167

165168
- name: Install clang 15
166169
uses: ./.github/install-clang-action
@@ -170,7 +173,7 @@ jobs:
170173
- name: Collect Coverage for clang v15
171174
env:
172175
CLANG_VERSION: '15'
173-
run: just test ci
176+
run: uvx nox -s test -- --profile ci
174177

175178
- name: Install clang 16
176179
uses: ./.github/install-clang-action
@@ -180,7 +183,7 @@ jobs:
180183
- name: Collect Coverage for clang v16
181184
env:
182185
CLANG_VERSION: '16'
183-
run: just test ci
186+
run: uvx nox -s test -- --profile ci
184187

185188
- name: Install clang 17
186189
uses: ./.github/install-clang-action
@@ -190,7 +193,7 @@ jobs:
190193
- name: Collect Coverage for clang v17
191194
env:
192195
CLANG_VERSION: '17'
193-
run: just test ci
196+
run: uvx nox -s test -- --profile ci
194197

195198
- name: Install clang 18
196199
uses: ./.github/install-clang-action
@@ -200,10 +203,10 @@ jobs:
200203
- name: Collect Coverage for clang v18
201204
env:
202205
CLANG_VERSION: '18'
203-
run: just test all
206+
run: uvx nox -s test -- --profile all
204207

205208
- name: Generate Coverage HTML report
206-
run: just pretty-cov
209+
run: uvx nox -s pretty-cov
207210

208211
- name: Upload coverage data
209212
uses: actions/upload-artifact@v4
@@ -214,7 +217,7 @@ jobs:
214217
- name: Generate Coverage lcov report
215218
run: |
216219
rm coverage.json
217-
just lcov
220+
uvx nox -s lcov
218221
219222
- uses: codecov/codecov-action@v5
220223
with:

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/python/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ cpp-linter -help
5050
| `Cargo.toml` | Metadata about the binding's rust package (which _is not_ intended to be published to crates.io). |
5151
| `../../cpp_linter.pyi` | The typing stubs for the package (located in repo root). |
5252
| `../../pyproject.toml` | Metadata about the python package (located in repo root). |
53-
| `requirements-dev.txt` | The dependencies used in development (not needed for runtime/production). |
5453

5554
Hidden files and folders are not described in the table above.
5655
If they are not ignored by a gitignore specification, then they should be considered

bindings/python/requirements-dev.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

cpp-linter/src/rest_api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ const MAX_RETRIES: u8 = 5;
221221
/// This method respects both primary and secondary rate limits.
222222
/// In the event where the secondary rate limits is reached,
223223
/// this function will wait for a time interval specified the server and retry afterward.
224-
async fn send_api_request(
224+
pub async fn send_api_request(
225225
client: &Client,
226226
request: Request,
227227
rate_limit_headers: &RestApiRateLimitHeaders,

cspell.config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ words:
77
- Boolish
88
- bugprone
99
- chrono
10+
- clippy
1011
- codecov
1112
- codspeed
1213
- consts
@@ -31,11 +32,13 @@ words:
3132
- mdbook
3233
- mkdocs
3334
- msvc
35+
- mypy
3436
- napi
3537
- nextest
3638
- nonminimal
3739
- peekable
3840
- pkgs
41+
- posargs
3942
- positionals
4043
- posix
4144
- preprocess
@@ -49,7 +52,11 @@ words:
4952
- ratelimit
5053
- reqwest
5154
- revparse
55+
- rustdoc
56+
- rustup
57+
- sdist
5258
- serde
59+
- Shen
5360
- superfences
5461
- tada
5562
- tasklist
@@ -58,6 +65,7 @@ words:
5865
- twemoji
5966
- vararg
6067
- venv
68+
- Xianpeng
6169
ignorePaths:
6270
- .env/**
6371
- .venv/**

docs/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
[package]
33
name = "cli-gen"
44
edition = "2021"
5-
version = "0.0.0"
65
description = "A function exposed in python that generates a CLI doc from rust source code."
76
repository = "https://github.com/cpp-linter/cpp-linter-rs/tree/main/docs"
7+
version.workspace = true
88
authors.workspace = true
9-
homepage.workspace = true
109
license.workspace = true
1110

1211
[dependencies]

docs/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# Docs
22

3-
This folder is only for generating the documentation.
3+
This folder is only for generating the documentation about CLI and runtime permissions.
44
Please [visit our website][gh-pages] to see generated documentation.
55

66
[gh-pages]: https://cpp-linter.github.io/cpp-linter-rs
7+
[uv]: https://docs.astral.sh/uv/
78

8-
To view the documentation locally, some software needs to be installed.
9+
## Build and inspect locally
910

10-
```shell
11-
pip install maturin
12-
cd docs
13-
maturin dev
14-
pip install -r docs/requirements.txt
15-
```
11+
To view the documentation locally, some software needs to be installed.
12+
This project's dependencies are managed with a tool called [`uv`][uv].
13+
So, [`uv`][uv] is the only software that needs to be manually installed beforehand.
1614

17-
Then use `mkdocs` to generate the docs and open them in your browser.
15+
After [`uv`][uv] is installed, building (and viewing) the docs is as simple as
1816

1917
```shell
20-
mkdocs serve --open
18+
uvx nox -s docs -- --open
2119
```

docs/pyproject.toml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,33 @@ build-backend = "maturin"
55
[project]
66
name = "cli-gen"
77
description = "Generate cpp-linter CLI doc from rust src."
8-
version = "0.0.0"
98
readme = "README.md"
109
license = {text = "MIT License"}
1110
requires-python = ">=3.7"
1211
authors = [
1312
{ name = "Brendan Doherty", email = "[email protected]" },
1413
]
14+
classifiers = ["Private :: Do Not Upload"]
15+
dynamic = ["version"]
1516

1617
[tool.maturin]
1718
features = ["pyo3/extension-module"]
19+
20+
[dependency-groups]
21+
dev = [
22+
"maturin>=1.8.6",
23+
"mypy>=1.15.0",
24+
"ruff>=0.11.11",
25+
]
26+
docs = [
27+
"markdown-gfm-admonition==0.1.1",
28+
"mkdocs==1.6.1",
29+
"mkdocs-gen-files==0.5.0",
30+
"mkdocs-include-markdown-plugin==7.1.5",
31+
"mkdocs-material==9.6.12",
32+
"pyyaml==6.0.2",
33+
]
34+
35+
[tool.uv]
36+
default-groups = "all"
37+
reinstall-package = ["cli-gen"]

docs/requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)