#ACCPY-552 allow JAR path in venv
As proposed https://issues.cern.ch/browse/ACCPY-
- If we are in virtualenv, use the virtualenv folder (how can I get that is still an unknown)
- Otherwise keep doing the same as before
- BUT if there are files in the _user_dir or _dist_dir use that over virtualenv
Both when saving module.json and when saving the libs.
I did some local testing with moving files around one or the other folder to see if precedence is respected and by the looks of it, it works.
Also I cleaned up a bit the _save_module because it was not using the _dir function.
Here there is also a simple script to test the new venv functions:
from cmmnbuild_dep_manager import Manager
m = Manager()
user_dir = m._user_dir()
dist_dir = m._dist_dir()
venv_dir = m._venv_dir()
print("User dir: ", user_dir)
print("Dist dir: ", dist_dir)
if m._running_in_venv():
print("Venv dir: ", venv_dir)
else:
print("Not running in venv")
print("Jar Path: ", m.jar_path())