2018-06-26 19:13:12 +02:00
|
|
|
#!/usr/bin/env python3
|
2014-12-03 16:05:10 +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.
|
2018-06-26 19:13:12 +02:00
|
|
|
import io
|
2010-11-11 17:57:54 +01:00
|
|
|
import os
|
2016-02-19 23:16:43 +01:00
|
|
|
import re
|
2021-12-11 17:58:45 +01:00
|
|
|
|
|
|
|
|
from setuptools import find_packages, setup
|
2010-06-12 16:55:24 +02:00
|
|
|
|
2012-04-03 20:09:39 +02:00
|
|
|
|
2010-11-11 17:57:54 +01:00
|
|
|
def read(fname):
|
2016-02-19 23:16:43 +01:00
|
|
|
return io.open(
|
|
|
|
|
os.path.join(os.path.dirname(__file__), fname),
|
|
|
|
|
'r', encoding='utf-8').read()
|
|
|
|
|
|
|
|
|
|
|
2022-10-27 13:24:22 +02:00
|
|
|
def readme():
|
|
|
|
|
content = read('README.rst')
|
|
|
|
|
content = re.sub(
|
|
|
|
|
r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content)
|
|
|
|
|
return content
|
|
|
|
|
|
|
|
|
|
|
2016-02-19 23:16:43 +01:00
|
|
|
def get_version():
|
|
|
|
|
init = read(os.path.join('proteus', '__init__.py'))
|
|
|
|
|
return re.search('__version__ = "([0-9.]*)"', init).group(1)
|
2010-11-11 17:57:54 +01:00
|
|
|
|
2014-03-08 13:00:40 +01:00
|
|
|
|
|
|
|
|
def get_require_version(name):
|
2022-12-24 13:45:10 +01:00
|
|
|
require = '%s >= %s.%s, < %s.%s'
|
2014-03-08 13:00:40 +01:00
|
|
|
require %= (name, major_version, minor_version,
|
|
|
|
|
major_version, minor_version + 1)
|
|
|
|
|
return require
|
|
|
|
|
|
2018-06-26 19:13:12 +02:00
|
|
|
|
2014-03-08 13:00:40 +01:00
|
|
|
name = 'proteus'
|
2016-02-19 23:16:43 +01:00
|
|
|
version = get_version()
|
2014-03-08 13:00:40 +01:00
|
|
|
major_version, minor_version, _ = version.split('.', 2)
|
|
|
|
|
major_version = int(major_version)
|
|
|
|
|
minor_version = int(minor_version)
|
|
|
|
|
|
2022-12-24 13:45:10 +01:00
|
|
|
if minor_version % 2:
|
|
|
|
|
download_url = ''
|
|
|
|
|
else:
|
|
|
|
|
download_url = 'http://downloads.tryton.org/%s.%s/' % (
|
|
|
|
|
major_version, minor_version)
|
2014-03-08 13:00:40 +01:00
|
|
|
|
|
|
|
|
setup(name=name,
|
|
|
|
|
version=version,
|
2010-06-12 16:55:24 +02:00
|
|
|
description='Library to access Tryton server as a client',
|
2022-10-27 13:24:22 +02:00
|
|
|
long_description=readme(),
|
2013-02-27 22:58:22 +01:00
|
|
|
author='Tryton',
|
2022-12-24 13:45:10 +01:00
|
|
|
author_email='foundation@tryton.org',
|
2010-06-12 16:55:24 +02:00
|
|
|
url='http://www.tryton.org/',
|
2014-03-08 13:00:40 +01:00
|
|
|
download_url=download_url,
|
2019-04-06 17:38:58 +02:00
|
|
|
project_urls={
|
|
|
|
|
"Bug Tracker": 'https://bugs.tryton.org/',
|
2024-02-18 18:35:54 +01:00
|
|
|
"Documentation": 'https://docs.tryton.org/latest/client-library/',
|
2019-04-06 17:38:58 +02:00
|
|
|
"Forum": 'https://www.tryton.org/forum',
|
2022-12-24 13:45:10 +01:00
|
|
|
"Source Code": 'https://code.tryton.org/tryton',
|
2019-04-06 17:38:58 +02:00
|
|
|
},
|
2014-03-08 13:00:40 +01:00
|
|
|
keywords='tryton library cli',
|
2010-06-12 16:55:24 +02:00
|
|
|
packages=find_packages(),
|
|
|
|
|
classifiers=[
|
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
|
'Environment :: Plugins',
|
2012-08-28 22:19:57 +01:00
|
|
|
'Framework :: Tryton',
|
2010-06-12 16:55:24 +02:00
|
|
|
'Intended Audience :: Developers',
|
|
|
|
|
'Intended Audience :: Financial and Insurance Industry',
|
|
|
|
|
'Intended Audience :: Legal Industry',
|
2013-02-27 22:56:31 +01:00
|
|
|
'License :: OSI Approved :: '
|
|
|
|
|
'GNU Library or Lesser General Public License (LGPL)',
|
2010-06-12 16:55:24 +02:00
|
|
|
'Operating System :: OS Independent',
|
2019-04-07 19:50:05 +02:00
|
|
|
'Programming Language :: Python :: 3',
|
2020-03-19 19:17:37 +01:00
|
|
|
'Programming Language :: Python :: 3.8',
|
2020-12-19 17:08:47 +01:00
|
|
|
'Programming Language :: Python :: 3.9',
|
2021-12-18 16:34:37 +01:00
|
|
|
'Programming Language :: Python :: 3.10',
|
2023-01-27 11:02:47 +01:00
|
|
|
'Programming Language :: Python :: 3.11',
|
2023-10-22 19:40:55 +02:00
|
|
|
'Programming Language :: Python :: 3.12',
|
2015-03-15 15:53:37 +01:00
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
2010-06-12 16:55:24 +02:00
|
|
|
'Topic :: Office/Business',
|
2013-02-27 22:56:31 +01:00
|
|
|
],
|
2014-03-08 13:00:40 +01:00
|
|
|
platforms='any',
|
2011-05-19 19:50:57 +02:00
|
|
|
license='LGPL-3',
|
2023-01-29 20:36:51 +01:00
|
|
|
python_requires='>=3.8',
|
2012-03-05 10:19:20 +01:00
|
|
|
install_requires=[
|
2022-03-01 19:07:56 +01:00
|
|
|
'defusedxml',
|
2012-03-05 10:19:20 +01:00
|
|
|
"python-dateutil",
|
|
|
|
|
],
|
2010-06-12 16:55:24 +02:00
|
|
|
extras_require={
|
2014-03-08 13:00:40 +01:00
|
|
|
'trytond': [get_require_version('trytond')],
|
2022-04-16 18:30:20 +02:00
|
|
|
'test': [
|
|
|
|
|
get_require_version('trytond'),
|
|
|
|
|
get_require_version('trytond_party'),
|
|
|
|
|
],
|
2013-02-27 22:56:31 +01:00
|
|
|
},
|
2014-03-08 13:00:40 +01:00
|
|
|
zip_safe=True,
|
2013-02-27 22:56:31 +01:00
|
|
|
)
|