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
|
|
|
import glob
|
2016-02-07 16:46:16 +01:00
|
|
|
import io
|
2021-12-11 17:58:45 +01:00
|
|
|
import os
|
|
|
|
|
import re
|
2019-02-04 22:46:32 +01:00
|
|
|
import subprocess
|
2008-02-19 16:56:47 +01:00
|
|
|
|
2021-12-11 17:58:45 +01:00
|
|
|
from setuptools import Command, find_packages, setup
|
|
|
|
|
|
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)
|
2019-11-25 21:55:22 +01:00
|
|
|
local_version = []
|
2020-12-10 23:05:58 +01:00
|
|
|
if os.environ.get('CI_JOB_ID'):
|
|
|
|
|
local_version.append(os.environ['CI_JOB_ID'])
|
|
|
|
|
else:
|
|
|
|
|
for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']:
|
2020-12-11 13:51:54 +01:00
|
|
|
if os.environ.get(build):
|
|
|
|
|
local_version.append(os.environ[build])
|
|
|
|
|
else:
|
|
|
|
|
local_version = []
|
|
|
|
|
break
|
2019-11-25 21:55:22 +01:00
|
|
|
if local_version:
|
|
|
|
|
version += '+' + '.'.join(local_version)
|
2014-03-08 12:58:02 +01:00
|
|
|
|
2020-12-11 13:51:54 +01:00
|
|
|
dependency_links = []
|
|
|
|
|
if minor_version % 2:
|
|
|
|
|
dependency_links.append(
|
|
|
|
|
'https://trydevpi.tryton.org/?local_version='
|
|
|
|
|
+ '.'.join(local_version))
|
|
|
|
|
|
2021-03-28 19:20:37 +02:00
|
|
|
tests_require = ['pillow']
|
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'),
|
2012-06-08 19:32:23 +02:00
|
|
|
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={
|
2021-03-28 19:20:37 +02:00
|
|
|
'trytond': ['ir/ui/icons/*.svg', '*.rnc', '*.rng', 'ir/fonts/*.ttf'],
|
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',
|
2021-03-27 19:42:53 +01:00
|
|
|
'bin/trytond-stat',
|
2018-07-27 09:32:28 +02:00
|
|
|
],
|
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',
|
2020-03-01 12:33:54 +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',
|
2019-11-01 23:35:00 +01:00
|
|
|
'Natural Language :: Indonesian',
|
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)',
|
2021-05-02 09:56:34 +02:00
|
|
|
'Natural Language :: Romanian',
|
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',
|
2022-10-29 09:38:11 +02:00
|
|
|
'Natural Language :: Ukrainian',
|
2008-02-19 16:56:47 +01:00
|
|
|
'Operating System :: OS Independent',
|
2019-04-07 19:50:05 +02:00
|
|
|
'Programming Language :: Python :: 3',
|
2018-07-28 16:44:11 +02:00
|
|
|
'Programming Language :: Python :: 3.7',
|
2020-03-19 19:17:29 +01:00
|
|
|
'Programming Language :: Python :: 3.8',
|
2020-12-19 17:08:48 +01:00
|
|
|
'Programming Language :: Python :: 3.9',
|
2021-12-18 16:34:37 +01:00
|
|
|
'Programming Language :: Python :: 3.10',
|
2015-03-15 15:52:03 +01:00
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
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',
|
2021-12-18 16:34:37 +01:00
|
|
|
python_requires='>=3.7',
|
2008-09-30 10:45:11 +02:00
|
|
|
install_requires=[
|
2022-03-01 19:07:56 +01:00
|
|
|
'defusedxml',
|
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',
|
2022-09-01 22:10:10 +02:00
|
|
|
'python-sql >= 1.3',
|
2021-05-28 09:10:15 +02:00
|
|
|
'werkzeug',
|
2016-03-15 16:57:26 +01:00
|
|
|
'wrapt',
|
2020-09-24 23:05:04 +02:00
|
|
|
'passlib >= 1.7.0',
|
2022-10-03 09:30:32 +02:00
|
|
|
'pytz;python_version<"3.9"',
|
2012-06-08 19:32:23 +02:00
|
|
|
],
|
2008-10-23 16:48:23 +02:00
|
|
|
extras_require={
|
2022-04-16 18:30:20 +02:00
|
|
|
'test': tests_require,
|
2022-04-10 19:10:14 +02:00
|
|
|
'PostgreSQL': ['psycopg2 >= 2.7.0'],
|
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]'],
|
2021-07-12 23:31:09 +02:00
|
|
|
'Argon2': ['passlib[argon2]'],
|
2017-08-28 23:15:14 +02:00
|
|
|
'html2text': ['html2text'],
|
2019-12-03 18:40:28 +01:00
|
|
|
'weasyprint': ['weasyprint'],
|
2019-02-05 19:09:53 +01:00
|
|
|
'coroutine': ['gevent>=1.1'],
|
2021-03-28 19:20:37 +02:00
|
|
|
'image': ['pillow'],
|
2022-08-26 18:12:02 +02:00
|
|
|
'completion': ['argcomplete'],
|
2012-06-08 19:32:23 +02:00
|
|
|
},
|
2020-12-11 13:51:54 +01:00
|
|
|
dependency_links=dependency_links,
|
2009-01-08 13:24:02 +01:00
|
|
|
zip_safe=False,
|
2019-02-04 22:46:32 +01:00
|
|
|
cmdclass={
|
|
|
|
|
'update_rng': rnc2rng,
|
|
|
|
|
},
|
2014-03-08 12:58:02 +01:00
|
|
|
)
|