trytond-account_invoice_par.../setup.py

126 lines
4.2 KiB
Python
Raw Normal View History

2015-12-31 14:46:14 +01:00
#!/usr/bin/env python
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
try:
from configparser import ConfigParser
except ImportError:
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
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
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'
download_url = 'https://bitbucket.org/datalife_sco/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')
2018-06-21 17:07:53 +02:00
requires.append(get_require_version('%s_%s' % (prefix, dep)))
2015-12-31 14:46:14 +01:00
requires.append(get_require_version('trytond'))
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',
author_email='info@datalife.com.es',
2018-06-21 17:07:53 +02:00
url='https://bitbucket.org/datalife_sco/',
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', [])
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt',
'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',
'Programming Language :: Python :: 2.7',
2018-06-21 17:07:53 +02:00
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
2015-12-31 14:46:14 +01:00
'Topic :: Office/Business',
],
license='GPL-3',
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
test_suite='tests',
test_loader='trytond.test_loader:Loader',
tests_require=tests_require,
2018-06-21 17:07:53 +02:00
use_2to3=True,
2015-12-31 14:46:14 +01:00
)