details: https://code.tryton.org/tools/maintenance/commit/9ed9e0b161c1
branch: default
user: Cédric Krier <[email protected]>
date: Sat Mar 21 09:14:38 2026 +0100
description:
Support packaging with pyproject
diffstat:
do_major_release | 49 ++++++++++++++++++++++++++++++++++++++++---------
do_minor_release | 35 +++++++++++++++++++++++++++++------
increase_version | 14 ++++++++++----
update_changelog | 6 +++++-
update_translations | 8 +++++++-
5 files changed, 91 insertions(+), 21 deletions(-)
diffs (220 lines):
diff -r dd02cc144563 -r 9ed9e0b161c1 do_major_release
--- a/do_major_release Wed Feb 18 19:00:02 2026 +0100
+++ b/do_major_release Sat Mar 21 09:14:38 2026 +0100
@@ -23,18 +23,29 @@
tags=()
versions=()
-filenames=$(find . -name setup.py -not -path "*/cookiecutter-module/*" -not
-path "*/.*/*" -o -name package.json -not -path "*/node_modules/*" -not -path
"*/bower_components/*")
+filenames=$(find . -name pyproject.toml -not -path "*/cookiecutter-module/*"
-not -path "*/.*/*" -o -name setup.py -not -path "*/cookiecutter-module/*" -not
-path "*/.*/*" -o -name package.json -not -path "*/node_modules/*" -not -path
"*/bower_components/*")
for filename in ${filenames}; do
cd "$(dirname $filename)"
echo "prepare $(basename $(pwd))"
- if [ -f setup.py ]; then
+ if [ -f pyproject.toml ]; then
+ echo "increase version number"
+ increase_version -d
+
+ version=`python -m build -qq --metadata 2>/dev/null | jq -r .version`
+ name=`python -m build -qq --metadata 2>/dev/null | jq -r .name`
+ elif [ -f setup.py ]; then
chmod +x setup.py
echo "increase version number"
increase_version -d
version=`./setup.py -V`
name=`./setup.py --name`
+
+ if [ ${name} == "tryton" ]; then
+ echo "compile catalog"
+ ./setup.py compile_catalog
+ fi
else
echo "increase version number"
minor=`npm version --json | python3 -c "import json,sys;
print(json.load(sys.stdin)['tryton-sao'].split('.')[1])"`
@@ -48,10 +59,7 @@
name="tryton-sao"
fi
- if [ ${name} == "tryton" ]; then
- echo "compile catalog"
- ./setup.py compile_catalog
- elif [ ${name} == "tryton-sao" ]; then
+ if [ -f Gruntfile.js ]; then
echo "compile"
grunt
fi
@@ -101,7 +109,25 @@
cd "$(dirname $filename)"
echo "release $(basename $(pwd))"
- if [ -f setup.py ]; then
+ if [ -f pyproject.toml ]; then
+ echo "build"
+ pyproject-build
+
+ name=`python -m build -qq --metadata 2>/dev/null | jq -r .name`
+
+ if ! ${test}; then
+ echo "upload to pypi"
+ twine upload dist/${name}-${version}*
+ fi
+
+ echo "sign archive"
+ signify -S -s "${TRYTON_SIGNIFY_KEYS}/${series}.sec" -m
dist/${name}-${version}.tar.gz
+
+ if ! ${test}; then
+ echo "copy to downloads.tryton.org"
+ scp dist/${name}-${version}.tar.gz{,.sig}
downloads.tryton.org:/home/downloads/${series}/
+ fi
+ elif [ -f setup.py ]; then
echo "clean build"
./setup.py clean --all
@@ -166,7 +192,10 @@
cd "$(dirname $filename)"
echo "increase version $(basename $(pwd))"
- if [ -f setup.py ]; then
+ if [ -f pyproject.toml ]; then
+ echo "increase version number ${branch}"
+ increase_version
+ elif [ -f setup.py ]; then
echo "increase version number ${branch}"
increase_version
else
@@ -184,7 +213,9 @@
cd "$(dirname $filename)"
echo "increase version $(basename $(pwd))"
- if [ -f setup.py ]; then
+ if [ -f pyproject.toml ]; then
+ increase_version -d
+ elif [ -f setup.py ]; then
increase_version -d
else
minor=`npm version --json | python3 -c "import json,sys;
print(json.load(sys.stdin)['tryton-sao'].split('.')[1])"`
diff -r dd02cc144563 -r 9ed9e0b161c1 do_minor_release
--- a/do_minor_release Wed Feb 18 19:00:02 2026 +0100
+++ b/do_minor_release Sat Mar 21 09:14:38 2026 +0100
@@ -25,10 +25,18 @@
exit 1
fi
-if [ -f setup.py ]; then
+if [ -f pyproject.toml ]; then
+ version=`python -m build -qq --metadata 2>/dev/null | jq -r .version`
+ name=`python -m build -qq --metadata 2>/dev/null | jq -r .name`
+elif [ -f setup.py ]; then
chmod +x setup.py
version=`./setup.py -V`
name=`./setup.py --name`
+
+ if [ ${name} == "tryton" ]; then
+ echo "compile catalog"
+ ./setup.py compile_catalog
+ fi
else
version=`npm version --json | python3 -c "import json,sys;
print(json.load(sys.stdin)['tryton-sao'])"`
name="tryton-sao"
@@ -40,10 +48,7 @@
exit 1
fi
-if [ ${name} == "tryton" ]; then
- echo "compile catalog"
- ./setup.py compile_catalog
-elif [ ${name} == "tryton-sao" ]; then
+if [ -f Gruntfile.js ]; then
echo "compile"
grunt
fi
@@ -67,7 +72,25 @@
echo "tag"
hg tag "${tag}-${version}" -m "Add tag ${tag}-${version}"
-if [ -f setup.py ]; then
+if [ -f pyproject.toml ]; then
+ echo "build"
+ pyproject-build
+ if ! ${test}; then
+ echo "upload to pypi"
+ twine upload dist/${name}-${version}*
+ fi
+
+ echo "sign archive"
+ signify -S -s "${TRYTON_SIGNIFY_KEYS}/${series}.sec" -m
dist/${name}-${version}.tar.gz
+
+ if ! ${test}; then
+ echo "copy to downloads.tryton.org"
+ scp dist/${name}-${version}.tar.gz{,.sig}
downloads.tryton.org:/home/downloads/${series}/
+ fi
+
+ echo "increase version number"
+ increase_version
+elif [ -f setup.py ]; then
echo "clean build"
./setup.py clean --all
diff -r dd02cc144563 -r 9ed9e0b161c1 increase_version
--- a/increase_version Wed Feb 18 19:00:02 2026 +0100
+++ b/increase_version Sat Mar 21 09:14:38 2026 +0100
@@ -3,13 +3,19 @@
Increase version number of current repository.
Use -d for development release
"""
+import json
+import os
import subprocess
-import os
import sys
-version = subprocess.check_output(
- 'python setup.py -V', shell=True, encoding='utf-8').strip()
-version_info = list(map(int, version.replace('dev0', '0').split('.')))
+if os.path.exists('pyproject.toml'):
+ version = subprocess.check_output(
+ 'python -m build -qq --metadata', shell=True, encoding='utf-8').strip()
+ version = json.loads(version)['version']
+else:
+ version = subprocess.check_output(
+ 'python setup.py -V', shell=True, encoding='utf-8').strip()
+ version_info = list(map(int, version.replace('dev0', '0').split('.')))
if (version_info[1] % 2
or version_info[2] == 0 and '-d' in sys.argv):
version_info[1] += 1
diff -r dd02cc144563 -r 9ed9e0b161c1 update_changelog
--- a/update_changelog Wed Feb 18 19:00:02 2026 +0100
+++ b/update_changelog Sat Mar 21 09:14:38 2026 +0100
@@ -8,7 +8,11 @@
import os
import subprocess
-if os.path.exists('setup.py'):
+if os.path.exists('pyproject.toml'):
+ version = subprocess.check_output(
+ 'python -m build -qq --metadata', shell=True, encoding='utf-8').strip()
+ version = json.loads(version)['version']
+elif os.path.exists('setup.py'):
version = subprocess.check_output(
'python setup.py -V', shell=True, encoding='utf-8').strip()
else:
diff -r dd02cc144563 -r 9ed9e0b161c1 update_translations
--- a/update_translations Wed Feb 18 19:00:02 2026 +0100
+++ b/update_translations Sat Mar 21 09:14:38 2026 +0100
@@ -36,7 +36,13 @@
psql -q -c "UPDATE ir_translation SET value = '', value_1 = '', value_2 = '',
value_3 = ''" translations
-(cd tryton; python3 setup.py extract_messages) >/dev/null
+(cd tryton;
+if [ -f pyproject.toml ]; then
+ pybabel extract --no-location --omit-header --strip-comments --keyword=_
--keyword=gettext --keyword=N_:1,2 --keyword=ngettext:1,2 --output
tryton/data/locale/tryton.pot tryton
+else
+ python3 setup.py extract_messages
+fi
+) >/dev/null
(cd sao; npm install --legacy-peer-deps --silent && ./node_modules/.bin/grunt
xgettext) >/dev/null
$SCRIPTS/export_weblate.py -d postgresql:///translations tryton sao
../translations