Lock loader¶
There are two from_loader implementations. Refactor priority
is on support for multiple implementations, rather than for
performance.
LoaderPinDatum is the latest implementation. Differs from LoaderPin by reading each requirements file once.
loader |
context |
duration(sec) |
|
|---|---|---|---|
LoaderPin |
343 passed, 6 skipped |
82.86 |
|
LoaderPinDatum |
343 passed |
6 skipped” |
53.19 |
(82.86 - 53.19) / 82.86 = 0.35807 --> ~35.80% speed up
Reducing I/O (file reads), has a significant and high performance impact.
Both implementations hold the result in memory.
functools.singledispatch was not used. This pattern is for
multiple implementations based on the first arg, not the return type
- wreck.lock_loader.__all__: tuple[str, str, str] = ("LoaderImplementation", "LoaderPinDatum", "from_loader_filepins")¶
Module exports
- class wreck.lock_loader.LoaderImplementation¶
from_loaderimplementation base type
- class wreck.lock_loader.LoaderPinDatum¶
Another implementation.
Reads each file once, process all pins once
Keep in mind,
LoaderImplementationexists only for compatibility with existing codebaseUsage
ret: set[wreck.lock_datum.DATUM] = LoaderPinDatum()(loader, venv_path)
- wreck.lock_loader.from_loader_filepins(loader, venv_path, suffix_last='.in')¶
Load the FilePins
- Parameters:
- Returns:
All FilePins
- Return type:
- Raises:
NotADirectoryError– venv relative paths do not correspond to actual venv foldersValueError– expecting [[tool.wreck.venvs]] field reqs to be a sequenceKeyError– No such venv foundwreck.exceptions.MissingRequirementsFoldersFiles– missing requirements file(s). Create itwreck.exceptions.MissingPackageBaseFolder– loader invalid. Does not provide package base folder