beetbox / audioread

cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python
MIT License
481 stars 108 forks source link

added __version__; fixes #49 #50

Closed bmcfee closed 7 years ago

bmcfee commented 7 years ago

This PR adds __version__ to audioread and restructures the setup script to pull the version number from the source.

I took the liberty of initializing the version number to 2.1.5pre, since 2.1.4 is already out the door.

I did not add tests for this, but it does work locally.

sampsyo commented 7 years ago

Cool; this looks quite reasonable! Just so I understand, is there any particular reason to use imp.load_source instead of a plain import? Or to use a separate version module instead of putting the variables directly in __init__.py?

bmcfee commented 7 years ago

Yes-- load_source will work even if the package is not yet installed, and prevents any confusion in case there's an installed version distinct from the local source.

Separating the version info from init is just an easy way to avoid any side effects in the load at setup time. Not that it's an issue for this project, but it can happen, so it doesn't hurt to be safe.

sampsyo commented 7 years ago

Cool; thanks for explaining! Merged. :sparkles: