You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the interesting question! The --cache-dir option is deliberately designed to be able to run pip-compile in parallel mode. See also #1022 (review).
Would it be more correct to pass a different --cache-dir for each project when doing this?
Yes, that's the purpose of the --cache-dir.
How inefficient would that be?
More time would be spent on a "cold start" of each project, but that's a trade-off.
Is there any interest in making this cache file more concurrent friendly, possibly by using something a little more db-like than plain json?
The current format is perfectly fine for me and I'd prefer to keep things simple. But I would like to hear any other opinions.
Thanks very much! For anyone interested, here's how I'm handling this for now:
I'm using a dedicated cache dir for each unique-path output file (while unlikely, different pip-compile processes could be simultaneously operating on the very same input file, with different options; but it would be past sanity to concurrently try to generate the same output file). Really, for each output-file + venv pairing.
Something like this in my pip-compile wrapper (zsh):
# set variable 'reqsin' to relative or absolute path of input file# set variable 'reqstxt' to relative or absolute path of output filelocal reqstxt_hash="${$(md5sum =(<<<${reqstxt:P}))%%*}"
PIP_TOOLS_CACHE_DIR=${VIRTUAL_ENV:-$(mktemp -d)}/pip-tools-caches/${reqstxt_hash} \
pip-compile --no-header --build-isolation -o $reqstxt$@$reqsin
I have some scripts that concurrently run
pip-compile
in separate projects.Sometimes the overall process breaks:
I believe that the issue is concurrent
pip-compile
commands writing to thatjson
file.Environment Versions
Steps to replicate
zsh:
Expected result
# <crickets>
Actual result
Questions:
--cache-dir
for each project when doing this?Thanks for any insight!
The text was updated successfully, but these errors were encountered: