2024-11-21 13:34:10 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# This file is part of the account-invoice-xrechnung-module
|
|
|
|
# from m-ds for Tryton. The COPYRIGHT file at the top level of
|
|
|
|
# this repository contains the full copyright notices and license terms.
|
2022-10-18 10:05:31 +00:00
|
|
|
|
2023-06-30 09:21:48 +00:00
|
|
|
from setuptools import setup
|
2022-10-18 10:05:31 +00:00
|
|
|
# To use a consistent encoding
|
|
|
|
from codecs import open
|
|
|
|
from os import path
|
|
|
|
import re
|
|
|
|
try:
|
|
|
|
from configparser import ConfigParser
|
|
|
|
except ImportError:
|
|
|
|
from ConfigParser import ConfigParser
|
|
|
|
|
|
|
|
here = path.abspath(path.dirname(__file__))
|
|
|
|
MODULE = 'account_invoice_xrechnung'
|
|
|
|
PREFIX = 'mds'
|
|
|
|
|
|
|
|
# Get the long description from the README file
|
|
|
|
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
|
|
|
|
long_description = f.read()
|
|
|
|
|
|
|
|
# tryton.cfg einlesen
|
|
|
|
config = ConfigParser()
|
|
|
|
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()
|
|
|
|
|
|
|
|
# Get module-versions
|
|
|
|
modversion = {}
|
|
|
|
with open(path.join(here, 'versiondep.txt'), encoding='utf-8') as f:
|
|
|
|
l1 = f.readlines()
|
|
|
|
for i in l1:
|
|
|
|
l2 = i.strip().split(';')
|
|
|
|
if len(l2) < 4:
|
|
|
|
continue
|
2023-06-30 09:21:48 +00:00
|
|
|
modversion[l2[0]] = {'min': l2[1], 'max': l2[2], 'prefix': l2[3]}
|
2022-10-18 10:05:31 +00:00
|
|
|
|
|
|
|
# tryton-version
|
2023-12-22 14:12:39 +00:00
|
|
|
major_version = 7
|
|
|
|
minor_version = 0
|
2022-10-18 10:05:31 +00:00
|
|
|
|
2022-10-20 12:43:58 +00:00
|
|
|
requires = ['python-slugify']
|
2022-10-18 10:05:31 +00:00
|
|
|
for dep in info.get('depends', []):
|
|
|
|
if not re.match(r'(ir|res|webdav)(\W|$)', dep):
|
|
|
|
if dep in modversion.keys():
|
|
|
|
prefix = 'mds'
|
|
|
|
if len(modversion[dep]['prefix']) > 0:
|
|
|
|
prefix = modversion[dep]['prefix']
|
|
|
|
|
|
|
|
if len(modversion[dep]['max']) > 0:
|
2023-06-30 09:21:48 +00:00
|
|
|
requires.append('%s_%s >= %s, <= %s' % (
|
|
|
|
prefix, dep, modversion[dep]['min'],
|
|
|
|
modversion[dep]['max']))
|
|
|
|
else:
|
|
|
|
requires.append('%s_%s >= %s' % (
|
|
|
|
prefix, dep, modversion[dep]['min']))
|
|
|
|
else:
|
|
|
|
requires.append('%s_%s >= %s.%s, < %s.%s' % (
|
|
|
|
'trytond', dep, major_version, minor_version,
|
2022-10-18 10:05:31 +00:00
|
|
|
major_version, minor_version + 1))
|
2023-06-30 09:21:48 +00:00
|
|
|
requires.append('trytond >= %s.%s, < %s.%s' % (
|
|
|
|
major_version, minor_version, major_version, minor_version + 1))
|
2022-10-18 10:05:31 +00:00
|
|
|
|
2023-06-30 09:21:48 +00:00
|
|
|
setup(
|
|
|
|
name='%s_%s' % (PREFIX, MODULE),
|
2022-10-18 10:05:31 +00:00
|
|
|
version=info.get('version', '0.0.1'),
|
|
|
|
description='Tryton module to add xrechnung-export to invoice.',
|
|
|
|
long_description=long_description,
|
|
|
|
url='https://www.m-ds.de/',
|
|
|
|
author='martin-data services',
|
|
|
|
author_email='service@m-ds.de',
|
|
|
|
license='GPL-3',
|
|
|
|
classifiers=[
|
2023-06-30 09:21:48 +00:00
|
|
|
'Development Status :: 5 - Production/Stable',
|
|
|
|
'Environment :: Plugins',
|
|
|
|
'Framework :: Tryton',
|
|
|
|
'Intended Audience :: Developers',
|
|
|
|
'Intended Audience :: Customer Service',
|
|
|
|
'Intended Audience :: Information Technology',
|
|
|
|
'Intended Audience :: Financial and Insurance Industry',
|
|
|
|
'Topic :: Office/Business',
|
|
|
|
'Topic :: Office/Business :: Financial :: Accounting',
|
|
|
|
'Natural Language :: German',
|
|
|
|
'Natural Language :: English',
|
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
'Programming Language :: Python :: 3.7',
|
|
|
|
'Programming Language :: Python :: 3.8',
|
|
|
|
'Programming Language :: Python :: 3.9',
|
2022-10-18 10:05:31 +00:00
|
|
|
],
|
|
|
|
|
2022-10-20 12:43:58 +00:00
|
|
|
keywords='tryton account invoice xrechnung edocument',
|
2022-10-18 10:05:31 +00:00
|
|
|
package_dir={'trytond.modules.%s' % MODULE: '.'},
|
|
|
|
packages=[
|
|
|
|
'trytond.modules.%s' % MODULE,
|
|
|
|
],
|
|
|
|
package_data={
|
2023-06-30 09:21:48 +00:00
|
|
|
'trytond.modules.%s' % MODULE: (
|
|
|
|
info.get('xml', [])
|
2022-10-18 10:05:31 +00:00
|
|
|
+ ['tryton.cfg', 'locale/*.po', 'tests/*.py',
|
2022-10-20 13:13:13 +00:00
|
|
|
'view/*.xml',
|
2022-10-20 12:48:31 +00:00
|
|
|
'report/*.fodt', 'versiondep.txt', 'README.rst']),
|
2022-10-18 10:05:31 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
install_requires=requires,
|
|
|
|
zip_safe=False,
|
|
|
|
entry_points="""
|
|
|
|
[trytond.modules]
|
|
|
|
%s = trytond.modules.%s
|
|
|
|
""" % (MODULE, MODULE),
|
|
|
|
)
|