Lock filepins¶
When reading an .in file, in one shot, parse all pins.
PinDatum do not ignore qualifiers.
- class wreck.lock_filepins.FilePins(file_abspath: Path)¶
Has the duel purpose to: store the pins and store the processed data.
Processed into: constraints (-c), requirements (-r), and pkgs_from_resolved (transitive packages)
- Variables:
file_abspath –
.infile absolute Path- Vartype:
- _pins: list[wreck.lock_datum.PinDatum]¶
Container of PinDatum
- _iter: collections.abc.Iterator[wreck.lock_datum.PinDatum]¶
Iterator of PinDatum
- Raises:
wreck.exceptions.MissingRequirementsFoldersFiles– .in requirements file not foundValueError– file suffixes are not ok
- by_pin_or_qualifier()¶
Yield if either a Pin or has qualifiers
- Returns:
collections.abc.Generator[wreck.lock_datum.PinDatum, None, None]
- by_pkg(pkg_name)¶
Get PinDatum by package name. Can have differing qualifiers
- Parameters:
- Returns:
For one package, list of PinDatum. Differs by qualifiers
- Return type:
- property depth¶
Number of unresolved constraints. One this number gets down to zero, the FilePins is moved from files set –> zeroes set
- Returns:
unresolved constraints count
- Return type:
- packages_save_to_parent(fpins, requirements)¶
During the resolution loop, as the resolved constraints|requirements are moved into zeroes, their packages are saved into parent
- relpath(loader)¶
Get the absolute path. The relative path is relative to the package folder.
- Parameters:
path_package_base¶ (pathlib.Path) – package base folder
- Returns:
absolute path
- Return type:
- Raises:
wreck.exceptions.MissingPackageBaseFolder– loader did not provide package base folder
- resolve(constraint, plural='constraints', singular='constraint')¶
Constraint or requirement to discard
- Parameters:
constraint¶ (str) – As provided by pip_requirements_parser.RequirementsFile, is a relative path, not absolute. Relative to the .in file, not cwd (package base folder)
plural¶ (str) – attribute name. There are two set, constraints and requirements
singular¶ (str) – Just used in error messages. Singular form of the word
- Raises:
AssertionError– object attribute does not exist. Should be either constraints or requirements
- wreck.lock_filepins.get_path_cwd(loader)¶
package base folder. During testing this will be tmp_path, not the source package folder. Patch would be helpful here
- Parameters:
loader¶ (wreck.pep518_venvs.VenvMapLoader) – Contains some paths and loaded not parsed venv reqs
- Returns:
package base folder
- Return type:
- Raises:
wreck.exceptions.MissingPackageBaseFolder– loader did not provide package base folder