Giter Site home page Giter Site logo

Comments (4)

prusnak avatar prusnak commented on August 15, 2024

Why is that needed?

from cython-hidapi.

prusnak avatar prusnak commented on August 15, 2024

Also this should work:

>>> from pkg_resources import get_distribution
>>> get_distribution('hidapi').version
'0.7.99.post15'

from cython-hidapi.

squareproton avatar squareproton commented on August 15, 2024

Sorry for the delay in responding to this issue. I missed the notification email somehow.

Why is that needed?

To aid in debugging.

We recently received some application logs submitted by our users with behavior I couldn't explain or reproduce. The root cause was that our build system had used the wrong version of hidapi and we hadn't noticed before we distributed. Because it took such a long time to figure out so I resolved to add version numbers for our packages to the application logs so if this type of thing happened again it'd be really obvious. While doing this we found all but two packages we used make this available via a __version__ variable or something similar.

from pkg_resources import get_distribution
get_distribution('hidapi').version

This works in development but we've run into two problems building this into our distributable app because it relies on setuptools. Our windows build process coped with this ok but it included a lot of dependencies we weren't using before and we couldn't get this to work on osx.

In the end we've reverted to

def get_hidapi_version():
    hid_file, regex = hid.__file__, '(hidapi[^\\\/]*)'
    prog = re.compile(regex, re.IGNORECASE)
    matches = prog.search(hid_file)
    if matches:
        return matches.group(0)
    else:
        return hid_file

from cython-hidapi.

prusnak avatar prusnak commented on August 15, 2024

Thanks for the info. If you would like to change our code, please send a pull request.

from cython-hidapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.