]> git.phdru.name Git - cookiecutter.git/commitdiff
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 f988f7cbad61f7d527bea9e2c9be31f96cd65350..9cde6ed1e10b260d611cdefe27d0105a2901494e 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')
     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}',
 
 setup(name='{project}',
-      version=__version__,
+      version={project}_version.__version__,
       description='Broytman {project}',
       long_description=open('README.rst', 'rU').read(),
       author='Oleg Broytman',
       description='Broytman {project}',
       long_description=open('README.rst', 'rU').read(),
       author='Oleg Broytman',