details: https://code.tryton.org/hatch-tryton/commit/1230d65e2022
branch: default
user: Cédric Krier <[email protected]>
date: Thu Mar 12 14:27:44 2026 +0100
description:
Use trytond as package name for the base modules
diffstat:
hatch_tryton/plugin.py | 2 ++
hatch_tryton/tests/test_metadata.py | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diffs (43 lines):
diff -r c1e376fe1766 -r 1230d65e2022 hatch_tryton/plugin.py
--- a/hatch_tryton/plugin.py Thu Mar 12 13:19:52 2026 +0100
+++ b/hatch_tryton/plugin.py Thu Mar 12 14:27:44 2026 +0100
@@ -39,6 +39,8 @@
def _package_name(module: str, prefixes: dict[str, str]) -> str:
+ if module in {'ir', 'res', 'tests'}:
+ return 'trytond'
prefix = prefixes.get(module, 'trytond')
return f'{prefix}_{module}'
diff -r c1e376fe1766 -r 1230d65e2022 hatch_tryton/tests/test_metadata.py
--- a/hatch_tryton/tests/test_metadata.py Thu Mar 12 13:19:52 2026 +0100
+++ b/hatch_tryton/tests/test_metadata.py Thu Mar 12 14:27:44 2026 +0100
@@ -81,6 +81,27 @@
metadata.get('dependencies', []))
@with_temporay_directory
+ def test_base_module_dependencies(self, directory: Path):
+ "Test base module dependencies"
+ config = {}
+ metadata = {
+ 'dynamic': ['dependencies'],
+ }
+ (directory / 'tryton.cfg').write_text(dedent("""\
+ [tryton]
+ version=1.0.0
+ depends:
+ res
+ ir
+ tests
+ """))
+ hook = TrytonMetadataHook(directory, config)
+ hook.update(metadata)
+ self.assertEqual(
+ ['trytond >= 1.0, < 1.1'] * 3,
+ metadata.get('dependencies', []))
+
+ @with_temporay_directory
def test_module_dependencies_prefix(self, directory: Path):
"Test module dependencies with prefix"
config = {