ancient-breakfast-45303
06/12/2021, 3:53 PMenough-analyst-54434
06/12/2021, 3:58 PMancient-breakfast-45303
06/12/2021, 4:07 PMenough-analyst-54434
06/12/2021, 4:12 PMenough-analyst-54434
06/12/2021, 4:14 PMancient-breakfast-45303
06/12/2021, 4:15 PMancient-breakfast-45303
06/12/2021, 4:15 PMbidst_pex
and then copy the pex over, but then it was getting slowancient-breakfast-45303
06/12/2021, 4:25 PMenough-analyst-54434
06/12/2021, 4:30 PMenough-analyst-54434
06/12/2021, 4:31 PMenough-analyst-54434
06/12/2021, 4:32 PMancient-breakfast-45303
06/12/2021, 4:34 PMrequirements.txt
to a pex file of just deps.
2. change the bdist_command
to just resolve from that, passing in no requirements.txt
3. Combine the above into a single command, skipping step 1 if the file has not changedancient-breakfast-45303
06/12/2021, 4:34 PMenough-analyst-54434
06/12/2021, 4:37 PMbdist_pex
make easier for you over just using pex
directly?ancient-breakfast-45303
06/12/2021, 4:37 PMenough-analyst-54434
06/12/2021, 4:38 PMancient-breakfast-45303
06/12/2021, 4:38 PMsetup.py
at all I should be using just pex
directlyancient-breakfast-45303
06/12/2021, 4:38 PMbdist_pex
and never ever questioned it until todayancient-breakfast-45303
06/12/2021, 4:38 PMenough-analyst-54434
06/12/2021, 4:39 PMpex project/ ...
Should be equivalent (or .
If the project dir is where you're at already).ancient-breakfast-45303
06/12/2021, 4:40 PMenough-analyst-54434
06/12/2021, 4:40 PMenough-analyst-54434
06/12/2021, 4:41 PMancient-breakfast-45303
06/12/2021, 4:42 PMbdist_rpm
are going away as wellancient-breakfast-45303
06/12/2021, 5:37 PMbdist_pex
you should remove it from the docs firstancient-breakfast-45303
06/12/2021, 11:36 PMancient-breakfast-45303
06/12/2021, 11:37 PM--pex-repository
with a pex of the requirements results in:
pex.resolver.Untranslatable: Cannot resolve local projects from PEX repositories. Asked to resolve /Users/zmanji/code/git-squash from ./dist/requirements.pex.
ancient-breakfast-45303
06/12/2021, 11:37 PM--requirements-pex ./dist/requirements.pex
seems to work fine howeverancient-breakfast-45303
06/12/2021, 11:41 PMpex . --requirements-pex ./dist/requirements.pex --no-build --wheel --no-transitive --inherit-path=false --script git-squash -o dist/out.pex
is this what you were suggesting?enough-analyst-54434
06/13/2021, 12:56 AM$ time pex . -r requirements.txt -c git-squash -o git-squash.pex
real 0m5.389s
user 0m4.663s
sys 0m0.524s
Use it:
$ time pex git-squash==0.0.1 -r requirements.txt --pex-repository git-squash.pex -c git-squash -o git-squash.2.pex -c git-squash
real 0m0.339s
user 0m0.302s
sys 0m0.035s
You get the same pex in this case (a full resolve, not a subset):
$ ./git-squash.2.pex -h
usage: git-squash.2.pex [-h] branch
positional arguments:
branch The upstream branch to squash commits of the current branch on to.
optional arguments:
-h, --help show this help message and exit
$ diff <(pex-tools git-squash.pex info -i4) <(pex-tools git-squash.2.pex info -i4)
$
But you could get a subset:
$ time pex GitPython -o GitPython.pex
real 0m0.791s
user 0m0.652s
sys 0m0.093s
$ time pex GitPython -o GitPython.2.pex --pex-repository git-squash.pex
real 0m0.317s
user 0m0.289s
sys 0m0.029s
$ diff <(pex-tools GitPython.pex info -i4) <(pex-tools GitPython.2.pex info -i4)
^jsirois@gill /tmp/git-squash (master *) $ ./GitPython.2.pex
Python 3.9.5 (default, May 24 2021, 12:50:35)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from git import Repo
>>> repo = Repo()
>>> repo.rev_parse("HEAD")
<git.Commit "505cf06c598409db9d119a521480e43de3fa8908">
>>>
now exiting InteractiveConsole...
enough-analyst-54434
06/13/2021, 12:58 AM--pex-repository
resolve speed is going to be pretty much constant. PEX file build times will become dominated by zip times.enough-analyst-54434
06/13/2021, 12:58 AM$ time pex GitPython isort -o GitPython.2.pex --pex-repository git-squash.pex
A distribution for isort could not be resolved in this environment.
real 0m0.197s
user 0m0.177s
sys 0m0.021s
ancient-breakfast-45303
06/13/2021, 1:11 AM