add pre-release option to venv-add, closes #6
This commit is contained in:
parent
8c23374f67
commit
7736200d1e
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "pycage"
|
||||
version = "0.2.4dev1"
|
||||
version = "0.2.4"
|
||||
description = "tool to handle standalone Python installations from the CLI"
|
||||
authors = [
|
||||
{name = "Florian Förster", email = "f.foerster@d-opt.com"},
|
||||
@ -78,7 +78,7 @@ directory = "reports/coverage"
|
||||
|
||||
|
||||
[tool.bumpversion]
|
||||
current_version = "0.2.4dev1"
|
||||
current_version = "0.2.4"
|
||||
parse = """(?x)
|
||||
(?P<major>0|[1-9]\\d*)\\.
|
||||
(?P<minor>0|[1-9]\\d*)\\.
|
||||
|
||||
@ -63,6 +63,7 @@ def add_pkg(
|
||||
package: str,
|
||||
index: str | None = None,
|
||||
extra_index: str | None = None,
|
||||
include_prerelease: bool = False,
|
||||
) -> None:
|
||||
cmd: list[str] = [
|
||||
str(interpreter),
|
||||
@ -79,11 +80,22 @@ def add_pkg(
|
||||
if extra_index is not None:
|
||||
add_opts = ["--extra-index-url", extra_index]
|
||||
cmd.extend(add_opts)
|
||||
if include_prerelease:
|
||||
add_opts = ["--pre"]
|
||||
cmd.extend(add_opts)
|
||||
|
||||
subprocess.run(cmd)
|
||||
|
||||
|
||||
@click.command(help="install packages directly into the virtual environment")
|
||||
@click.option(
|
||||
"-p",
|
||||
"--pre",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
show_default=True,
|
||||
help=("install pre-release versions"),
|
||||
)
|
||||
@click.option(
|
||||
"-e", "--extra-index", default=None, help="extra index to lookup packages at by pip"
|
||||
)
|
||||
@ -93,6 +105,7 @@ def add(
|
||||
package: str,
|
||||
index: str | None,
|
||||
extra_index: str | None,
|
||||
pre: bool,
|
||||
) -> None:
|
||||
try:
|
||||
pth_intp = get_interpreter()
|
||||
@ -105,6 +118,7 @@ def add(
|
||||
package=package,
|
||||
index=index,
|
||||
extra_index=extra_index,
|
||||
include_prerelease=pre,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user