Skip to content

Getting version number of installed library #200

Closed

Description

@WasabiFan

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_install and 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.

Activity

  1. dwalton76 commented on Sep 8, 2016

    @dwalton76
    Collaborator

    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[~]# 
    
  2. WasabiFan commented on Sep 8, 2016

    @WasabiFan
    MemberAuthor

    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.

  3. dwalton76 commented on Sep 8, 2016

    @dwalton76
    Collaborator

    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.

  4. dwalton76 commented on Sep 14, 2016

    @dwalton76
    Collaborator

    @WasabiFan ok to close this one? There really isn't anything to change to the python library for this.

  5. WasabiFan commented on Sep 14, 2016

    @WasabiFan
    MemberAuthor

    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.

  6. dwalton76 commented on Sep 14, 2016

    @dwalton76
    Collaborator

    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.

  7. self-assigned this
    on Sep 15, 2016
  8. WasabiFan commented on Sep 22, 2016

    @WasabiFan
    MemberAuthor

    Fixed by #208

  9. ddemidov commented on Sep 22, 2016

    @ddemidov
    Member

    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:

    1. 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.
    2. 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.

  10. dlech commented on Sep 28, 2016

    @dlech
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions