Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29e236de97 | ||
|
|
8e0d90afae |
@@ -71,7 +71,6 @@ jobs:
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import tomllib
|
|
||||||
|
|
||||||
OWNER = 'tryton-do'
|
OWNER = 'tryton-do'
|
||||||
PACKAGE_TYPE = 'pypi'
|
PACKAGE_TYPE = 'pypi'
|
||||||
@@ -89,8 +88,7 @@ jobs:
|
|||||||
series = os.environ['PACKAGE_SERIES']
|
series = os.environ['PACKAGE_SERIES']
|
||||||
major, minor = map(int, series.split('.'))
|
major, minor = map(int, series.split('.'))
|
||||||
|
|
||||||
pyproject = tomllib.loads(Path('pyproject.toml').read_text())
|
package_name = 'unpaismejor_account_do'
|
||||||
package_name = pyproject['project']['name']
|
|
||||||
normalized_name = normalize(package_name)
|
normalized_name = normalize(package_name)
|
||||||
|
|
||||||
username = os.environ['TWINE_USERNAME']
|
username = os.environ['TWINE_USERNAME']
|
||||||
|
|||||||
+17
-2
@@ -1,6 +1,21 @@
|
|||||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
# this repository contains the full copyright notices and license terms.
|
# this repository contains the full copyright notices and license terms.
|
||||||
|
|
||||||
from . import invoice, tax
|
from trytond.pool import Pool
|
||||||
|
|
||||||
__all__ = ['invoice', 'tax']
|
from . import account, invoice, ir, tax
|
||||||
|
|
||||||
|
__all__ = ['register']
|
||||||
|
|
||||||
|
|
||||||
|
def register():
|
||||||
|
Pool.register(
|
||||||
|
ir.ModelData,
|
||||||
|
invoice.Invoice,
|
||||||
|
invoice.InvoiceLine,
|
||||||
|
tax.TaxTemplate,
|
||||||
|
tax.Tax,
|
||||||
|
module='account_do', type_='model')
|
||||||
|
Pool.register(
|
||||||
|
account.CreateChart,
|
||||||
|
module='account_do', type_='wizard')
|
||||||
|
|||||||
+4
-13
@@ -14,31 +14,22 @@ else:
|
|||||||
|
|
||||||
def get_info():
|
def get_info():
|
||||||
import configparser
|
import configparser
|
||||||
import json
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
module_dir = os.path.dirname(os.path.dirname(__file__))
|
module_dir = os.path.dirname(os.path.dirname(__file__))
|
||||||
|
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read_file(open(os.path.join(module_dir, 'tryton.cfg')))
|
config.read_file(open(os.path.join(module_dir, 'tryton.cfg')))
|
||||||
info = dict(config.items('tryton'))
|
info = dict(config.items('tryton'))
|
||||||
|
|
||||||
metadata_cmd = 'python3 -m build -qq --metadata'
|
info['name'] = 'unpaismejor_account_do'
|
||||||
if os.environ.get('DOC_NO_ISOLATION'):
|
info['description'] = 'Dominican Republic accounting for Tryton'
|
||||||
metadata_cmd += ' --no-isolation'
|
major_version, minor_version, _ = info['version'].split('.', 2)
|
||||||
metadata = subprocess.check_output(
|
|
||||||
metadata_cmd, shell=True, encoding='utf-8', cwd=module_dir).strip()
|
|
||||||
metadata = json.loads(metadata)
|
|
||||||
info['name'] = metadata['name']
|
|
||||||
info['description'] = metadata['summary']
|
|
||||||
major_version, minor_version, _ = metadata['version'].split('.', 2)
|
|
||||||
major_version = int(major_version)
|
major_version = int(major_version)
|
||||||
minor_version = int(minor_version)
|
minor_version = int(minor_version)
|
||||||
if minor_version % 2:
|
if minor_version % 2:
|
||||||
info['series'] = 'latest'
|
info['series'] = 'latest'
|
||||||
info['branch'] = 'branch/default'
|
info['branch'] = 'branch/default'
|
||||||
else:
|
else:
|
||||||
info['series'] = '.'.join(metadata['version'].split('.', 2)[:2])
|
info['series'] = '.'.join(info['version'].split('.', 2)[:2])
|
||||||
info['branch'] = 'branch/' + info['series']
|
info['branch'] = 'branch/' + info['series']
|
||||||
|
|
||||||
for key in {'depends', 'extras_depend'}:
|
for key in {'depends', 'extras_depend'}:
|
||||||
|
|||||||
@@ -1,69 +0,0 @@
|
|||||||
[build-system]
|
|
||||||
requires = ['hatchling >= 1', 'hatch-tryton']
|
|
||||||
build-backend = 'hatchling.build'
|
|
||||||
|
|
||||||
[project]
|
|
||||||
name = 'unpaismejor_account_do'
|
|
||||||
dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme']
|
|
||||||
requires-python = '>=3.10'
|
|
||||||
maintainers = [
|
|
||||||
{name = "Fundación Un País Mejor"},
|
|
||||||
]
|
|
||||||
description = "Dominican Republic accounting for Tryton"
|
|
||||||
license = 'GPL-3.0-or-later'
|
|
||||||
license-files = ['LICENSE', 'COPYRIGHT']
|
|
||||||
keywords = ["tryton", "accounting", "coa", "dominican-republic"]
|
|
||||||
classifiers = [
|
|
||||||
"Development Status :: 5 - Production/Stable",
|
|
||||||
"Environment :: Plugins",
|
|
||||||
"Framework :: Tryton",
|
|
||||||
"Topic :: Office/Business",
|
|
||||||
"Topic :: Office/Business :: Financial :: Accounting",
|
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
||||||
]
|
|
||||||
|
|
||||||
[project.entry-points.'trytond.modules']
|
|
||||||
account_do = 'trytond.modules.account_do'
|
|
||||||
|
|
||||||
[project.urls]
|
|
||||||
homepage = "https://www.unpaismejor.org.do"
|
|
||||||
documentation = "https://docs.tryton.org/modules-account-do/"
|
|
||||||
changelog = "https://docs.tryton.org/modules-account-do/releases.html"
|
|
||||||
forum = "https://www.tryton.org/forum"
|
|
||||||
issues = "https://bugs.tryton.org/tryton"
|
|
||||||
repository = "https://code.unpaismejor.org.do/tryton-do/account_do"
|
|
||||||
funding = "https://www.tryton.org/donate"
|
|
||||||
|
|
||||||
[tool.hatch.build]
|
|
||||||
include = [
|
|
||||||
'README.rst',
|
|
||||||
'CHANGELOG',
|
|
||||||
'pyproject.toml',
|
|
||||||
'**/tryton.cfg',
|
|
||||||
'**/*.py',
|
|
||||||
'**/*.xml',
|
|
||||||
'**/*.po',
|
|
||||||
'doc/**/*.rst',
|
|
||||||
'doc/**/*.py',
|
|
||||||
'view/**/*.xml',
|
|
||||||
'**/*.fodt',
|
|
||||||
'icons/**/*.svg',
|
|
||||||
'tests/**/*.rst',
|
|
||||||
'tests/**/*.json',
|
|
||||||
]
|
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel.sources]
|
|
||||||
"" = "trytond/modules/account_do"
|
|
||||||
|
|
||||||
[tool.hatch.metadata.hooks.tryton]
|
|
||||||
dependencies = []
|
|
||||||
copyright = 'COPYRIGHT'
|
|
||||||
readme = 'README.rst'
|
|
||||||
|
|
||||||
[tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies]
|
|
||||||
test = [
|
|
||||||
'proteus',
|
|
||||||
'trytond-account-asset',
|
|
||||||
'trytond-account-deposit',
|
|
||||||
'trytond-account-stock-continental',
|
|
||||||
]
|
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
from configparser import ConfigParser
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from setuptools import setup
|
||||||
|
|
||||||
|
|
||||||
|
MODULE = 'account_do'
|
||||||
|
PREFIX = 'trytond.modules'
|
||||||
|
PACKAGE = f'{PREFIX}.{MODULE}'
|
||||||
|
|
||||||
|
|
||||||
|
def read(path):
|
||||||
|
return Path(path).read_text(encoding='utf-8')
|
||||||
|
|
||||||
|
|
||||||
|
config = ConfigParser()
|
||||||
|
config.read('tryton.cfg')
|
||||||
|
version = config.get('tryton', 'version')
|
||||||
|
major, minor, _ = version.split('.', 2)
|
||||||
|
series = f'{major}.{minor}'
|
||||||
|
next_major = f'{major}.{int(minor) + 1}'
|
||||||
|
|
||||||
|
|
||||||
|
setup(
|
||||||
|
name='unpaismejor_account_do',
|
||||||
|
version=version,
|
||||||
|
description='Dominican Republic accounting 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',
|
||||||
|
url='https://code.unpaismejor.org.do/tryton-do/account_do',
|
||||||
|
keywords='tryton accounting coa 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=[
|
||||||
|
f'trytond >= {series}, < {next_major}',
|
||||||
|
f'trytond_account >= {series}, < {next_major}',
|
||||||
|
f'trytond_account_invoice >= {series}, < {next_major}',
|
||||||
|
],
|
||||||
|
extras_require={
|
||||||
|
'test': [
|
||||||
|
f'proteus >= {series}, < {next_major}',
|
||||||
|
f'trytond_account_asset >= {series}, < {next_major}',
|
||||||
|
f'trytond_account_deposit >= {series}, < {next_major}',
|
||||||
|
f'trytond_account_stock_continental >= {series}, < {next_major}',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
entry_points={
|
||||||
|
'trytond.modules': [
|
||||||
|
f'{MODULE} = {PACKAGE}',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
zip_safe=False,
|
||||||
|
)
|
||||||
@@ -11,7 +11,8 @@ Imports::
|
|||||||
|
|
||||||
Install account_do::
|
Install account_do::
|
||||||
|
|
||||||
>>> config = activate_modules('account_do', create_company)
|
>>> config = activate_modules('account_do')
|
||||||
|
>>> _ = create_company()
|
||||||
|
|
||||||
Get the test company::
|
Get the test company::
|
||||||
|
|
||||||
|
|||||||
+13
-16
@@ -621,7 +621,7 @@ class AccountDoUnitTestCase(unittest.TestCase):
|
|||||||
if line.strip()
|
if line.strip()
|
||||||
]
|
]
|
||||||
|
|
||||||
self.assertEqual(config.get('tryton', 'version'), '8.0.5')
|
self.assertEqual(config.get('tryton', 'version'), '7.0.0')
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
set(lines('tryton', 'depends')),
|
set(lines('tryton', 'depends')),
|
||||||
{'account', 'account_invoice', 'ir'})
|
{'account', 'account_invoice', 'ir'})
|
||||||
@@ -652,27 +652,24 @@ class AccountDoUnitTestCase(unittest.TestCase):
|
|||||||
self.assertTrue((MODULE_DIR / filename).is_file())
|
self.assertTrue((MODULE_DIR / filename).is_file())
|
||||||
self.assertTrue((MODULE_DIR / 'account.py').is_file())
|
self.assertTrue((MODULE_DIR / 'account.py').is_file())
|
||||||
self.assertTrue((MODULE_DIR / 'tax.py').is_file())
|
self.assertTrue((MODULE_DIR / 'tax.py').is_file())
|
||||||
pyproject = (MODULE_DIR / 'pyproject.toml').read_text(encoding='utf-8')
|
setup_py = (MODULE_DIR / 'setup.py').read_text(encoding='utf-8')
|
||||||
self.assertIn("name = 'unpaismejor_account_do'", pyproject)
|
self.assertIn("name='unpaismejor_account_do'", setup_py)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"account_do = 'trytond.modules.account_do'", pyproject)
|
"f'{MODULE} = {PACKAGE}'", setup_py)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'{name = "Fundación Un País Mejor"}', pyproject)
|
"maintainer='Fundación Un País Mejor'", setup_py)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'homepage = "https://www.unpaismejor.org.do"', pyproject)
|
"url='https://code.unpaismejor.org.do/tryton-do/account_do'",
|
||||||
|
setup_py)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
('repository = "https://code.unpaismejor.org.do/'
|
"python_requires='>=3.8'", setup_py)
|
||||||
'tryton-do/account_do"'), pyproject)
|
|
||||||
for package_file in [
|
for package_file in [
|
||||||
"'README.rst'",
|
"'*.xml'",
|
||||||
"'CHANGELOG'",
|
"'view/*.xml'",
|
||||||
"'pyproject.toml'",
|
"'locale/*.po'",
|
||||||
"'**/*.xml'",
|
"'doc/*.rst'",
|
||||||
"'**/*.po'",
|
|
||||||
"'doc/**/*.rst'",
|
|
||||||
"'tests/**/*.rst'",
|
|
||||||
]:
|
]:
|
||||||
self.assertIn(package_file, pyproject)
|
self.assertIn(package_file, setup_py)
|
||||||
for filename in [
|
for filename in [
|
||||||
'__init__.py',
|
'__init__.py',
|
||||||
'account.py',
|
'account.py',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = {py310,py311,py312,py313,py314}-{sqlite,postgresql}
|
envlist = {py38,py39,py310,py311}-{sqlite,postgresql}
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
changedir = {env_site_packages_dir}
|
changedir = {env_site_packages_dir}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
[tryton]
|
[tryton]
|
||||||
version=8.0.5
|
version=7.0.0
|
||||||
depends:
|
depends:
|
||||||
account
|
account
|
||||||
account_invoice
|
account_invoice
|
||||||
|
|||||||
Reference in New Issue
Block a user