Use python_requires and raise an error if an older Python is used

This commit is contained in:
Simon Conseil
2018-03-07 00:48:52 +01:00
parent e9ae4b739c
commit cf3bd4bf6d
2 changed files with 9 additions and 7 deletions

View File

@@ -1,14 +1,15 @@
# -*- coding:utf-8 -*-
import os
import sys
from setuptools import setup, find_packages
if sys.version_info[:2] < (3, 5):
sys.exit('Sigal supports Python 3.5+ only')
with open('README.rst') as f:
README = f.read()
with open('docs/changelog.rst') as f:
CHANGELOG = f.read()
# Load package meta from the pkgmeta module without loading the package.
pkgmeta = {}
pkgmeta_file = os.path.join(os.path.dirname(__file__), 'sigal', 'pkgmeta.py')
@@ -24,11 +25,12 @@ setup(
author=pkgmeta['__author__'],
author_email='contact@saimon.org',
description='Simple static gallery generator',
long_description=README + '\n' + CHANGELOG,
long_description=README,
packages=find_packages(exclude=['tests*']),
zip_safe=False,
include_package_data=True,
platforms='any',
python_requires='>=3.5',
keywords=['gallery', 'static', 'generator', 'image', 'video', 'galleria'],
install_requires=['blinker', 'click', 'Jinja2', 'Markdown',
'Pillow>=4.0.0', 'pilkit'],
@@ -44,10 +46,7 @@ setup(
'Environment :: Console',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP',

View File

@@ -40,6 +40,9 @@ from .utils import copy
_DEFAULT_CONFIG_FILE = 'sigal.conf.py'
if sys.version_info[:2] < (3, 5):
raise Exception('Sigal supports Python 3.5+ only')
@click.group()
@click.version_option(version=__version__)