Skip to content

Commit

Permalink
docs: mention that python requirements need to be specified using ful…
Browse files Browse the repository at this point in the history
…l address from the root
  • Loading branch information
AlexTereshenkov committed Aug 13, 2024
1 parent 4553e4c commit 7ac339a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def _install_from_resolve_help(cls) -> str:
Values can be pip-style requirements (e.g., `tool` or `tool==1.2.3` or `tool>=1.2.3`),
or addresses of `python_requirement` targets (or targets that generate or depend on
`python_requirement` targets).
`python_requirement` targets). Make sure to use the `//` prefix to refer to targets
using their full address from the root (e.g. `//3rdparty/python:tool`). This is necessary
to distinguish address specs from local or VCS requirements.
The lockfile will be validated against the requirements - if a lockfile doesn't
provide the requirement (at a suitable version, if the requirement specifies version
Expand Down
1 change: 1 addition & 0 deletions src/python/pants/backend/python/util_rules/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ async def get_req_strings(pex_reqs: PexRequirements) -> PexRequirementsInfo:
else:
req_strings.append(req_str_or_addr)
if specs:
1/0
addrs_from_specs = await Get(
Addresses,
UnparsedAddressInputs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ def validate_metadata(
resolve_config: ResolvePexConfig,
) -> None:
"""Given interpreter constraints and requirements to be consumed, validate lockfile metadata."""

print(consumed_req_strings)
print("-------------------------------")
# TODO(#12314): Improve the exception if invalid strings
user_requirements = [PipRequirement.parse(i) for i in consumed_req_strings]
validation = metadata.is_valid_for(
Expand Down

0 comments on commit 7ac339a

Please sign in to comment.