From: Oleg Broytman Date: Sun, 4 Feb 2018 06:23:46 +0000 (+0300) Subject: Build: Use module returned by imp.load_source() directly X-Git-Url: https://git.phdru.name/?p=cookiecutter.git;a=commitdiff_plain;h=8c864209256af5d88eee2eefc74c86c32b24d911;ds=sidebyside Build: Use module returned by imp.load_source() directly --- diff --git a/project_template/setup.py b/project_template/setup.py index f988f7c..9cde6ed 100755 --- a/project_template/setup.py +++ b/project_template/setup.py @@ -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',