Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion robotpy_installer/cli_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ def common_pip_options(
help="Install from the given requirements file. This option can be used multiple times.",
)

parser.add_argument(
"--find-links",
help="Tell pip to search a specified URL or a local directory",
type=pathlib.Path,
)

parser.add_argument(
"packages",
nargs="*",
Expand All @@ -256,13 +262,14 @@ def __init__(self, parser: argparse.ArgumentParser) -> None:
@handle_cli_error
def run(
self,
find_links: typing.Optional[pathlib.Path],
no_deps: bool,
pre: bool,
requirements: typing.Tuple[pathlib.Path],
packages: typing.Tuple[str],
):
installer = RobotpyInstaller()
installer.pip_download(no_deps, pre, requirements, packages)
installer.pip_download(no_deps, pre, requirements, packages, find_links)


class InstallerInstall:
Expand Down
9 changes: 9 additions & 0 deletions robotpy_installer/cli_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import subprocess
import sys
import tempfile
import typing as T

from packaging.version import Version

Expand Down Expand Up @@ -74,11 +75,18 @@ def __init__(self, parser: argparse.ArgumentParser):
help="Do not check to see if the project can be upgraded",
)

parser.add_argument(
"--find-links",
help="Tell pip to search a specified URL or a local directory",
type=pathlib.Path,
)

@handle_cli_error
def run(
self,
project_path: pathlib.Path,
main_file: pathlib.Path,
find_links: T.Optional[pathlib.Path],
no_install: bool,
no_upgrade_project: bool,
user: bool,
Expand Down Expand Up @@ -149,6 +157,7 @@ def run(
pre=False,
requirements=[],
packages=packages,
find_links=find_links,
)

#
Expand Down
4 changes: 4 additions & 0 deletions robotpy_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ def pip_download(
pre: bool,
requirements: typing.Sequence[pathlib.Path],
packages: typing.Sequence[str],
find_links: typing.Optional[pathlib.Path],
):
"""
Specify Python package(s) to download, and store them in the cache.
Expand Down Expand Up @@ -510,6 +511,9 @@ def pip_download(
str(self.pip_cache),
]

if find_links:
pip_args += ["--find-links", str(find_links)]

self._extend_pip_args(
pip_args,
None,
Expand Down
Loading