diff options
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 80 |
1 files changed, 38 insertions, 42 deletions
@@ -1,31 +1,15 @@ #!/usr/bin/env python -# Don't use __future__ in this script, it breaks buildout -# from __future__ import print_function import os -import subprocess import sys import shutil from setuptools import setup, find_packages from setuptools.command.install import install -from setuptools.command.test import test as TestCommand - - -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - # import here, cause outside the eggs aren't loaded - import pytest - errno = pytest.main(self.test_args) - sys.exit(errno) +from setuptools.command.build_py import build_py with open('requirements.txt', 'r') as fh: - dependencies = [l.strip() for l in fh] + dependencies = [l.strip().split("#")[0] for l in fh] extras = {} @@ -38,10 +22,10 @@ with open('requirements-tests.txt', 'r') as fh: extras['tests'] = [l.strip() for l in fh][1:] # ########## platform specific stuff ############# -if sys.version_info[0] == 2 and sys.version_info[1] < 7: - raise Exception('Python 2 version < 2.7 is not supported') -elif sys.version_info[0] == 3 and sys.version_info[1] < 3: - raise Exception('Python 3 version < 3.3 is not supported') +if sys.version_info[0] == 2: + raise Exception('Python 2 is not supported') +elif sys.version_info[0] == 3 and sys.version_info[1] < 5: + raise Exception('Python 3 version < 3.5 is not supported') ################################################## @@ -51,6 +35,9 @@ standard_exclude = ('*.pyc', '*$py.class', '*~', '.*', '*.bak') standard_exclude_directories = ('.*', 'CVS', '_darcs', './build', './dist', 'EGG-INFO', '*.egg-info') +with open('README.rst') as f: + long_description = f.read() + def copy_messages(): themes_directory = os.path.join( @@ -75,8 +62,8 @@ def expands_symlinks_for_windows(): path to the file it points to. If not corrected, installing from a git clone will end with some files with bad content - After install the working copy will be dirty (symlink markers overwritten with - real content) + After install the working copy will be dirty (symlink markers overwritten + with real content) """ if sys.platform != 'win32': return @@ -90,7 +77,8 @@ def expands_symlinks_for_windows(): sys.path = oldpath del sys.modules['winutils'] if failures != -1: - print('WARNING: your working copy is now dirty by changes in samplesite, sphinx and themes') + print('WARNING: your working copy is now dirty by changes in ' + 'samplesite, sphinx and themes') if failures > 0: raise Exception("Error: \n\tnot all symlinked files could be fixed." + "\n\tYour best bet is to start again from clean.") @@ -100,7 +88,7 @@ def remove_old_files(self): tree = os.path.join(self.install_lib, 'nikola') try: shutil.rmtree(tree, ignore_errors=True) - except: + except Exception: pass @@ -111,47 +99,55 @@ class nikola_install(install): install.run(self) +class nikola_build_py(build_py): + def run(self): + expands_symlinks_for_windows() + build_py.run(self) + + setup(name='Nikola', - version='7.6.4', - description='A modular, fast, simple, static website generator', - long_description=open('README.rst').read(), + version='8.1.2', + description='A modular, fast, simple, static website and blog generator', + long_description=long_description, author='Roberto Alsina and others', author_email='ralsina@netmanagers.com.ar', url='https://getnikola.com/', - packages=find_packages(exclude=('tests',)), + packages=find_packages(exclude=('tests', 'tests.*')), license='MIT', - keywords='website, static', - classifiers=('Development Status :: 5 - Production/Stable', + keywords='website, blog, static', + classifiers=['Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Environment :: Plugins', 'Environment :: Web Environment', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: MIT License', 'Operating System :: MacOS', + 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: OS Independent', 'Operating System :: POSIX', 'Operating System :: Unix', 'Programming Language :: Python', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Internet', 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Text Processing :: Markup'), + 'Topic :: Text Processing :: Markup'], install_requires=dependencies, extras_require=extras, - tests_require=['pytest'], include_package_data=True, - cmdclass={'install': nikola_install, 'test': PyTest}, + python_requires='>=3.5', + cmdclass={'install': nikola_install, 'build_py': nikola_build_py}, data_files=[ ('share/doc/nikola', [ - 'docs/manual.txt', - 'docs/theming.txt', - 'docs/extending.txt']), + 'docs/manual.rst', + 'docs/theming.rst', + 'docs/extending.rst']), ('share/man/man1', ['docs/man/nikola.1.gz']), ], - entry_points = { + entry_points={ 'console_scripts': [ 'nikola = nikola.__main__:main' ] |
