Closed ktbyers closed 7 years ago
More details, this is testing from napalm_ios package.
python setup.py install
will fail as an .egg is installed. The templates/*.j2 files are inside the egg, but they can't be read.
I tried to use zip_safe=False
in the setup.py file, but this did not change the behavior of python setup.py install
. I could not find an answer on why this didn't work.
pip install napalm-ios
worked as full package was installed (not clear to me, however, how deterministic this is...i.e. what here is causing it not to be an .egg file).
pip install -e . worked (thought it made an egg-link in site-packages pointing back to the developer directory. An egg-link is a Python version of a symbolic link). The load_template unit test passed with this.
pip install dist/napalm-ios-version.tar.gz also worked.
I also looked at the fix referenced inside of stackoverflow. That is going to be hard for us to implement given our current code structure.
So I think this is probably a non-issue...it means python setup.py install
won't work, but we can just have them pip install
. People doing the python setup.py install
are more likely to be developers.
I think is broke...you can't just try to load directly like this when it is an .egg file.
Yes, that's a known issue. I don't remember the details but @mirceaulinic and I looked into it and got to the same conclusion you got. That's why the only "supported" install method is pip (you can use pip install -e .
to install from source like python setup.py install
)
@dbarrosop It is probably prudent to add the following to setup.py.
zip_safe=False,
I think this will make it much less likely that a future version of PIP installs an egg (at least that was the best I could determine).
I was having unit test failures in napalm-ios complaining about ./templates/ directory not existing.
This caused me to dig around some more:
I think is broke...you can't just try to load directly like this when it is an .egg file.
See discussion about this here:
http://stackoverflow.com/questions/6028000/python-how-to-read-a-static-file-from-inside-a-package