Skip to content

Commit bc5569c

Browse files
Enable envvar usage for click options
This was incorrectly removed in [1]. [1]: 9c56374 Signed-off-by: Marcel Bochtler <[email protected]>
1 parent 4a91a4d commit bc5569c

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/python_inspector/resolve_cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def print_version(ctx, param, value):
9090
@click.option(
9191
"--index-url",
9292
"index_urls",
93+
envvar="PYINSP_INDEX_URL",
9394
type=str,
9495
metavar="INDEX",
9596
show_default=True,
@@ -122,6 +123,7 @@ def print_version(ctx, param, value):
122123
"--netrc",
123124
"netrc_file",
124125
type=click.Path(exists=True, readable=True, path_type=str, dir_okay=False),
126+
envvar="PYINSP_NETRC_FILE",
125127
metavar="NETRC-FILE",
126128
hidden=True,
127129
required=False,
@@ -163,6 +165,7 @@ def print_version(ctx, param, value):
163165
)
164166
@click.option(
165167
"--verbose",
168+
envvar="PYINSP_VERBOSE",
166169
is_flag=True,
167170
help="Enable verbose debug output.",
168171
)

tests/data/single-url-env-var-except-simple-expected.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"tool_name": "python-inspector",
44
"tool_homepageurl": "https://github.com/aboutcode-org/python-inspector",
55
"options": [
6-
"--index-url https://pypi.org/simple",
6+
"--index-url https://thirdparty.aboutcode.org/pypi/simple/",
77
"--json <file>",
88
"--operating-system linux",
99
"--python-version 38",

tests/data/tilde_req-expected-env.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"tool_homepageurl": "https://github.com/aboutcode-org/python-inspector",
55
"options": [
66
"--index-url https://pypi.org/simple",
7+
"--index-url https://thirdparty.aboutcode.org/pypi/simple",
78
"--json <file>",
89
"--operating-system linux",
910
"--python-version 38",

0 commit comments

Comments
 (0)