-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor to avoid duplication of config-file source of metadata #141
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
Changes from 5 commits
17cf57c
0da5b14
a44fc5d
390d673
e28a8fa
2f3dff4
b9df9b8
8ed2442
a570f43
995399c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |
|
|
||
| from autorelease.scripts.vendor import vendor_actions | ||
| from autorelease.scripts.check import run_checks | ||
| from autorelease.utils import split_setup_cfg_path | ||
| from autorelease.version import get_setup_name, get_setup_version | ||
| # from autorelease import ReleaseNoteWriter | ||
| from autorelease.gh_api4.notes4 import NotesWriter, prs_since_latest_release | ||
|
|
||
|
|
@@ -77,6 +79,40 @@ def auth(auth): | |
| auth = load_auth(auth) | ||
| pprint(auth) | ||
|
|
||
| @cli.group() | ||
| def metadata(): | ||
| pass | ||
|
|
||
|
|
||
| @metadata.command(name="version") | ||
| @click.option("-c", "--conf", type=str, default="setup.cfg", | ||
| help="setup.cfg file to use") | ||
| def metadata_version(conf): | ||
| directory, filename = split_setup_cfg_path(conf) | ||
| value = get_setup_version(None, directory=directory, filename=filename) | ||
| field = "version" | ||
|
|
||
| if value is None: | ||
| raise click.ClickException( | ||
| f"Missing [metadata] {field} in {conf}" | ||
| ) | ||
|
dwhswenson marked this conversation as resolved.
dwhswenson marked this conversation as resolved.
dwhswenson marked this conversation as resolved.
|
||
| click.echo(value) | ||
|
|
||
|
|
||
| @metadata.command(name="name") | ||
| @click.option("-c", "--conf", type=str, default="setup.cfg", | ||
| help="setup.cfg file to use") | ||
| def metadata_name(conf): | ||
| directory, filename = split_setup_cfg_path(conf) | ||
| value = get_setup_name(None, directory=directory, filename=filename) | ||
| field = "name" | ||
|
|
||
| if value is None: | ||
| raise click.ClickException( | ||
| f"Missing [metadata] {field} in {conf}" | ||
| ) | ||
|
dwhswenson marked this conversation as resolved.
dwhswenson marked this conversation as resolved.
dwhswenson marked this conversation as resolved.
|
||
| click.echo(value) | ||
|
Comment on lines
+89
to
+136
|
||
|
|
||
|
|
||
| @cli.command() | ||
| @click.option('--conf', type=click.File('r')) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.