Build: Use module returned by imp.load_source() directly
authorOleg Broytman <phd@phdru.name>
Sun, 4 Feb 2018 06:23:46 +0000 (09:23 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 4 Feb 2018 06:23:46 +0000 (09:23 +0300)
project_template/setup.py

index f988f7c..9cde6ed 100755 (executable)
@@ -15,12 +15,10 @@ if is_setuptools:
     kw['python_requires'] = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*'
 
 versionpath = join(abspath(dirname(__file__)), '{project}', '__version__.py')
-load_source('{project}_version', versionpath)
-# Ignore: E402 module level import not at top of file
-from {project}_version import __version__  # noqa
+{project}_version = load_source('{project}_version', versionpath)
 
 setup(name='{project}',
-      version=__version__,
+      version={project}_version.__version__,
       description='Broytman {project}',
       long_description=open('README.rst', 'rU').read(),
       author='Oleg Broytman',