trytond-account_invoice_par.../setup.py

125 lines
4.0 KiB
Python
Raw Normal View History

2019-02-28 13:56:36 +01:00
#!/usr/bin/env python3
2018-06-21 17:07:53 +02:00
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
2015-12-31 14:46:14 +01:00
from setuptools import setup
import re
import os
2018-06-21 17:07:53 +02:00
import io
2019-02-28 13:56:36 +01:00
from configparser import ConfigParser
2015-12-31 14:46:14 +01:00
MODULE2PREFIX = {}
def read(fname):
2018-06-21 17:07:53 +02:00
return io.open(
os.path.join(os.path.dirname(__file__), fname),
'r', encoding='utf-8').read()
2015-12-31 14:46:14 +01:00
2019-02-28 13:56:36 +01:00
2015-12-31 14:46:14 +01: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-21 17:07:53 +02:00
2019-02-28 13:56:36 +01:00
2018-06-21 17:07:53 +02:00
config = ConfigParser()
2015-12-31 14:46:14 +01: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-21 17:07:53 +02:00
name = 'datalife_account_invoice_party_invoice_to'
2020-02-11 13:40:49 +01:00
download_url = 'https://gitlab.com/datalifeit/trytond-account_invoice_party_invoice_to'
2015-12-31 14:46:14 +01:00
requires = []
for dep in info.get('depends', []):
2018-06-21 17:07:53 +02:00
if not re.match(r'(ir|res)(\W|$)', dep):
2015-12-31 14:46:14 +01:00
prefix = MODULE2PREFIX.get(dep, 'trytond')
2019-02-28 13:56:36 +01:00
2018-06-21 17:07:53 +02:00
requires.append(get_require_version('%s_%s' % (prefix, dep)))
2019-02-28 13:56:36 +01:00
2015-12-31 14:46:14 +01:00
requires.append(get_require_version('trytond'))
2019-02-28 13:56:36 +01:00
2015-12-31 14:46:14 +01:00
tests_require = [get_require_version('proteus')]
2018-06-21 17:07:53 +02:00
series = '%s.%s' % (major_version, minor_version)
if minor_version % 2:
branch = 'default'
else:
branch = series
dependency_links = []
if minor_version % 2:
# Add development index for testing with proteus
dependency_links.append('https://trydevpi.tryton.org/')
2015-12-31 14:46:14 +01:00
2018-06-21 17:07:53 +02:00
setup(name=name,
2015-12-31 14:46:14 +01:00
version=version,
2018-06-21 17:07:53 +02:00
description='Tryton Account invoice party invoice to module',
long_description=read('README.md'),
2015-12-31 14:46:14 +01:00
author='Datalife',
2020-02-11 13:40:49 +01:00
author_email='info@datalifeit.es',
url='https://gitlab.com/datalifeit/',
2018-06-21 17:07:53 +02:00
download_url=download_url,
keywords='',
package_dir={'trytond.modules.account_invoice_party_invoice_to': '.'},
2015-12-31 14:46:14 +01:00
packages=[
2018-06-21 17:07:53 +02:00
'trytond.modules.account_invoice_party_invoice_to',
'trytond.modules.account_invoice_party_invoice_to.tests',
2015-12-31 14:46:14 +01:00
],
package_data={
2018-06-21 17:07:53 +02:00
'trytond.modules.account_invoice_party_invoice_to': (info.get('xml', [])
2019-02-28 13:56:36 +01:00
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.fodt',
2018-06-21 17:07:53 +02:00
'icons/*.svg', 'tests/*.rst']),
2015-12-31 14:46:14 +01: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-21 17:07:53 +02:00
'Natural Language :: Hungarian',
'Natural Language :: Italian',
'Natural Language :: Portuguese (Brazilian)',
2015-12-31 14:46:14 +01:00
'Natural Language :: Russian',
2018-06-21 17:07:53 +02:00
'Natural Language :: Slovenian',
2015-12-31 14:46:14 +01:00
'Natural Language :: Spanish',
'Operating System :: OS Independent',
2018-06-21 17:07:53 +02:00
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
2019-02-28 13:56:36 +01:00
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
2018-06-21 17:07:53 +02:00
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
2015-12-31 14:46:14 +01:00
'Topic :: Office/Business',
],
license='GPL-3',
2019-02-28 13:56:36 +01:00
python_requires='>=3.4',
2015-12-31 14:46:14 +01:00
install_requires=requires,
2018-06-21 17:07:53 +02:00
dependency_links=dependency_links,
2015-12-31 14:46:14 +01:00
zip_safe=False,
entry_points="""
[trytond.modules]
2018-06-21 17:07:53 +02:00
account_invoice_party_invoice_to = trytond.modules.account_invoice_party_invoice_to
""",
2015-12-31 14:46:14 +01:00
)