85 lines
2.2 KiB
Python
85 lines
2.2 KiB
Python
from configparser import ConfigParser
|
|||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
from setuptools import setup
|
||
|
|
|
||
|
|
|
||
|
|
MODULE = 'account_invoice_do'
|
||
|
|
PREFIX = 'trytond.modules'
|
||
|
|
PACKAGE = f'{PREFIX}.{MODULE}'
|
||
|
|
MODULE2PREFIX = {
|
||
|
|
'account_do': 'unpaismejor',
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
def read(path):
|
||
|
|
return Path(path).read_text(encoding='utf-8')
|
||
|
|
|
||
|
|
|
||
|
|
config = ConfigParser()
|
||
|
|
config.read('tryton.cfg')
|
||
|
|
version = config.get('tryton', 'version')
|
||
|
|
depends = [
|
||
|
|
dep.strip()
|
||
|
|
for dep in config.get('tryton', 'depends', fallback='').splitlines()
|
||
|
|
if dep.strip()
|
||
|
|
]
|
||
|
|
major, minor, _ = version.split('.', 2)
|
||
|
|
series = f'{major}.{minor}'
|
||
|
|
next_series = f'{major}.{int(minor) + 1}'
|
||
|
|
|
||
|
|
|
||
|
|
def require(name):
|
||
|
|
prefix = MODULE2PREFIX.get(name, 'trytond')
|
||
|
|
return f'{prefix}_{name} >= {series}, < {next_series}'
|
||
|
|
|
||
|
|
|
||
|
|
setup(
|
||
|
|
name='unpaismejor_account_invoice_do',
|
||
|
|
version=version,
|
||
|
|
description='Dominican Republic invoices for Tryton',
|
||
|
|
long_description=read('README.rst'),
|
||
|
|
long_description_content_type='text/x-rst',
|
||
|
|
author='Fundación Un País Mejor',
|
||
|
|
maintainer='Fundación Un País Mejor',
|
||
|
|
maintainer_email='jgarcia@unpaismejor.org.do',
|
||
|
|
url='https://code.unpaismejor.org.do/tryton-do/account_invoice_do',
|
||
|
|
keywords='tryton accounting invoice dominican-republic',
|
||
|
|
license='GPL-3.0-or-later',
|
||
|
|
python_requires='>=3.8',
|
||
|
|
packages=[PACKAGE],
|
||
|
|
package_dir={PACKAGE: '.'},
|
||
|
|
package_data={
|
||
|
|
PACKAGE: [
|
||
|
|
'tryton.cfg',
|
||
|
|
'*.xml',
|
||
|
|
'view/*.xml',
|
||
|
|
'locale/*.po',
|
||
|
|
'doc/*.rst',
|
||
|
|
],
|
||
|
|
},
|
||
|
|
classifiers=[
|
||
|
|
'Development Status :: 5 - Production/Stable',
|
||
|
|
'Environment :: Plugins',
|
||
|
|
'Framework :: Tryton',
|
||
|
|
'Topic :: Office/Business',
|
||
|
|
'Topic :: Office/Business :: Financial :: Accounting',
|
||
|
|
'Topic :: Software Development :: Libraries :: Python Modules',
|
||
|
|
],
|
||
|
|
install_requires=[
|
||
|
|
*(require(dep) for dep in depends if dep not in {'ir', 'res'}),
|
||
|
|
f'trytond >= {series}, < {next_series}',
|
||
|
|
],
|
||
|
|
extras_require={
|
||
|
|
'test': [
|
||
|
|
f'proteus >= {series}, < {next_series}',
|
||
|
|
],
|
||
|
|
},
|
||
|
|
entry_points={
|
||
|
|
'trytond.modules': [
|
||
|
|
f'{MODULE} = {PACKAGE}',
|
||
|
|
],
|
||
|
|
},
|
||
|
|
zip_safe=False,
|
||
|
|
)
|