#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # from io import open import subprocess from setuptools import find_packages, setup, Command, os import sys VERSION = '1.0' class Doc(Command): description = 'generate or test documentation' user_options = [('test', 't', 'run doctests instead of generating documentation')] boolean_options = ['test'] def initialize_options(self): self.test = False def finalize_options(self): pass def run(self): if self.test: path = 'docs/build/doctest' mode = 'doctest' else: path = 'docs/build/%s' % VERSION mode = 'html' try: os.makedirs(path) except OSError: pass status = subprocess.call(['sphinx-build', '-E', '-b', mode, '-d', 'docs/build/doctrees', 'docs/source', path]) if status: raise RuntimeError('documentation step "%s" failed' % (mode,)) sys.stdout.write('\nDocumentation step "%s" performed, results here:\n' ' %s/\n' % (mode, path)) with open('requirements.txt') as f: required = f.read().splitlines() setup( name='steve-site', version=VERSION, url='https://svn.apache.org/repos/asf/steve/steve-site/', license='Apache Software License (http://www.apache.org/licenses/LICENSE-2.0)', author='Apache Software Foundation', author_email='dev@steve.apache.org', description='ASF STeVe Web Site', # don't ever depend on refcounting to close files anywhere else long_description=open('README.rst', encoding='utf-8').read(), namespace_packages=['asf'], package_dir={'': 'src'}, packages=find_packages('src'), zip_safe=False, platforms='any', install_requires=required, tests_require=['tox'], entry_points={ 'console_scripts': [ 'setup = asf.steve.commands.setup:main', 'mkelection = asf.steve.commands.mkelection:main' ], 'steve_backend.plugins': [ 'file-be = asf.steve.backends.file:FileBackend', 'elastic-storage-be = asf.steve.backends.elastic:ElasticStorageBackend' ], 'steve_voting.plugins': [ 'ap = asf.steve.methods.ap:Ap' ] }, classifiers=[ 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Topic :: Software Development :: Libraries :: Python Modules' ], cmdclass={'doc': Doc}, )