details: https://code.tryton.org/relatorio/commit/0273bae9e5b5
branch: default
user: Cédric Krier <[email protected]>
date: Mon Mar 16 14:26:27 2026 +0100
description:
Upgrade to pyproject using hatchling as build-system
diffstat:
.gitlab-ci.yml | 4 +-
CHANGELOG | 1 +
COPYRIGHT | 5 ++-
MANIFEST.in | 5 ---
pyproject.toml | 56 ++++++++++++++++++++++++++++++++++++++
relatorio/render.py | 36 ++++++++++++++++++++++++
scripts/relatorio-render | 36 ------------------------
setup.cfg | 2 -
setup.py | 70 ------------------------------------------------
9 files changed, 98 insertions(+), 117 deletions(-)
diffs (265 lines):
diff -r 7c98d60e4e46 -r 0273bae9e5b5 .gitlab-ci.yml
--- a/.gitlab-ci.yml Mon Nov 24 13:39:19 2025 +0100
+++ b/.gitlab-ci.yml Mon Mar 16 14:26:27 2026 +0100
@@ -43,9 +43,9 @@
check-dist:
extends: .check
before_script:
- - pip install twine
+ - pip install build twine
script:
- - python setup.py sdist
+ - pyproject-build
- twine check dist/*
.test:
diff -r 7c98d60e4e46 -r 0273bae9e5b5 CHANGELOG
--- a/CHANGELOG Mon Nov 24 13:39:19 2025 +0100
+++ b/CHANGELOG Mon Mar 16 14:26:27 2026 +0100
@@ -1,3 +1,4 @@
+* Upgrade to pyproject
* Add support for Python 3.14
* Add support for Python 3.13
diff -r 7c98d60e4e46 -r 0273bae9e5b5 COPYRIGHT
--- a/COPYRIGHT Mon Nov 24 13:39:19 2025 +0100
+++ b/COPYRIGHT Mon Mar 16 14:26:27 2026 +0100
@@ -1,6 +1,7 @@
-Copyright (C) 2008-2024 Nicolas Évrard
+Copyright (C) 2008-2024 Nicolas Évrard <[email protected]>
Copyright (C) 2008-2009 Gaëtan de Menten
-Copyright (C) 2008-2024 Cédric Krier
+Copyright (C) 2008-2024 Cédric Krier <[email protected]>
+Copyright (C) 2008-2024 B2CK SRL
Copyright (C) 2008 Udo Spallek
Copyright (C) 2007-2008 OpenHex SPRL
diff -r 7c98d60e4e46 -r 0273bae9e5b5 MANIFEST.in
--- a/MANIFEST.in Mon Nov 24 13:39:19 2025 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-include LICENSE
-include COPYRIGHT
-include README.rst
-include CHANGELOG
-include doc/*
diff -r 7c98d60e4e46 -r 0273bae9e5b5 pyproject.toml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pyproject.toml Mon Mar 16 14:26:27 2026 +0100
@@ -0,0 +1,56 @@
+[build-system]
+requires = ['hatchling >= 1', 'hatch-tryton']
+build-backend = 'hatchling.build'
+
+[project]
+name = 'relatorio'
+dynamic = ['version', 'authors']
+dependencies = [
+ 'Genshi >= 0.5',
+ 'lxml >= 2.0',
+ ]
+requires-python= '>=3.5'
+maintainers = [
+ {name = "Tryton", email = "[email protected]"},
+ ]
+description = "A templating library able to output odt and pdf files"
+readme = 'README.rst'
+license = 'GPL-3.0-or-later'
+license-files = ['LICENSE', 'COPYRIGHT']
+keywords = ["templating", "OpenDocument", "PDF"]
+classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Intended Audience :: Developers",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Text Processing",
+ ]
+
+[project.scripts]
+relatorio-render = 'relatorio.render:run'
+
+[project.optional-dependencies]
+chart = [
+ 'pycha >= 0.4.0',
+ 'pyyaml',
+ # pycairo
+ ]
+fodt = [
+ 'python-magic',
+ ]
+
+[project.urls]
+homepage = "https://www.tryton.org/"
+documentation = "https://docs.tryton.org/relatorio"
+changelog = "https://docs.tryton.org/relatorio/releases.html"
+forum = "https://discuss.tryton.org/tags/relatorio"
+issues = "https://bugs.tryton.org/relatorio"
+repository = "https://code.tryton.org/relatorio"
+
+[tool.hatch.version]
+path = 'relatorio/__init__.py'
+
+[tool.hatch.build]
+packages = ['relatorio']
+
+[tool.hatch.metadata.hooks.tryton]
+copyright = 'COPYRIGHT'
diff -r 7c98d60e4e46 -r 0273bae9e5b5 relatorio/render.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/relatorio/render.py Mon Mar 16 14:26:27 2026 +0100
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+import json
+import mimetypes
+import os
+from argparse import ArgumentParser, FileType
+
+from relatorio import Report
+
+
+def main(input_, data, output=None):
+ input_ = os.path.abspath(input_)
+ mimetype, _ = mimetypes.guess_type(input_)
+ report = Report(input_, mimetype)
+ content = report(**data).render().getvalue()
+ if output:
+ with open(output, 'wb') as fp:
+ fp.write(content)
+
+
+def run():
+ parser = ArgumentParser()
+ parser.add_argument('-i', '--input', dest='input', required=True)
+ parser.add_argument('-o', '--output', dest='output')
+ parser.add_argument('-d', '--data', dest='data', type=FileType('r'),
+ help="JSON file with data to render")
+
+ args = parser.parse_args()
+ if args.data:
+ data = json.load(args.data)
+ else:
+ data = {}
+ main(args.input, data, args.output)
+
+
+if __name__ == '__main__':
+ run()
diff -r 7c98d60e4e46 -r 0273bae9e5b5 scripts/relatorio-render
--- a/scripts/relatorio-render Mon Nov 24 13:39:19 2025 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-import json
-import mimetypes
-import os
-from argparse import ArgumentParser, FileType
-
-from relatorio import Report
-
-
-def main(input_, data, output=None):
- input_ = os.path.abspath(input_)
- mimetype, _ = mimetypes.guess_type(input_)
- report = Report(input_, mimetype)
- content = report(**data).render().getvalue()
- if output:
- with open(output, 'wb') as fp:
- fp.write(content)
-
-
-def run():
- parser = ArgumentParser()
- parser.add_argument('-i', '--input', dest='input', required=True)
- parser.add_argument('-o', '--output', dest='output')
- parser.add_argument('-d', '--data', dest='data', type=FileType('r'),
- help="JSON file with data to render")
-
- args = parser.parse_args()
- if args.data:
- data = json.load(args.data)
- else:
- data = {}
- main(args.input, data, args.output)
-
-
-if __name__ == '__main__':
- run()
diff -r 7c98d60e4e46 -r 0273bae9e5b5 setup.cfg
--- a/setup.cfg Mon Nov 24 13:39:19 2025 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-[egg_info]
-
diff -r 7c98d60e4e46 -r 0273bae9e5b5 setup.py
--- a/setup.py Mon Nov 24 13:39:19 2025 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-import codecs
-import os
-import re
-
-from setuptools import find_packages, setup
-
-
-def read(fname):
- return codecs.open(
- os.path.join(os.path.dirname(__file__), fname), 'r', 'utf-8').read()
-
-
-def get_version():
- init = open(os.path.join(os.path.dirname(__file__), 'relatorio',
- '__init__.py')).read()
- return re.search(r"""__version__ = '([0-9.]*)'""", init).group(1)
-
-
-setup(
- name="relatorio",
- description="A templating library able to output odt and pdf files",
- long_description=read('README.rst'),
- author='Tryton',
- author_email='[email protected]',
- url='https://pypi.python.org/pypi/relatorio',
- download_url='https://downloads.tryton.org/relatorio/',
- project_urls={
- "Bug Tracker": 'https://bugs.tryton.org/relatorio',
- "Documentation": 'https://docs.tryton.org/relatorio',
- "Forum": 'https://discuss.tryton.org/tags/relatorio',
- "Source Code": 'https://code.tryton.org/relatorio',
- },
- keywords='templating OpenDocument PDF',
- license="GPL License",
- version=get_version(),
- packages=find_packages(exclude=['examples']),
- package_data={
- 'relatorio.tests': [
- '*.jpg', '*.odt', '*.fodt', '*.png', 'templates/*.tmpl'],
- },
- scripts=['scripts/relatorio-render'],
- python_requires='>=3.5',
- install_requires=[
- "Genshi >= 0.5",
- "lxml >= 2.0"
- ],
- extras_require={
- 'chart': ['pycha >= 0.4.0', 'pyyaml'], # pycairo
- 'fodt': ['python-magic'],
- },
- classifiers=[
- "Development Status :: 4 - Beta",
- "Intended Audience :: Developers",
- "License :: OSI Approved :: GNU General Public License (GPL)",
- "Operating System :: OS Independent",
- "Programming Language :: Python :: 3",
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
- 'Programming Language :: Python :: 3.11',
- 'Programming Language :: Python :: 3.12',
- 'Programming Language :: Python :: 3.13',
- 'Programming Language :: Python :: 3.14',
- "Topic :: Software Development :: Libraries :: Python Modules",
- "Topic :: Text Processing",
- ],
- )