setup.py
255 lines
| 7.5 KiB
| text/x-python
|
PythonLexer
r1 | # -*- coding: utf-8 -*- | |||
r1271 | # Copyright (C) 2010-2017 RhodeCode GmbH | |||
r1234 | # | |||
# This program is free software: you can redistribute it and/or modify | ||||
# it under the terms of the GNU Affero General Public License, version 3 | ||||
# (only), as published by the Free Software Foundation. | ||||
# | ||||
# This program is distributed in the hope that it will be useful, | ||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
# GNU General Public License for more details. | ||||
# | ||||
# You should have received a copy of the GNU Affero General Public License | ||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
# | ||||
# This program is dual-licensed. If you wish to learn more about the | ||||
# RhodeCode Enterprise Edition, including its added features, Support services, | ||||
# and proprietary license terms, please see https://rhodecode.com/licenses/ | ||||
r1 | # Import early to make sure things are patched up properly | |||
from setuptools import setup, find_packages | ||||
import os | ||||
import sys | ||||
r1234 | import pkgutil | |||
r1 | import platform | |||
r1222 | from pip.download import PipSession | |||
from pip.req import parse_requirements | ||||
r1234 | from codecs import open | |||
r1222 | ||||
r1 | if sys.version_info < (2, 7): | |||
raise Exception('RhodeCode requires Python 2.7 or later') | ||||
r1222 | here = os.path.abspath(os.path.dirname(__file__)) | |||
r1 | ||||
r1234 | # defines current platform | |||
__platform__ = platform.system() | ||||
__license__ = 'AGPLv3, and Commercial License' | ||||
__author__ = 'RhodeCode GmbH' | ||||
__url__ = 'https://code.rhodecode.com' | ||||
is_windows = __platform__ in ('Windows',) | ||||
r1 | ||||
r1234 | def _get_requirements(req_filename, exclude=None, extras=None): | |||
extras = extras or [] | ||||
exclude = exclude or [] | ||||
r1 | ||||
r1234 | try: | |||
parsed = parse_requirements( | ||||
os.path.join(here, req_filename), session=PipSession()) | ||||
except TypeError: | ||||
# try pip < 6.0.0, that doesn't support session | ||||
parsed = parse_requirements(os.path.join(here, req_filename)) | ||||
r1 | ||||
r1234 | requirements = [] | |||
for ir in parsed: | ||||
if ir.req and ir.name not in exclude: | ||||
requirements.append(str(ir.req)) | ||||
return requirements + extras | ||||
r1 | ||||
r1234 | # requirements extract | |||
setup_requirements = ['PasteScript', 'pytest-runner'] | ||||
install_requirements = _get_requirements( | ||||
'requirements.txt', exclude=['setuptools']) | ||||
test_requirements = _get_requirements( | ||||
'requirements_test.txt', extras=['configobj']) | ||||
r1 | ||||
r1234 | install_requirements = [ | |||
r1 | 'Babel', | |||
'Beaker', | ||||
'FormEncode', | ||||
'Mako', | ||||
'Markdown', | ||||
'MarkupSafe', | ||||
'MySQL-python', | ||||
'Paste', | ||||
'PasteDeploy', | ||||
'PasteScript', | ||||
'Pygments', | ||||
r1104 | 'pygments-markdown-lexer', | |||
r1 | 'Pylons', | |||
'Routes', | ||||
'SQLAlchemy', | ||||
'Tempita', | ||||
'URLObject', | ||||
'WebError', | ||||
'WebHelpers', | ||||
'WebHelpers2', | ||||
'WebOb', | ||||
'WebTest', | ||||
'Whoosh', | ||||
'alembic', | ||||
'amqplib', | ||||
'anyjson', | ||||
'appenlight-client', | ||||
'authomatic', | ||||
r1528 | 'cssselect', | |||
r1 | 'celery', | |||
r525 | 'channelstream', | |||
r1 | 'colander', | |||
'decorator', | ||||
r518 | 'deform', | |||
r1 | 'docutils', | |||
r525 | 'gevent', | |||
r9 | 'gunicorn', | |||
r1 | 'infrae.cache', | |||
'ipython', | ||||
'iso8601', | ||||
'kombu', | ||||
r1525 | 'lxml', | |||
r1 | 'msgpack-python', | |||
r1488 | 'nbconvert', | |||
r1 | 'packaging', | |||
'psycopg2', | ||||
r322 | 'py-gfm', | |||
r1 | 'pycrypto', | |||
'pycurl', | ||||
'pyparsing', | ||||
'pyramid', | ||||
'pyramid-debugtoolbar', | ||||
'pyramid-mako', | ||||
'pyramid-beaker', | ||||
'pysqlite', | ||||
'python-dateutil', | ||||
'python-ldap', | ||||
'python-memcached', | ||||
'python-pam', | ||||
'recaptcha-client', | ||||
'repoze.lru', | ||||
'requests', | ||||
'simplejson', | ||||
r1993 | 'sshpubkeys', | |||
Martin Bornhold
|
r1006 | 'subprocess32', | ||
r1 | 'waitress', | |||
'zope.cachedescriptors', | ||||
r320 | 'dogpile.cache', | |||
r1234 | 'dogpile.core', | |||
'psutil', | ||||
'py-bcrypt', | ||||
r1 | ] | |||
r1234 | def get_version(): | |||
version = pkgutil.get_data('rhodecode', 'VERSION') | ||||
return version.strip() | ||||
r1 | ||||
# additional files that goes into package itself | ||||
r1234 | package_data = { | |||
'': ['*.txt', '*.rst'], | ||||
'configs': ['*.ini'], | ||||
'rhodecode': ['VERSION', 'i18n/*/LC_MESSAGES/*.mo', ], | ||||
} | ||||
r1 | ||||
r1234 | description = 'Source Code Management Platform' | |||
r1 | keywords = ' '.join([ | |||
r1234 | 'rhodecode', 'mercurial', 'git', 'svn', | |||
'code review', | ||||
'repo groups', 'ldap', 'repository management', 'hgweb', | ||||
'hgwebdir', 'gitweb', 'serving hgweb', | ||||
r1 | ]) | |||
r1234 | ||||
# README/DESCRIPTION generation | ||||
readme_file = 'README.rst' | ||||
changelog_file = 'CHANGES.rst' | ||||
r1 | try: | |||
r1234 | long_description = open(readme_file).read() + '\n\n' + \ | |||
open(changelog_file).read() | ||||
except IOError as err: | ||||
r1 | sys.stderr.write( | |||
r1234 | "[WARNING] Cannot find file specified as long_description (%s)\n " | |||
"or changelog (%s) skipping that file" % (readme_file, changelog_file)) | ||||
r1 | long_description = description | |||
setup( | ||||
name='rhodecode-enterprise-ce', | ||||
r1234 | version=get_version(), | |||
r1 | description=description, | |||
long_description=long_description, | ||||
keywords=keywords, | ||||
license=__license__, | ||||
author=__author__, | ||||
author_email='marcin@rhodecode.com', | ||||
url=__url__, | ||||
r1234 | setup_requires=setup_requirements, | |||
install_requires=install_requirements, | ||||
r1 | tests_require=test_requirements, | |||
r1234 | zip_safe=False, | |||
packages=find_packages(exclude=["docs", "tests*"]), | ||||
package_data=package_data, | ||||
r1 | include_package_data=True, | |||
r1234 | classifiers=[ | |||
'Development Status :: 6 - Mature', | ||||
'Environment :: Web Environment', | ||||
'Intended Audience :: Developers', | ||||
'Operating System :: OS Independent', | ||||
'Topic :: Software Development :: Version Control', | ||||
'License :: OSI Approved :: Affero GNU General Public License v3 or later (AGPLv3+)', | ||||
'Programming Language :: Python :: 2.7', | ||||
], | ||||
r1 | message_extractors={ | |||
'rhodecode': [ | ||||
('**.py', 'python', None), | ||||
r326 | ('**.js', 'javascript', None), | |||
r1 | ('templates/**.mako', 'mako', {'input_encoding': 'utf-8'}), | |||
('templates/**.html', 'mako', {'input_encoding': 'utf-8'}), | ||||
('public/**', 'ignore', None), | ||||
] | ||||
}, | ||||
paster_plugins=['PasteScript', 'Pylons'], | ||||
entry_points={ | ||||
'enterprise.plugins1': [ | ||||
'crowd=rhodecode.authentication.plugins.auth_crowd:plugin_factory', | ||||
r59 | 'headers=rhodecode.authentication.plugins.auth_headers:plugin_factory', | |||
r1 | 'jasig_cas=rhodecode.authentication.plugins.auth_jasig_cas:plugin_factory', | |||
'ldap=rhodecode.authentication.plugins.auth_ldap:plugin_factory', | ||||
'pam=rhodecode.authentication.plugins.auth_pam:plugin_factory', | ||||
'rhodecode=rhodecode.authentication.plugins.auth_rhodecode:plugin_factory', | ||||
r80 | 'token=rhodecode.authentication.plugins.auth_token:plugin_factory', | |||
r1 | ], | |||
'paste.app_factory': [ | ||||
'main=rhodecode.config.middleware:make_pyramid_app', | ||||
'pylons=rhodecode.config.middleware:make_app', | ||||
], | ||||
'paste.app_install': [ | ||||
'main=pylons.util:PylonsInstaller', | ||||
'pylons=pylons.util:PylonsInstaller', | ||||
], | ||||
r1234 | 'paste.global_paster_command': [ | |||
'make-config=rhodecode.lib.paster_commands.make_config:Command', | ||||
'setup-rhodecode=rhodecode.lib.paster_commands.setup_rhodecode:Command', | ||||
'ishell=rhodecode.lib.paster_commands.ishell:Command', | ||||
'upgrade-db=rhodecode.lib.dbmigrate:UpgradeDb', | ||||
'celeryd=rhodecode.lib.celerypylons.commands:CeleryDaemonCommand', | ||||
], | ||||
r1 | 'pytest11': [ | |||
'pylons=rhodecode.tests.pylons_plugin', | ||||
'enterprise=rhodecode.tests.plugin', | ||||
], | ||||
'console_scripts': [ | ||||
'rcserver=rhodecode.rcserver:main', | ||||
], | ||||
'beaker.backends': [ | ||||
'memorylru_base=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerBase', | ||||
'memorylru_debug=rhodecode.lib.memory_lru_debug:MemoryLRUNamespaceManagerDebug' | ||||
] | ||||
}, | ||||
) | ||||