-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathjustfile
More file actions
104 lines (80 loc) · 2.97 KB
/
Copy pathjustfile
File metadata and controls
104 lines (80 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# https://just.systems
# Set shell for Windows OSs:
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
# use uv for [script] tasks:
set script-interpreter := ['uv', 'run', '--script']
default:
@just --list
init:
stubber clone
alias docs := docstubs
docstubs v="stable":
stubber docstubs --version {{v}}
stdlib:
python publish/micropython-stdlib-stubs/build.py
[script]
publish_stdlib:
# /// script
# requires-python = ">=3.9"
# dependencies = ["keyring"]
# ///
import keyring
import subprocess
import sys
print(f"Publishing micropython-stdlib-stubs to pypi")
token = keyring.get_password("pypi", "uv_publish")
if not token:
sys.exit(f"No pypi token found in keyring")
subprocess.run(
["uv", "publish", "--token", token, ],
check=True,
cwd="publish/micropython-stdlib-stubs",
)
frozen v="stable":
stubber frozen --version {{v}}
merge_all v="stable":
stubber merge --port all --board all --version {{v}}
build_all v="stable":
stubber build --port all --board all --version {{v}}
publish_all v="stable":
stubber publish --port all --board all --version {{v}}
# build stubs for a specific port
port p="rp2" v="stable" b="all":
stubber docstubs --version {{v}}
stubber get-frozen --version {{v}}
stubber merge --port {{p}} --board {{b}} --version {{v}}
stubber build --port {{p}} --board {{b}} --version {{v}}
update_stubs v="stable":
@just port all {{v}} all
@just stdlib
# install all supported type-checkers and linters into the active venv (uv)
install-linters:
uv pip install pyright mypy ruff basilisk-python
# clear the pytest cache
clear-cache:
pytest -m snippets --cache-clear
# run all snippet quality tests (pass extra pytest args, e.g. `just test --cache-clear`)
test *args="":
pytest -m snippets {{args}}
# run snippet tests for the current stable release only
test-stable *args="":
pytest -m snippets --stable-only {{args}}
# run snippet tests for the most recent preview build
test-preview *args="":
pytest -m snippets --preview-only {{args}}
# run snippet tests for the last 3 stable major.minor releases
test-recent *args="":
pytest -m snippets --recent-majors {{args}}
# run snippet tests for a single linter (pyright|mypy|ruff) on the stable release
test-linter linter="pyright" *args="":
pytest -m snippets --stable-only -k "{{linter}}" {{args}}
# run snippet tests for a basilisk and show the xfail output (basilisk is experimental and may fail on some stubs)
test-basilisk *args="":
pytest -m snippets --stable-only --no-cache -k "basilisk" --runxfail -rA {{args}}
# run snippet tests for a specific version (e.g. `just test-version v1.28.0`)
test-version version="v1.28.0" *args="":
pytest -m snippets -k "{{version}}" {{args}}
release version commit :
git tag {{version}} {{commit}}
git push origin {{version}}
gh release create {{version}} --title "MicroPython Stubs {{version}}" --draft --generate-notes