Hello,
I have a verification project of which Python is only a part. The project's structure is:
root/
vhdl/
synthesis/
tb/
some_tb1/
svn_code/
vhdl/
python_lib/
generic_svn
is a Subversion 'externals' directory holding common code.
I have several scripts in tb/some_tb1
that want to use modules from svn_code/python_lib
. But too see these modules, and as this isn't a pure Python package hierarchy (so relative imports are useless) I have to somehow update my path.
I started with:
import sys
sys.path.append('../../svn_code/python_lib/')
In all Python files. But that's somewhat of a duplication. So I created a file named 'path_setup.py', placed the code above in it and just imported it.
But perhaps a better method is just to create a .pth file in the tb/some_tb1
directory that points to the modules ?
Which method do you prefer, or are there other good options ? TIA