This commit is contained in:
@@ -71,7 +71,6 @@ jobs:
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import tomllib
|
||||
|
||||
OWNER = 'tryton-do'
|
||||
PACKAGE_TYPE = 'pypi'
|
||||
@@ -89,8 +88,7 @@ jobs:
|
||||
series = os.environ['PACKAGE_SERIES']
|
||||
major, minor = map(int, series.split('.'))
|
||||
|
||||
pyproject = tomllib.loads(Path('pyproject.toml').read_text())
|
||||
package_name = pyproject['project']['name']
|
||||
package_name = 'unpaismejor_account_do'
|
||||
normalized_name = normalize(package_name)
|
||||
|
||||
username = os.environ['TWINE_USERNAME']
|
||||
|
||||
+4
-13
@@ -14,31 +14,22 @@ else:
|
||||
|
||||
def get_info():
|
||||
import configparser
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
module_dir = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read_file(open(os.path.join(module_dir, 'tryton.cfg')))
|
||||
info = dict(config.items('tryton'))
|
||||
|
||||
metadata_cmd = 'python3 -m build -qq --metadata'
|
||||
if os.environ.get('DOC_NO_ISOLATION'):
|
||||
metadata_cmd += ' --no-isolation'
|
||||
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)
|
||||
info['name'] = 'unpaismejor_account_do'
|
||||
info['description'] = 'Dominican Republic accounting for Tryton'
|
||||
major_version, minor_version, _ = info['version'].split('.', 2)
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
if minor_version % 2:
|
||||
info['series'] = 'latest'
|
||||
info['branch'] = 'branch/default'
|
||||
else:
|
||||
info['series'] = '.'.join(metadata['version'].split('.', 2)[:2])
|
||||
info['series'] = '.'.join(info['version'].split('.', 2)[:2])
|
||||
info['branch'] = 'branch/' + info['series']
|
||||
|
||||
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,
|
||||
)
|
||||
+12
-15
@@ -652,27 +652,24 @@ class AccountDoUnitTestCase(unittest.TestCase):
|
||||
self.assertTrue((MODULE_DIR / filename).is_file())
|
||||
self.assertTrue((MODULE_DIR / 'account.py').is_file())
|
||||
self.assertTrue((MODULE_DIR / 'tax.py').is_file())
|
||||
pyproject = (MODULE_DIR / 'pyproject.toml').read_text(encoding='utf-8')
|
||||
self.assertIn("name = 'unpaismejor_account_do'", pyproject)
|
||||
setup_py = (MODULE_DIR / 'setup.py').read_text(encoding='utf-8')
|
||||
self.assertIn("name='unpaismejor_account_do'", setup_py)
|
||||
self.assertIn(
|
||||
"account_do = 'trytond.modules.account_do'", pyproject)
|
||||
"f'{MODULE} = {PACKAGE}'", setup_py)
|
||||
self.assertIn(
|
||||
'{name = "Fundación Un País Mejor"}', pyproject)
|
||||
"maintainer='Fundación Un País Mejor'", setup_py)
|
||||
self.assertIn(
|
||||
'homepage = "https://www.unpaismejor.org.do"', pyproject)
|
||||
"url='https://code.unpaismejor.org.do/tryton-do/account_do'",
|
||||
setup_py)
|
||||
self.assertIn(
|
||||
('repository = "https://code.unpaismejor.org.do/'
|
||||
'tryton-do/account_do"'), pyproject)
|
||||
"python_requires='>=3.8'", setup_py)
|
||||
for package_file in [
|
||||
"'README.rst'",
|
||||
"'CHANGELOG'",
|
||||
"'pyproject.toml'",
|
||||
"'**/*.xml'",
|
||||
"'**/*.po'",
|
||||
"'doc/**/*.rst'",
|
||||
"'tests/**/*.rst'",
|
||||
"'*.xml'",
|
||||
"'view/*.xml'",
|
||||
"'locale/*.po'",
|
||||
"'doc/*.rst'",
|
||||
]:
|
||||
self.assertIn(package_file, pyproject)
|
||||
self.assertIn(package_file, setup_py)
|
||||
for filename in [
|
||||
'__init__.py',
|
||||
'account.py',
|
||||
|
||||
Reference in New Issue
Block a user