2019-02-26 11:03:17 +01:00
|
|
|
#!/usr/bin/env python3
|
2018-06-22 12:19:12 +02:00
|
|
|
# The COPYRIGHT file at the top level of this repository contains
|
|
|
|
# the full copyright notices and license terms.
|
2015-10-23 18:55:27 +02:00
|
|
|
|
|
|
|
from setuptools import setup
|
|
|
|
import re
|
|
|
|
import os
|
2018-06-22 12:19:12 +02:00
|
|
|
import io
|
2019-02-26 11:03:17 +01:00
|
|
|
from configparser import ConfigParser
|
2015-10-23 18:55:27 +02:00
|
|
|
|
2018-06-22 12:19:12 +02:00
|
|
|
MODULE2PREFIX = {
|
2019-02-28 12:54:38 +01:00
|
|
|
'stock_unit_load': 'datalife',
|
2018-06-22 12:19:12 +02:00
|
|
|
}
|
2015-10-23 18:55:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
def read(fname):
|
2018-06-22 12:19:12 +02:00
|
|
|
return io.open(
|
|
|
|
os.path.join(os.path.dirname(__file__), fname),
|
|
|
|
'r', encoding='utf-8').read()
|
2015-10-23 18:55:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
def get_require_version(name):
|
|
|
|
if minor_version % 2:
|
|
|
|
require = '%s >= %s.%s.dev0, < %s.%s'
|
|
|
|
else:
|
|
|
|
require = '%s >= %s.%s, < %s.%s'
|
|
|
|
require %= (name, major_version, minor_version,
|
|
|
|
major_version, minor_version + 1)
|
|
|
|
return require
|
|
|
|
|
2018-06-22 12:19:12 +02:00
|
|
|
|
|
|
|
config = ConfigParser()
|
2015-10-23 18:55:27 +02:00
|
|
|
config.readfp(open('tryton.cfg'))
|
|
|
|
info = dict(config.items('tryton'))
|
|
|
|
for key in ('depends', 'extras_depend', 'xml'):
|
|
|
|
if key in info:
|
|
|
|
info[key] = info[key].strip().splitlines()
|
|
|
|
version = info.get('version', '0.0.1')
|
|
|
|
major_version, minor_version, _ = version.split('.', 2)
|
|
|
|
major_version = int(major_version)
|
|
|
|
minor_version = int(minor_version)
|
2018-06-22 12:19:12 +02:00
|
|
|
name = 'datalife_sale_unit_load'
|
2020-02-11 13:35:57 +01:00
|
|
|
download_url = 'https://gitlab.com/datalifeit/trytond-sale_unit_load'
|
2015-10-23 18:55:27 +02:00
|
|
|
|
2018-06-22 12:19:12 +02:00
|
|
|
series = '%s.%s' % (major_version, minor_version)
|
|
|
|
if minor_version % 2:
|
|
|
|
branch = 'default'
|
|
|
|
else:
|
|
|
|
branch = series
|
2019-01-24 14:29:07 +01:00
|
|
|
dependency_links = {
|
2019-02-28 12:45:47 +01:00
|
|
|
'stock_unit_load':
|
2020-02-11 13:35:57 +01:00
|
|
|
'git+https://gitlab.com/datalifeit/'
|
2021-01-06 01:38:13 +01:00
|
|
|
'trytond-stock_unit_load@%(branch)s'
|
2021-01-20 01:06:11 +01:00
|
|
|
'#egg=datalife_stock_unit_load' % {
|
2018-06-22 12:19:12 +02:00
|
|
|
'branch': branch,
|
2019-01-24 14:29:07 +01:00
|
|
|
},
|
2019-02-28 12:45:47 +01:00
|
|
|
'sale_cost':
|
2020-02-11 13:35:57 +01:00
|
|
|
'git+https://gitlab.com/datalifeit/'
|
2021-01-06 01:38:13 +01:00
|
|
|
'trytond-sale_cost@%(branch)s'
|
|
|
|
'#egg=datalife_sale_cost-%(series)s' % {
|
2019-02-28 13:03:32 +01:00
|
|
|
'branch': branch,
|
2021-01-20 01:06:11 +01:00
|
|
|
'series': series
|
|
|
|
},
|
2019-02-28 13:03:32 +01:00
|
|
|
'document_cost':
|
2020-02-11 13:35:57 +01:00
|
|
|
'git+https://gitlab.com/datalifeit/'
|
2021-01-06 01:38:13 +01:00
|
|
|
'trytond-document_cost@%(branch)s'
|
|
|
|
'#egg=datalife_document_cost-%(series)s' % {
|
2019-02-28 12:45:47 +01:00
|
|
|
'branch': branch,
|
2021-01-20 01:06:11 +01:00
|
|
|
'series': series
|
|
|
|
},
|
2019-10-14 18:16:42 +02:00
|
|
|
'sale_line_quick_actions':
|
2020-02-11 13:35:57 +01:00
|
|
|
'git+https://gitlab.com/datalifeit/'
|
2021-01-06 01:38:13 +01:00
|
|
|
'trytond-sale_line_quick_actions@%(branch)s'
|
|
|
|
'#egg=datalife_sale_line_quick_actions-%(series)s' % {
|
2019-10-14 18:16:42 +02:00
|
|
|
'branch': branch,
|
2021-01-20 01:06:11 +01:00
|
|
|
'series': series
|
|
|
|
},
|
2019-01-24 14:29:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
requires = []
|
|
|
|
for dep in info.get('depends', []):
|
|
|
|
if not re.match(r'(ir|res)(\W|$)', dep):
|
|
|
|
prefix = MODULE2PREFIX.get(dep, 'trytond')
|
|
|
|
req = get_require_version('%s_%s' % (prefix, dep))
|
|
|
|
if dep in dependency_links:
|
|
|
|
req = '%s_%s @ %s' % (prefix, dep, dependency_links[dep])
|
|
|
|
requires.append(req)
|
|
|
|
requires.append(get_require_version('trytond'))
|
|
|
|
|
|
|
|
tests_require = [
|
|
|
|
get_require_version('proteus'),
|
2021-01-20 01:06:11 +01:00
|
|
|
get_require_version('datalife_sale_cost'),
|
|
|
|
get_require_version('datalife_sale_line_quick_actions')
|
2019-01-24 14:29:07 +01:00
|
|
|
]
|
|
|
|
|
2019-02-28 12:45:47 +01:00
|
|
|
dependency_links = list(dependency_links.values())
|
2018-06-22 12:19:12 +02:00
|
|
|
if minor_version % 2:
|
|
|
|
# Add development index for testing with proteus
|
|
|
|
dependency_links.append('https://trydevpi.tryton.org/')
|
2015-10-23 18:55:27 +02:00
|
|
|
|
2018-06-22 12:19:12 +02:00
|
|
|
setup(name=name,
|
2015-10-23 18:55:27 +02:00
|
|
|
version=version,
|
2018-06-22 12:19:12 +02:00
|
|
|
description='Tryton sale unit load Module',
|
|
|
|
long_description=read('README.md'),
|
2015-10-23 18:55:27 +02:00
|
|
|
author='Datalife',
|
2020-02-11 13:35:57 +01:00
|
|
|
author_email='info@datalifeit.es',
|
|
|
|
url='https://gitlab.com/datalifeit/',
|
2018-06-22 12:19:12 +02:00
|
|
|
download_url=download_url,
|
|
|
|
keywords='',
|
|
|
|
package_dir={'trytond.modules.sale_unit_load': '.'},
|
2015-10-23 18:55:27 +02:00
|
|
|
packages=[
|
2018-06-22 12:19:12 +02:00
|
|
|
'trytond.modules.sale_unit_load',
|
|
|
|
'trytond.modules.sale_unit_load.tests',
|
2015-10-23 18:55:27 +02:00
|
|
|
],
|
|
|
|
package_data={
|
2018-06-22 12:19:12 +02:00
|
|
|
'trytond.modules.sale_unit_load': (info.get('xml', [])
|
2019-02-26 11:03:17 +01:00
|
|
|
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt',
|
2018-06-22 12:19:12 +02:00
|
|
|
'icons/*.svg', 'tests/*.rst']),
|
2015-10-23 18:55:27 +02:00
|
|
|
},
|
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
'Environment :: Plugins',
|
|
|
|
'Framework :: Tryton',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Intended Audience :: Financial and Insurance Industry',
|
|
|
|
'Intended Audience :: Legal Industry',
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
'Natural Language :: Bulgarian',
|
|
|
|
'Natural Language :: Catalan',
|
|
|
|
'Natural Language :: Czech',
|
|
|
|
'Natural Language :: Dutch',
|
|
|
|
'Natural Language :: English',
|
|
|
|
'Natural Language :: French',
|
|
|
|
'Natural Language :: German',
|
2018-06-22 12:19:12 +02:00
|
|
|
'Natural Language :: Hungarian',
|
|
|
|
'Natural Language :: Italian',
|
|
|
|
'Natural Language :: Portuguese (Brazilian)',
|
2015-10-23 18:55:27 +02:00
|
|
|
'Natural Language :: Russian',
|
2018-06-22 12:19:12 +02:00
|
|
|
'Natural Language :: Slovenian',
|
2015-10-23 18:55:27 +02:00
|
|
|
'Natural Language :: Spanish',
|
|
|
|
'Operating System :: OS Independent',
|
2018-06-22 12:19:12 +02:00
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
2019-02-26 11:03:17 +01:00
|
|
|
'Programming Language :: Python :: 3.6',
|
|
|
|
'Programming Language :: Python :: 3.7',
|
2018-06-22 12:19:12 +02:00
|
|
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
|
|
'Programming Language :: Python :: Implementation :: PyPy',
|
2015-10-23 18:55:27 +02:00
|
|
|
'Topic :: Office/Business',
|
|
|
|
],
|
|
|
|
license='GPL-3',
|
2019-02-26 11:03:17 +01:00
|
|
|
python_requires='>=3.4',
|
2015-10-23 18:55:27 +02:00
|
|
|
install_requires=requires,
|
2019-02-28 12:54:38 +01:00
|
|
|
dependency_links=dependency_links,
|
2015-10-23 18:55:27 +02:00
|
|
|
zip_safe=False,
|
|
|
|
entry_points="""
|
|
|
|
[trytond.modules]
|
2018-06-22 12:19:12 +02:00
|
|
|
sale_unit_load = trytond.modules.sale_unit_load
|
|
|
|
""",
|
2015-10-23 18:55:27 +02:00
|
|
|
test_suite='tests',
|
|
|
|
test_loader='trytond.test_loader:Loader',
|
|
|
|
tests_require=tests_require,
|
|
|
|
)
|