From: Olof-Joachim Frahm Date: Sun, 18 Jan 2015 14:54:48 +0000 (+0000) Subject: Add hook in setup.py to update version string. X-Git-Tag: 0.1.0~2^2~3 X-Git-Url: http://repo.macrolet.net/gitweb/?p=crypto-install.git;a=commitdiff_plain;h=b24c2da4b2a16f815d8d297eaf423503eb251fc1 Add hook in setup.py to update version string. --- diff --git a/setup.py b/setup.py index ad33947..26d908e 100755 --- a/setup.py +++ b/setup.py @@ -2,9 +2,11 @@ import sys +from distutils.command.build import build from distutils.core import setup from setuptools import find_packages from setuptools.command.test import test as TestCommand +from subprocess import call class PyTest (TestCommand): @@ -25,9 +27,22 @@ class PyTest (TestCommand): sys.exit (pytest.main (self.pytest_args)) +class UpdateVersion (build): + def run (self): + build.run (self) + + def compile (): + call (["make", "build/crypto-install"]) + + self.execute (compile, [], "Updating version") + + setup (name = "crypto_install", version = "0.0.1", scripts = ["crypto-install"], install_requires = [], tests_require = ["pytest"], - cmdclass = {"test": PyTest}) + cmdclass = { + "test": PyTest, + "build": UpdateVersion + })