From b24c2da4b2a16f815d8d297eaf423503eb251fc1 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Sun, 18 Jan 2015 14:54:48 +0000 Subject: [PATCH] Add hook in setup.py to update version string. --- setup.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 + }) -- 1.7.10.4