Closed knoppo closed 7 years ago
Yes you are right, sorry. I copied the approach taken in another project, but there, the corresponding __init__
file only defines constants and does not do any further imports. I guess an extra version file makes sense. I wonder why one should go through the bother with REs etc, and cannot simply import urwidtrees.version.__version__ as __version__
..
checkout current master. If it fixed the issue for you just close this issue.. thanks
The version import in __init__.py should be relative, the rest looks fine to me.
Edit: or the correct absolute import: from urwidtrees.version import __version__
Edit2: This absolute import should work in the docs conf.py, too.
(after sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))
)
yep, done. thanks.
In 4c0e887 the line
import urwidtrees
was (re-)added to setup.py. Nowpython setup.py install
imports urwid before installing it as a dependency and raisesImportError: No module named urwid
.This was fixed in #29 where other things got broken. Sorry for that! I can create a PR, just thought some clarification and opinions first ;)
A recommended approach is to place the version in a separate file. E.g. urwidtrees/version.py:
Then read and execute it in setup.py:
and import it in urwidtrees/__init__.py to get
urwidtrees.__version__
:Further reading: http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package
The version.py (maybe meta_info.py?) could also contain
__author__
,__description__
, etc. to have it all in a single place and inside the module.