`jhack sync --venv`: sync arbitrary dependencies with live charm code

Earlier this week I was struggling to debug a pesky issue with a charm dependency from pypi. My initial approach was to modify the file directly in the venv directory in the packed .charm file (or manually ssh into the unit and do that with vim directly on the unit).

Quickly my jhack senses started to tingle and realized my time would be better spent adding functionality to jhack sync instead.

Pass --venv=~/path/to/your/.venv to jhack sync and you shall see:

now all of your pip-installed sources are tracked by sync! You can go and make changes to your local copy of ops, insert a helpful debug log in that method in requests that’s giving you pain, or replace the entire json module with nonsense.

This will shortly be live in jhack>=0.4.3.2.2 on edge.

Happy hacking!

3 Likes