Package: py.lockfile2
py.lockfileInstallpipinstallpy.lockfile2py.lockfileis a tool for downloading of python packages for various OS, CPU
and python versions.MotivationPython projects managed bypipenv,poetryorpdmuse
lock files for freeze packages in specific version.
It is very useful for stability of whole project. However, for installing these
freeze packages, we have to use mentioned package managers, which bring many
unwanted dependencies. It is uncomfortable especially for building of docker
containers.This tool takesPipfile.lock/poetry.lock/pdm.lockfile and downloads all required packages
(for specific OS, CPU and python version) to target directory.
After that we can install them by simplepip.The simple example of usage>py.lockfile-stests/poetry.lock-twheels/
📦cffi1.15.1cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

>pipinstallwheels/*
cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whlAdvance optionsThe tool accepts many arguments, the most useable are--python-versionand--platform.
They can help us to download packages for different python version or OS platform.
Get the correct value of--platformattribute for your system, can be
complicated. This command can helppy_lockfile --help | grep 'Your current platform'>py.lockfile--help
usage:py_lockfile[-h][-sSOURCEFILE][-tTARGET][-gGROUP][-pPYTHON_VERSION][--platformPLATFORM][--python-implementation{cp,ip,pp,jy}][--ignore-missing][--ignore-hash][--no-binary][--dryrun][--no-color]Pythonpackagedownloader.
---------------------------------

Thisisasimpletoolfordownloadpythonpackagesmanagedbylockfile.
Repositorycredentialscanbesetbyenvironmentvariables(PYLF_<NAME>_USERNAME,PYLF_<NAME>_PASSWORDandPYLF_<NAME>_URL).

Supported:*Pipfile.lock-Pipenv.*poetry.lock-Poetry,therepositorycredentialsareautomaticallyloadedfrom~/.config/pypoetry/auth.toml.*pdm.lock-PDM,therepositorycredentialsareautomaticallyloadedfrompyproject.toml

optionalarguments:-h,--helpshowthishelpmessageandexit-sSOURCEFILE,--sourcefileSOURCEFILEsourcefile(e.g.Pipfile.lock,poetry.lockorpdm.lock)-tTARGET,--targetTARGETDownloadfolder(default:./wheels)-gGROUP,--groupGROUPAppendoptionalgroupofpackages(e.g.dev)-pPYTHON_VERSION,--python-versionPYTHON_VERSIONDownloadpackagesforpythonversion(default:3.9.5).--platformPLATFORMDownloadpackagesforplatform(default:manylinux_2_28_x86_64).--python-implementation{cp,ip,pp,jy}Downloadpackagesforpythonimplementation(default:cp).--ignore-missingSkipmissingpackages.--ignore-hashIgnorepackagehashchecking.--no-binaryDownloadonlysourcepackages.--dryrunDryrun.Nodownloadwillbeperformed.--no-colorDisablecoloroutput.

SOURCEFILE:Automaticallytrytofindsupportedfilesincurrentfolder.

PLATFORM:Yourcurrentplatformis'manylinux_2_28_x86_64'Seemorehttps://peps.python.org/pep-0491/#file-name-conventione.g.:*macosx_10_9_x86_64*win_amd64*manylinux_2_17_x86_64# glib linux systems (RHEL based system) https://peps.python.org/pep-0600/*musllinux_1_1_x86_64# musl linux systems (AlpineLinux) https://peps.python.org/pep-0656/PYTHON_IMPLEMENTATION:*'cp'-CPython*'pp'-Pypy*'ip'-IronPython*'jy'-JythonAs default values of--python-version,--platformand--python-implementationare set your current python configuration.
However, you can download packages for different configuration as well.>py.lockfile-stests/poetry.lock-twheels/--python-version2.7--platformwin_amd64
📦cffi1.15.1cffi-1.15.1-cp27-cp27m-win_amd64.whlDownload packages from a private repositoryCredentials are automatically loaded frompypoetry/auth.toml,pyproject.tomlor we can overwrite them by environment variables.PYLF_<REPO_NAME>_USERNAME=userPYLF_<REPO_NAME>_PASSWORD=passwordpy.lockfile...Optionally, we can setPYLF_<REPO_NAME>_URLas well, for appending custom pypi
entry point.