You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the most consistent way to get the version number of the installed version(s) of this library? Considering that it could theoretically installed via either apt-get or pip/easy_installand there are Python 2 and Python 3 versions floating around, this could get a bit interesting. It would be fine to skip Python 2 and just worry about v3.
Not sure about pip off the top of my head but for apt-get 'dpkg --list' will show you the version
robot@ev3dev[~]# dpkg --list python-ev3dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=========================================-=========================-=========================-========================================================================================
ii python-ev3dev 0.6.0 all Python language bindings for ev3dev
robot@ev3dev[~]#
Hmmmm... That seems to be a good start; I think I'll do it like that for now. Do you know if there's an accessible __version__ property exposed by this library? If not, it might make sense to add one (although I have no idea how to do that) to make the version easily accessible in the future.
I don't believe this is resolved. In my mind, asking someone to look up the version through apt-get is too complicated (regardless of the fact that it's so easy for us to do); the fewer moving parts, the better. Could we define a __version__ property? That would solve the problem, I think.
I guess it couldn't hurt anything to stick a __version___ in core.py...we just have to make sure we keep it and the version in the debian changelog in sync.
When we packaged the library with setuptools, the version information used to be provided by git_version.py script (still present in the repo). The script works along these lines:
When run from inside git repo (that is, when package is created on developer's machine), it asks git for version number. It also writes the version info to RELEASE-VERSION file and packages it with the library.
When run as part of installation on user machine, it reads RELEASE-VERSION file directly.
We could extend the process to write a __version__ string into, for example, ev3dev/__init__.py. Or we could write it into ev3dev/version.py and import it from ev3dev/__init__.py to not mess with git history. I am not sure though this is possible with debian packaging tools.
Activity
dwalton76 commentedon Sep 8, 2016
Not sure about pip off the top of my head but for apt-get 'dpkg --list' will show you the version
WasabiFan commentedon Sep 8, 2016
Hmmmm... That seems to be a good start; I think I'll do it like that for now. Do you know if there's an accessible
__version__property exposed by this library? If not, it might make sense to add one (although I have no idea how to do that) to make the version easily accessible in the future.dwalton76 commentedon Sep 8, 2016
The version is defined in debian/changelog
https://github.com/rhempel/ev3dev-lang-python/blob/develop/debian/changelog
but there isn't a version property that I know of.
dlech commentedon Sep 8, 2016
http://stackoverflow.com/questions/10214827/find-which-version-of-package-is-installed-with-pip
dwalton76 commentedon Sep 14, 2016
@WasabiFan ok to close this one? There really isn't anything to change to the python library for this.
WasabiFan commentedon Sep 14, 2016
I don't believe this is resolved. In my mind, asking someone to look up the version through apt-get is too complicated (regardless of the fact that it's so easy for us to do); the fewer moving parts, the better. Could we define a
__version__property? That would solve the problem, I think.dwalton76 commentedon Sep 14, 2016
I guess it couldn't hurt anything to stick a
__version___in core.py...we just have to make sure we keep it and the version in the debian changelog in sync.WasabiFan commentedon Sep 22, 2016
Fixed by #208
ddemidov commentedon Sep 22, 2016
When we packaged the library with setuptools, the version information used to be provided by
git_version.pyscript (still present in the repo). The script works along these lines:RELEASE-VERSIONfile and packages it with the library.RELEASE-VERSIONfile directly.We could extend the process to write a
__version__string into, for example,ev3dev/__init__.py. Or we could write it intoev3dev/version.pyand import it fromev3dev/__init__.pyto not mess with git history. I am not sure though this is possible with debian packaging tools.dlech commentedon Sep 28, 2016
https://www.python.org/dev/peps/pep-0396/