Files
tryton/setup.py
T

161 lines
5.1 KiB
Python
Raw Normal View History

2018-06-26 19:11:19 +02:00
#!/usr/bin/env python3
2014-12-02 12:54:01 +01:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
2008-02-19 16:56:47 +01:00
2019-02-04 22:46:32 +01:00
from setuptools import setup, find_packages, Command
import glob
2008-02-19 16:56:47 +01:00
import os
2015-03-19 21:25:20 +01:00
import re
2016-02-07 16:46:16 +01:00
import io
2015-03-15 15:52:03 +01:00
import platform
2019-02-04 22:46:32 +01:00
import subprocess
2008-02-19 16:56:47 +01:00
2012-04-01 23:08:15 +02:00
2011-02-08 19:37:17 +01:00
def read(fname):
2016-02-07 16:46:16 +01:00
return io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
2011-02-08 19:37:17 +01:00
2015-03-19 21:25:20 +01:00
def get_version():
init = read(os.path.join('trytond', '__init__.py'))
return re.search('__version__ = "([0-9.]*)"', init).group(1)
2018-06-26 19:11:19 +02:00
2019-02-04 22:46:32 +01:00
class rnc2rng(Command):
description = "Generate rng files from rnc"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.chdir(os.path.dirname(__file__) or '.')
for path in glob.glob('**/*.rnc', recursive=True):
root, ext = os.path.splitext(path)
cmd = ['rnc2rng', path, root + '.rng']
self.announce(' '.join(cmd))
subprocess.run(cmd)
2015-03-19 21:25:20 +01:00
version = get_version()
major_version, minor_version, _ = version.split('.', 2)
2014-03-08 12:58:02 +01:00
major_version = int(major_version)
minor_version = int(minor_version)
2015-03-19 21:25:20 +01:00
name = 'trytond'
2014-03-08 12:58:02 +01:00
download_url = 'http://downloads.tryton.org/%s.%s/' % (
major_version, minor_version)
if minor_version % 2:
2015-03-19 21:25:20 +01:00
version = '%s.%s.dev0' % (major_version, minor_version)
2014-03-08 12:58:02 +01:00
download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % (
2015-03-19 21:25:20 +01:00
name, name, version)
2014-03-08 12:58:02 +01:00
2015-03-15 15:52:03 +01:00
if platform.python_implementation() == 'PyPy':
pg_require = ['psycopg2cffi >= 2.5.4']
2015-03-15 15:52:03 +01:00
else:
pg_require = ['psycopg2 >= 2.5.4']
2015-03-15 15:52:03 +01:00
2015-03-19 21:25:20 +01:00
setup(name=name,
version=version,
2008-02-19 16:56:47 +01:00
description='Tryton server',
2019-04-06 17:38:58 +02:00
long_description=read('README.rst'),
author='Tryton',
2019-03-31 00:15:10 +01:00
author_email='bugs@tryton.org',
2015-03-19 21:25:20 +01:00
url='http://www.tryton.org/',
2014-03-08 12:58:02 +01:00
download_url=download_url,
2019-04-06 17:38:58 +02:00
project_urls={
"Bug Tracker": 'https://bugs.tryton.org/',
"Documentation": 'https://docs.tryton.org/',
"Forum": 'https://www.tryton.org/forum',
"Source Code": 'https://hg.tryton.org/trytond',
},
2014-03-08 12:58:02 +01:00
keywords='business application platform ERP',
2011-10-31 17:37:06 +01:00
packages=find_packages(exclude=['*.modules.*', 'modules.*', 'modules',
'*.proteus.*', 'proteus.*', 'proteus']),
2008-02-19 16:56:47 +01:00
package_data={
2011-09-29 17:22:22 +02:00
'trytond': ['ir/ui/icons/*.svg'],
2009-02-04 15:29:28 +01:00
'trytond.backend.postgresql': ['init.sql'],
'trytond.backend.sqlite': ['init.sql'],
2012-09-26 19:38:20 +02:00
'trytond.ir': ['tryton.cfg', '*.xml', 'view/*.xml', 'locale/*.po'],
2008-02-19 16:56:47 +01:00
'trytond.ir.module': ['*.xml'],
2008-06-17 13:22:43 +02:00
'trytond.ir.ui': ['*.xml', '*.rng', '*.rnc'],
2018-02-23 19:13:19 +01:00
'trytond.res': [
'tryton.cfg', '*.xml', '*.html', 'view/*.xml', 'locale/*.po'],
2017-04-03 17:05:23 +02:00
'trytond.tests': ['tryton.cfg', '*.xml', 'forbidden.txt'],
},
2018-07-27 09:32:28 +02:00
scripts=[
'bin/trytond',
'bin/trytond-admin',
2019-03-15 12:53:20 +01:00
'bin/trytond-console',
2018-07-27 09:32:28 +02:00
'bin/trytond-cron',
'bin/trytond-worker',
],
2008-02-19 16:56:47 +01:00
classifiers=[
'Development Status :: 5 - Production/Stable',
2019-03-15 12:53:20 +01:00
'Environment :: Console',
2008-02-19 16:56:47 +01:00
'Environment :: No Input/Output (Daemon)',
2011-09-29 23:20:35 +02:00
'Framework :: Tryton',
2008-02-19 16:56:47 +01:00
'Intended Audience :: Developers',
2017-02-13 16:33:42 +01:00
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
2011-04-26 18:03:13 +02:00
'Natural Language :: Bulgarian',
2013-04-19 19:49:29 +02:00
'Natural Language :: Catalan',
2016-05-01 10:59:39 +02:00
'Natural Language :: Chinese (Simplified)',
2011-10-23 21:11:01 +02:00
'Natural Language :: Czech',
2011-04-26 18:03:13 +02:00
'Natural Language :: Dutch',
2008-10-15 00:39:59 +02:00
'Natural Language :: English',
2019-05-01 16:38:57 +02:00
'Natural Language :: Finnish',
2008-10-15 00:39:59 +02:00
'Natural Language :: French',
'Natural Language :: German',
2015-09-02 13:49:26 +02:00
'Natural Language :: Hungarian',
2015-07-09 15:41:53 +02:00
'Natural Language :: Italian',
2018-04-14 17:20:08 +02:00
'Natural Language :: Persian',
2016-11-25 23:48:45 +01:00
'Natural Language :: Polish',
2015-06-22 22:09:20 +02:00
'Natural Language :: Portuguese (Brazilian)',
2010-04-12 07:45:23 +02:00
'Natural Language :: Russian',
2013-09-26 06:59:08 +02:00
'Natural Language :: Slovenian',
2008-10-15 00:39:59 +02:00
'Natural Language :: Spanish',
2019-05-01 16:18:50 +02:00
'Natural Language :: Turkish',
2008-02-19 16:56:47 +01:00
'Operating System :: OS Independent',
2019-04-07 19:50:05 +02:00
'Programming Language :: Python :: 3',
2016-02-07 16:46:16 +01:00
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
2018-07-28 16:44:11 +02:00
'Programming Language :: Python :: 3.7',
2015-03-15 15:52:03 +01:00
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
2008-02-19 16:56:47 +01:00
'Topic :: Software Development :: Libraries :: Application Frameworks',
],
2014-03-08 12:58:02 +01:00
platforms='any',
2015-03-19 21:25:20 +01:00
license='GPL-3',
2019-04-07 19:50:05 +02:00
python_requires='>=3.5',
2008-09-30 10:45:11 +02:00
install_requires=[
2010-03-26 18:28:50 +01:00
'lxml >= 2.0',
'relatorio[fodt] >= 0.7.0',
2009-09-02 22:51:38 +02:00
'Genshi',
'python-dateutil',
'polib',
'python-sql >= 0.5',
2016-03-15 16:57:26 +01:00
'werkzeug',
'wrapt',
2018-08-25 13:06:05 +02:00
'passlib',
],
2008-10-23 16:48:23 +02:00
extras_require={
2015-03-15 15:52:03 +01:00
'PostgreSQL': pg_require,
2008-10-23 16:48:23 +02:00
'graphviz': ['pydot'],
2012-12-05 13:25:18 +01:00
'Levenshtein': ['python-Levenshtein'],
2018-08-25 13:06:05 +02:00
'BCrypt': ['passlib[bcrypt]'],
2017-08-28 23:15:14 +02:00
'html2text': ['html2text'],
2019-02-05 19:09:53 +01:00
'coroutine': ['gevent>=1.1'],
},
2009-01-08 13:24:02 +01:00
zip_safe=False,
test_suite='trytond.tests',
test_loader='trytond.test_loader:Loader',
2019-02-04 22:46:32 +01:00
cmdclass={
'update_rng': rnc2rng,
},
2014-03-08 12:58:02 +01:00
)