From b54bc003810027481e8125be28af7af0781dadcc Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Mon, 17 Mar 2014 12:42:14 +0100 Subject: include version stuff so it can be upgraded --- setup.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 8f83608..e36bc9f 100644 --- a/setup.py +++ b/setup.py @@ -15,15 +15,22 @@ exclude_files = [ 'setup.py', ] +if __name__ == '__main__': + # put here so setup.py can be imported more easily + from setuptools import setup, find_packages, Extension + from setuptools.command import install_lib + +# < from ruamel.util.new.setupinc import get_version, _check_convert_version def get_version(): v_i = 'version_info = ' for line in open('__init__.py'): if not line.startswith(v_i): continue s_e = line[len(v_i):].strip()[1:-1].split(', ') - els = [x.strip()[1:-1] if x[0] in '\'"' else int(x) for x in s_e] - return els + elems = [x.strip()[1:-1] if x[0] in '\'"' else int(x) for x in s_e] + break + return elems def _check_convert_version(tup): @@ -56,15 +63,11 @@ def _check_convert_version(tup): raise ValueError('First letter of "' + x + '" not recognised') return ret_val + +# < from ruamel.util.new.setupinc import version_info, version_str version_info = get_version() version_str = _check_convert_version(version_info) - -if __name__ == '__main__': - # put here so setup.py can be imported more easily - from setuptools import setup, find_packages, Extension - from setuptools.command import install_lib - - +# < from ruamel.util.new.setupinc import MyInstallLib class MyInstallLib(install_lib.install_lib): "create __init__.py on the fly" def run(self): @@ -106,6 +109,9 @@ class MyInstallLib(install_lib.install_lib): return alt_files +# < + + def main(): install_requires = [ ] -- cgit v1.2.1