X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;ds=sidebyside;f=project_template%2Fsetup.py;h=816581f61249961f2e90809eef6f785356799873;hb=13b8070685fe1994fff8ee28cf18ca8f52aec1b9;hp=f988f7cbad61f7d527bea9e2c9be31f96cd65350;hpb=62af81e45f65f45d663f4e5c760c198460b76a7f;p=cookiecutter.git diff --git a/project_template/setup.py b/project_template/setup.py index f988f7c..816581f 100755 --- a/project_template/setup.py +++ b/project_template/setup.py @@ -2,25 +2,13 @@ from imp import load_source from os.path import abspath, dirname, join - -try: - from setuptools import setup - is_setuptools = True -except ImportError: - from distutils.core import setup - is_setuptools = False - -kw = {} -if is_setuptools: - kw['python_requires'] = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*' +from setuptools import setup 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', @@ -47,6 +35,6 @@ setup(name='{project}', packages=['{project}'], package_data={'{project}': []}, scripts=[], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*', requires=[], - **kw )