* Louis-Philippe VĂ©ronneau <po...@debian.org> [2023-02-03 18:15]: > On 2023-02-03 11 h 58, FC Stegerman wrote: > > Presumably there is a way to get the version from e.g. > > "dpkg-parsechangelog -S Version" (minus the -1 revision) instead. I'm > > not sure how other packages handle this. > > You can get those values via the variables provided by > /usr/share/dpkg/pkg-info.mk > > You can "source" those in your d/rules makefile by using: > > include /usr/share/dpkg/pkg-info.mk
Thanks! Updating my previous suggestion based on this new information, it becomes: adding this to debian/rules include /usr/share/dpkg/pkg-info.mk and patching setup.py to change def get_setup_version(reponame): """Use autover to get up to date version.""" # importing self into setup.py is unorthodox, but param has no # required dependencies outside of python from param.version import Version return Version.setup_version(os.path.dirname(__file__),reponame,archive_commit="$Format:%h$") to e.g. def get_setup_version(reponame): """Use autover to get up to date version.""" if version := os.environ.get("DEB_VERSION_UPSTREAM"): return version # importing self into setup.py is unorthodox, but param has no # required dependencies outside of python from param.version import Version return Version.setup_version(os.path.dirname(__file__),reponame,archive_commit="$Format:%h$") - FC