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':
|
2017-06-09 13:22:42 +02:00
|
|
|
pg_require = ['psycopg2cffi >= 2.5.4']
|
2015-03-15 15:52:03 +01:00
|
|
|
else:
|
2017-06-09 13:22:42 +02:00
|
|
|
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',
|
2011-02-08 19:37:17 +01:00
|
|
|
long_description=read('README'),
|
2012-06-08 19:32:23 +02:00
|
|
|
author='Tryton',
|
2014-03-08 12:58:02 +01:00
|
|
|
author_email='issue_tracker@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,
|
|
|
|
|
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'],
|
2009-10-20 18:38:42 +02:00
|
|
|
'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'],
|
2012-06-08 19:32:23 +02:00
|
|
|
},
|
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',
|
|
|
|
|
'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',
|
2008-02-19 16:56:47 +01:00
|
|
|
'Operating System :: OS Independent',
|
2016-02-07 16:46:16 +01:00
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
|
'Programming Language :: Python :: 3.5',
|
2017-10-22 14:57:04 +02:00
|
|
|
'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',
|
2012-06-08 19:32:23 +02:00
|
|
|
],
|
2014-03-08 12:58:02 +01:00
|
|
|
platforms='any',
|
2015-03-19 21:25:20 +01:00
|
|
|
license='GPL-3',
|
2018-06-26 19:11:19 +02:00
|
|
|
python_requires='>=3.4',
|
2008-09-30 10:45:11 +02:00
|
|
|
install_requires=[
|
2010-03-26 18:28:50 +01:00
|
|
|
'lxml >= 2.0',
|
2017-08-31 23:29:09 +02:00
|
|
|
'relatorio[fodt] >= 0.7.0',
|
2009-09-02 22:51:38 +02:00
|
|
|
'Genshi',
|
2009-12-17 11:39:54 +01:00
|
|
|
'python-dateutil',
|
2011-10-04 13:03:06 +02:00
|
|
|
'polib',
|
2018-04-30 16:03:34 +02:00
|
|
|
'python-sql >= 0.5',
|
2016-03-15 16:57:26 +01:00
|
|
|
'werkzeug',
|
|
|
|
|
'wrapt',
|
2018-08-25 13:06:05 +02:00
|
|
|
'passlib',
|
2012-06-08 19:32:23 +02:00
|
|
|
],
|
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'],
|
2012-06-08 19:32:23 +02:00
|
|
|
},
|
2009-01-08 13:24:02 +01:00
|
|
|
zip_safe=False,
|
2010-03-12 17:47:49 +01:00
|
|
|
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
|
|
|
)
|