Skip to content

Commit ca9125c

Browse files
committed
Switch from click to argparse
1 parent b567ce8 commit ca9125c

File tree

6 files changed

+1261
-551
lines changed

6 files changed

+1261
-551
lines changed

docs/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"sphinx.ext.intersphinx",
3838
"sphinx.ext.napoleon",
3939
"myst_parser",
40-
"sphinx_click",
4140
]
4241

4342
try:
Lines changed: 257 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,260 @@
11
# Releaser CLI
22

3-
```{click} jupyter_releaser.cli:main
4-
:prog: jupyter-releaser
5-
:nested: full
3+
The `jupyter-releaser` command-line interface provides tools for managing releases.
4+
5+
## Usage
6+
7+
```bash
8+
jupyter-releaser [--force] <command> [options]
69
```
10+
11+
### Global Options
12+
13+
- `--force`: Force a command to run even when skipped by config
14+
15+
## Commands
16+
17+
### list-envvars
18+
19+
List the environment variables used by the releaser.
20+
21+
### prep-git
22+
23+
Prep git and environment variables.
24+
25+
**Options:**
26+
27+
- `--ref`: The source reference (env: `RH_REF`)
28+
- `--branch`: The target branch (env: `RH_BRANCH`)
29+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
30+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
31+
- `--username`: The git username (env: `GITHUB_ACTOR`)
32+
- `--git-url`: A custom url for the git repository
33+
34+
### bump-version
35+
36+
Bump the version.
37+
38+
**Options:**
39+
40+
- `--version-spec`: The new version specifier (env: `RH_VERSION_SPEC`)
41+
- `--version-cmd`: The version command (env: `RH_VERSION_COMMAND`)
42+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
43+
- `--python-packages`: The list of strings of the form "path_to_package:name_of_package" (env: `RH_PYTHON_PACKAGES`)
44+
- `--tag-format`: The format to use for the release tag (env: `RH_TAG_FORMAT`, default: `v{version}`)
45+
46+
### build-changelog
47+
48+
Build changelog entry.
49+
50+
**Options:**
51+
52+
- `--ref`: The source reference (env: `RH_REF`)
53+
- `--branch`: The target branch (env: `RH_BRANCH`)
54+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
55+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
56+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
57+
- `--since`: Use PRs with activity since this date or git reference (env: `RH_SINCE`)
58+
- `--since-last-stable`: Use PRs with activity since the last stable git tag (env: `RH_SINCE_LAST_STABLE`)
59+
- `--resolve-backports`: Resolve backport PRs to their originals (env: `RH_RESOLVE_BACKPORTS`, default: `True`)
60+
61+
### draft-changelog
62+
63+
Create a changelog entry PR.
64+
65+
**Options:**
66+
67+
- `--version-spec`: The new version specifier (env: `RH_VERSION_SPEC`)
68+
- `--ref`: The source reference (env: `RH_REF`)
69+
- `--branch`: The target branch (env: `RH_BRANCH`)
70+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
71+
- `--since`: Use PRs with activity since this date or git reference (env: `RH_SINCE`)
72+
- `--since-last-stable`: Use PRs with activity since the last stable git tag (env: `RH_SINCE_LAST_STABLE`)
73+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
74+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
75+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
76+
- `--post-version-spec`: The post release version (usually dev) (env: `RH_POST_VERSION_SPEC`)
77+
- `--post-version-message`: The post release message (env: `RH_POST_VERSION_MESSAGE`, default: `Bumped version to {post_version}`)
78+
- `--silent`: Set a placeholder in the changelog (env: `RH_SILENT`)
79+
- `--tag-format`: The format to use for the release tag (env: `RH_TAG_FORMAT`, default: `v{version}`)
80+
81+
### extract-changelog
82+
83+
Extract the changelog entry.
84+
85+
**Options:**
86+
87+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
88+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
89+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
90+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
91+
- `--silent`: Set a placeholder in the changelog (env: `RH_SILENT`)
92+
93+
### build-python
94+
95+
Build Python dist files.
96+
97+
**Options:**
98+
99+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
100+
- `--python-packages`: The list of strings of the form "path_to_package:name_of_package" (env: `RH_PYTHON_PACKAGES`)
101+
102+
### check-python
103+
104+
Check Python dist files.
105+
106+
**Options:**
107+
108+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
109+
- `--check-imports`: The Python packages import to check for (env: `RH_CHECK_IMPORTS`)
110+
- `--pydist-check-cmd`: The command to use to check a python distribution file (env: `RH_PYDIST_CHECK_CMD`)
111+
- `--pydist-extra-check-cmds`: Extra checks to run against the pydist file (env: `RH_EXTRA_PYDIST_CHECK_CMDS`)
112+
- `--pydist-resource-paths`: Resource paths that should be available when installed (env: `RH_PYDIST_RESOURCE_PATHS`)
113+
114+
### build-npm
115+
116+
Build npm package.
117+
118+
**Arguments:**
119+
120+
- `package`: The package to build (default: `.`)
121+
122+
**Options:**
123+
124+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
125+
126+
### check-npm
127+
128+
Check npm package.
129+
130+
**Options:**
131+
132+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
133+
- `--npm-install-options`: Options to pass when calling npm install (env: `RH_NPM_INSTALL_OPTIONS`)
134+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
135+
136+
### tag-release
137+
138+
Create release commit and tag.
139+
140+
**Options:**
141+
142+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
143+
- `--tag-format`: The format to use for the release tag (env: `RH_TAG_FORMAT`, default: `v{version}`)
144+
- `--release-message`: The message to use for the release commit (env: `RH_RELEASE_MESSAGE`, default: `Publish {version}`)
145+
- `--tag-message`: The message to use for the release tag (env: `RH_TAG_MESSAGE`, default: `Release {tag_name}`)
146+
- `--no-git-tag-workspace`: Whether to skip tagging npm workspace packages
147+
148+
### populate-release
149+
150+
Populate a release.
151+
152+
**Arguments:**
153+
154+
- `assets`: Asset files to upload
155+
156+
**Options:**
157+
158+
- `--ref`: The source reference (env: `RH_REF`)
159+
- `--branch`: The target branch (env: `RH_BRANCH`)
160+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
161+
- `--version-cmd`: The version command (env: `RH_VERSION_COMMAND`)
162+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
163+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
164+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
165+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
166+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
167+
- `--post-version-spec`: The post release version (usually dev) (env: `RH_POST_VERSION_SPEC`)
168+
- `--post-version-message`: The post release message (env: `RH_POST_VERSION_MESSAGE`)
169+
- `--silent`: Set a placeholder in the changelog (env: `RH_SILENT`)
170+
- `--tag-format`: The format to use for the release tag (env: `RH_TAG_FORMAT`, default: `v{version}`)
171+
172+
### delete-release
173+
174+
Delete a draft GitHub release by url to the release page.
175+
176+
**Options:**
177+
178+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
179+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
180+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
181+
182+
### extract-release
183+
184+
Download and verify assets from a draft GitHub release.
185+
186+
**Options:**
187+
188+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
189+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
190+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
191+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
192+
193+
### publish-assets
194+
195+
Publish release asset(s).
196+
197+
**Options:**
198+
199+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
200+
- `--dist-dir`: The folder to use for dist files (env: `RH_DIST_DIR`, default: `dist`)
201+
- `--npm-token`: A token for the npm release (env: `NPM_TOKEN`)
202+
- `--npm-cmd`: The command to run for npm release (env: `RH_NPM_COMMAND`, default: `npm publish`)
203+
- `--twine-cmd`: The twine command to run for Python release (env: `TWINE_COMMAND`, default: `pipx run twine upload`)
204+
- `--npm-registry`: The npm registry to target for publishing (env: `NPM_REGISTRY`, default: `https://registry.npmjs.org/`)
205+
- `--twine-repository-url`: The pypi registry to target for publishing (env: `TWINE_REPOSITORY_URL`, default: `https://upload.pypi.org/legacy/`)
206+
- `--npm-tag`: The npm tag (env: `NPM_TAG`)
207+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
208+
- `--python-packages`: The list of strings of the form "path_to_package:name_of_package" (env: `RH_PYTHON_PACKAGES`)
209+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
210+
211+
### publish-release
212+
213+
Publish GitHub release.
214+
215+
**Options:**
216+
217+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
218+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
219+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
220+
- `--silent`: Set a placeholder in the changelog (env: `RH_SILENT`)
221+
222+
### ensure-sha
223+
224+
Ensure that a sha has not changed.
225+
226+
**Options:**
227+
228+
- `--ref`: The source reference (env: `RH_REF`)
229+
- `--branch`: The target branch (env: `RH_BRANCH`)
230+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
231+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
232+
- `--expected-sha`: The expected sha of the branch HEAD (env: `RH_EXPECTED_SHA`)
233+
234+
### forwardport-changelog
235+
236+
Forwardport Changelog Entries to the Default Branch.
237+
238+
**Options:**
239+
240+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
241+
- `--ref`: The source reference (env: `RH_REF`)
242+
- `--branch`: The target branch (env: `RH_BRANCH`)
243+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
244+
- `--username`: The git username (env: `GITHUB_ACTOR`)
245+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
246+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)
247+
- `--release-url`: A draft GitHub release url (env: `RH_RELEASE_URL`)
248+
249+
### publish-changelog
250+
251+
Remove changelog placeholder entries.
252+
253+
**Options:**
254+
255+
- `--auth`: The GitHub auth token (env: `GITHUB_ACCESS_TOKEN`)
256+
- `--ref`: The source reference (env: `RH_REF`)
257+
- `--branch`: The target branch (env: `RH_BRANCH`)
258+
- `--repo`: The git repo (env: `RH_REPOSITORY`)
259+
- `--changelog-path`: The path to changelog file (env: `RH_CHANGELOG`, default: `CHANGELOG.md`)
260+
- `--dry-run`: Run as a dry run (env: `RH_DRY_RUN`)

0 commit comments

Comments
 (0)