A wrapper that makes pip-sync faster.
Project description
pip-sync-faster
A wrapper that makes pip-sync faster.
For installation instructions see INSTALL.md.
For how to set up a pip-sync-faster development environment see HACKING.md.
pip-sync-faster makes pip-sync run faster in the case where there's nothing to do because the virtualenv is already up to date with the requirements files. On my machine, with my requirements files, it shaves off over 500ms in the time taken to run pip-sync:
$ time pip-sync requirements/foo.txt
Everything up-to-date
real 0m0.569s
user 0m0.525s
sys 0m0.045s
$ time pip-sync-faster requirements/foo.txt
real 0m0.037s
user 0m0.029s
sys 0m0.008s
pip-sync-faster
does this by saving hashes of the given requirements files in a
JSON file within the virtualenv and not calling pip-sync if the hashes haven't
changed.
If any of the given requirements files doesn't have a matching cached hash then
pip-sync-faster calls pip-sync forwarding all command line arguments and
options.
You need to add pip-sync-faster
to your requirements file
A command like pip-sync-faster requirements.txt
will call
pip-sync requirements.txt
which will uninstall anything not in
requirements.txt
from the active venv, including pip-sync-faster
itself!
You can add pip-sync-faster
to requirements.txt
so that it doesn't get
uninstalled.
Running pip-sync-faster
directly instead
Alternatively as long as pip-tools
is installed in the active venv you can
run pip-sync-faster
directly with a command like:
PYTHONPATH=/path/to/pip-sync-faster/src python3 -m pip_sync_faster requirements.txt
This doesn't rely on pip-sync-faster
being installed so there's no issue with
pip-sync
uninstalling it.
pip-sync-faster doesn't sync modified virtualenvs
If you modify your requirements files pip-sync-faster will notice the change
and call pip-sync. But if you modify your virtualenv without modifying your
requirements files (for example by running a manual pip install
command in
the virtualenv) pip-sync-faster will not call pip-sync because the
requirements files haven't changed and still match their cached hashes.
Calling pip-sync directly in this case would re-sync your virtualenv with your requirements files, but calling pip-sync-faster won't.
If you can live with this limitation then you can use pip-sync-faster and save yourself a few hundred milliseconds. If not you should just use pip-sync.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pip_sync_faster-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 210b1713122d191f56107b045a629eec2793bf4ae8dc467d2f7ba30a07e44bdd |
|
MD5 | f391eacd370263714255c03c9b0ab42e |
|
BLAKE2b-256 | c28b5e42bfb982cda39ad504edcbe0895aa99ac7578857dc6836c059bce2fde5 |