Skip to content
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

Expose the ability to add a local wheel through the CLI. #1038

Closed
wants to merge 2 commits into from
Closed
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
15 changes: 15 additions & 0 deletions pex/bin/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,18 @@ def configure_clp():
" This option can be used multiple times.",
)

parser.add_option(
"-w",
"--wheel-dist",
dest="wheel_dists",
metavar="FILE",
default=[],
type=str,
action="append",
help="Add a wheel distribution (.whl file) from a local path (relative or absolute) into the generated .pex file."
" This option can be used multiple times.",
)

parser.add_option(
"-R",
"--resources-directory",
Expand Down Expand Up @@ -854,6 +866,9 @@ def walk_and_do(fn, src_dir):
for requirements_pex in options.requirements_pexes:
pex_builder.add_from_requirements_pex(requirements_pex)

for whl_path in options.wheel_dists:
pex_builder.add_dist_location(whl_path)

with TRACER.timed("Resolving distributions ({})".format(reqs + options.requirement_files)):
network_configuration = NetworkConfiguration.create(
cache_ttl=options.cache_ttl,
Expand Down