Merge branch 'trixieupdate' into 'master'

Use latest Trixie images for makebuildserver

See merge request fdroid/fdroidserver!1697
This commit is contained in:
linsui
2026-01-19 14:22:32 +00:00
16 changed files with 65 additions and 51 deletions

View File

@@ -263,7 +263,7 @@ ubuntu_jammy_pip:
# Run all the various linters and static analysis tools.
hooks/pre-commit:
stage: lint
image: debian:bookworm-slim
image: debian:trixie-slim
variables:
LANG: C.UTF-8
script:
@@ -279,13 +279,13 @@ hooks/pre-commit:
pyflakes3
python3-dev
python3-git
python3-nose
python3-nose2
python3-pip
python3-yaml
- ./hooks/pre-commit
bandit:
image: debian:bookworm-slim
image: debian:trixie-slim
<<: *python-rules-changes
<<: *apt-template
script:
@@ -295,7 +295,7 @@ bandit:
pylint:
stage: lint
image: debian:bookworm-slim
image: debian:trixie-slim
<<: *python-rules-changes
<<: *apt-template
script:
@@ -315,7 +315,7 @@ pylint:
shellcheck:
stage: lint
image: debian:bookworm-slim
image: debian:trixie-slim
rules:
- changes:
- .gitlab-ci.yml
@@ -354,7 +354,7 @@ pip-audit:
# so important to scan that kind of install in CI.
# https://docs.safetycli.com/safety-docs/installation/gitlab
safety:
image: debian:bookworm-slim
image: debian:trixie-slim
rules:
- if: $SAFETY_API_KEY
changes:
@@ -371,8 +371,11 @@ safety:
python3-biplist
python3-pip
python3-pycountry
python3-venv
- $pip install --break-system-packages .
- python3 -m venv --system-site-packages env
- . env/bin/activate
- $pip install --break-system-packages safety
- python3 -m safety --key "$SAFETY_API_KEY" --stage cicd scan
@@ -380,7 +383,7 @@ safety:
# TODO tests/*/*/*.yaml are not covered
yamllint:
stage: lint
image: debian:bookworm-slim
image: debian:trixie-slim
rules:
- changes:
- .gitlab-ci.yml
@@ -409,7 +412,7 @@ yamllint:
locales:
stage: lint
image: debian:bookworm-slim
image: debian:trixie-slim
variables:
LANG: C.UTF-8
script:
@@ -591,7 +594,7 @@ fdroid build:
# fdroiddata because that one is known to work, and this is a CI job,
# so it should be isolated from the normal churn of fdroiddata.
plugin_fetchsrclibs:
image: debian:bookworm-slim
image: debian:trixie-slim
<<: *apt-template
rules:
- changes:
@@ -609,13 +612,12 @@ plugin_fetchsrclibs:
python3-pil
python3-pip
python3-pycparser
python3-setuptools
python3-venv
- python3 -m venv --system-site-packages env
- . env/bin/activate
- export PATH="$CI_PROJECT_DIR:$PATH"
- export PYTHONPATH="$CI_PROJECT_DIR/examples"
# workaround https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003252
- export SETUPTOOLS_USE_DISTUTILS=stdlib
- $pip install -e .
- fdroid | grep fetchsrclibs
@@ -635,7 +637,7 @@ plugin_fetchsrclibs:
# test a full update and deploy cycle to gitlab.com
servergitmirrors:
image: debian:bookworm-slim
image: debian:trixie-slim
<<: *apt-template
rules:
- if: $CI_COMMIT_BRANCH == "master" && $CI_PROJECT_PATH == "fdroid/fdroidserver"
@@ -660,7 +662,6 @@ servergitmirrors:
- python3 -m venv --system-site-packages env
- . env/bin/activate
- export PYTHONPATH=`pwd`
- export SETUPTOOLS_USE_DISTUTILS=stdlib # https://github.com/pypa/setuptools/issues/2956
- $pip install -e .
- mkdir /root/.ssh/
- ./tests/key-tricks.py
@@ -679,12 +680,12 @@ servergitmirrors:
- diff repo/index-v1.jar index-v1.jar
Build documentation:
image: debian:bookworm-slim
image: debian:trixie-slim
<<: *python-rules-changes
<<: *apt-template
script:
- apt-get install make python3-sphinx python3-numpydoc python3-pydata-sphinx-theme pydocstyle fdroidserver
- apt purge fdroidserver
- apt-get purge fdroidserver
# ignore vendored files
- pydocstyle --verbose --match='(?!apksigcopier|looseversion|setup|test_).*\.py' fdroidserver
- cd docs
@@ -783,7 +784,7 @@ docker:
- cd buildserver
- docker build -t $TEST_IMAGE --build-arg GIT_REV_PARSE_HEAD=$(git rev-parse HEAD) .
- docker tag $TEST_IMAGE $RELEASE_IMAGE
- docker tag $TEST_IMAGE ${RELEASE_IMAGE}-bookworm
- docker tag $TEST_IMAGE ${RELEASE_IMAGE}-trixie
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin registry.gitlab.com
# This avoids filling up gitlab.com free tier accounts with unused docker images.
- if test -z "$FDROID_PUSH_DOCKER_IMAGE"; then
@@ -793,7 +794,7 @@ docker:
exit 0;
fi
- docker push $RELEASE_IMAGE
- docker push $RELEASE_IMAGE-bookworm
- docker push $RELEASE_IMAGE-trixie
# PUBLISH is the signing server. It has a very minimal manual setup.

View File

@@ -1,5 +1,5 @@
FROM debian:bookworm
FROM debian:trixie
ENV LANG=C.UTF-8 \
DEBIAN_FRONTEND=noninteractive

View File

@@ -35,7 +35,7 @@ Vagrant.configure("2") do |config|
config.cache.enable :chef
end
config.vm.box = "debian/bookworm64"
config.vm.box = "debian/testing64"
if not configfile.has_key? "vm_provider" or configfile["vm_provider"] == "virtualbox"
# default to VirtualBox if not set

View File

@@ -39,11 +39,11 @@ if echo $debian_mirror | grep '^https' 2>&1 > /dev/null; then
fi
cat << EOF > /etc/apt/sources.list
deb ${debian_mirror} bookworm main
deb https://security.debian.org/debian-security bookworm-security main
deb ${debian_mirror} bookworm-updates main
deb ${debian_mirror} trixie main
deb https://security.debian.org/debian-security trixie-security main
deb ${debian_mirror} trixie-updates main
EOF
echo "deb ${debian_mirror} bookworm-backports main" > /etc/apt/sources.list.d/backports.list
echo "deb ${debian_mirror} trixie-backports main" > /etc/apt/sources.list.d/backports.list
apt-get update || apt-get update
@@ -104,7 +104,7 @@ apt-get upgrade
apt-get update || apt-get update
packages="
androguard/bookworm-backports
androguard/trixie-backports
apksigner
default-jdk-headless
default-jre-headless
@@ -118,7 +118,7 @@ packages="
python3-magic
python3-packaging
rsync
sdkmanager/bookworm-backports
sdkmanager
sudo
unzip
"

View File

@@ -616,7 +616,7 @@ def checkupdates_app(app: metadata.App, auto: bool, make_commit: bool = False) -
newbuilds = copy.deepcopy(builds[-len(vercodes):])
# These are either built-in or invalid in newer system versions
bookworm_blocklist = [
trixie_blocklist = [
'apt-get install -y openjdk-11-jdk',
'apt-get install openjdk-11-jdk-headless',
'apt-get install -y openjdk-11-jdk-headless',
@@ -625,14 +625,24 @@ def checkupdates_app(app: metadata.App, auto: bool, make_commit: bool = False) -
'apt-get install -y openjdk-17-jdk',
'apt-get install openjdk-17-jdk-headless',
'apt-get install -y openjdk-17-jdk-headless',
'apt-get install -y -t trixie openjdk-17-jdk-headless',
'apt-get install -t trixie openjdk-21-jdk-headless',
'apt-get install -y openjdk-21-jdk-headless',
'apt-get install -y -t sid openjdk-21-jdk-headless',
'apt-get install -y -t trixie openjdk-21-jdk-headless',
'apt-get install -y -t trixie openjdk-22-jdk-headless',
'apt-get install -y -t trixie openjdk-23-jdk-headless',
'apt-get install -y -t trixie openjdk-25-jdk-headless',
'echo "deb http://deb.debian.org/debian trixie main" > /etc/apt/sources.list.d/trixie.list',
'echo "deb https://deb.debian.org/debian trixie main" > /etc/apt/sources.list.d/trixie.list',
'update-alternatives --auto java',
'update-java-alternatives -a',
]
for build in newbuilds:
if "sudo" in build:
if any("openjdk-11" in line for line in build["sudo"]) or any("openjdk-17" in line for line in build["sudo"]):
build["sudo"] = [line for line in build["sudo"] if line not in bookworm_blocklist]
if any("openjdk-11" in line for line in build["sudo"]) or any("openjdk-17" in line for line in build["sudo"]) or any("openjdk-21" in line for line in build["sudo"]):
build["sudo"] = [line for line in build["sudo"] if line not in trixie_blocklist]
if build["sudo"] == ['apt-get update']:
build["sudo"] = ''

View File

@@ -183,7 +183,7 @@ def get_default_cachedir():
removed.
"""
appname = __name__.split('.')[0]
appname = __name__.split('.', maxsplit=1)[0]
try:
import platformdirs
@@ -904,7 +904,7 @@ def parse_human_readable_size(size):
try:
return int(float(size))
except (ValueError, TypeError) as exc:
if type(size) != str:
if type(size) is not str:
raise ValueError(
_('Could not parse size "{size}", wrong type "{type}"').format(
size=size, type=type(size)
@@ -2516,7 +2516,7 @@ def is_strict_application_id(name):
def parse_srclib_spec(spec):
if type(spec) != str:
if type(spec) is not str:
raise MetaDataException(
_("can not parse scrlib spec (not a string): '{}'").format(spec)
)

View File

@@ -998,7 +998,7 @@ def upload_to_github_releases_repo(repo_conf, release_infos, global_gh_token):
)
return
conf_package_names = repo_conf.get("packageNames", [])
if type(conf_package_names) == str:
if type(conf_package_names) is str:
conf_package_names = [conf_package_names]
if not conf_package_names:
logging.warning(

View File

@@ -2360,7 +2360,7 @@ def lint_config(arg):
if type(data[key]) not in (str, list, dict):
passed = False
show_error = True
elif type(data[key]) != t:
elif type(data[key]) is not t:
passed = False
show_error = True
if show_error:

View File

@@ -390,7 +390,7 @@ class FieldValidator:
def check(self, v, appid):
if not v:
return
if type(v) == list:
if type(v) is list:
values = v
else:
values = [v]

View File

@@ -230,9 +230,9 @@ def clone_git_repo(clone_url, git_mirror_path):
'GIT_ASKPASS': '/bin/true',
'SSH_ASKPASS': '/bin/true',
'GIT_USERNAME': 'u',
'GIT_PASSWORD': 'p',
'GIT_PASSWORD': 'p', # nosec B105
'GIT_HTTP_USERNAME': 'u',
'GIT_HTTP_PASSWORD': 'p',
'GIT_HTTP_PASSWORD': 'p', # nosec B105
'GIT_SSH': '/bin/false', # for git < 2.3
'GIT_TERMINAL_PROMPT': '0',
},

View File

@@ -1246,9 +1246,7 @@ def main():
if app.Disabled and not options.force:
logging.info(_("Skipping {appid}: disabled").format(appid=appid))
json_per_appid['disabled'] = MessageStore().infos.append(
'Skipping: disabled'
)
json_per_appid['disabled'] = MessageStore().infos + ['Skipping: disabled']
continue
try:

View File

@@ -973,7 +973,7 @@ def insert_funding_yml_donation_links(apps):
)
)
logging.error(e)
if not data or type(data) != dict:
if not data or type(data) is not dict:
continue
if not app.get('Liberapay') and 'liberapay' in data:
s = sanitize_funding_yml_name(data['liberapay'])
@@ -1420,9 +1420,9 @@ def parse_ios_screenshot_name(path):
s = path.stem.split('@')
if len(s) >= 2:
if "iphone" in s[0].lower():
return ("phoneScreenshots", s[0].strip(), ('@'.join(s[1:])).split('-')[0].strip())
return ("phoneScreenshots", s[0].strip(), ('@'.join(s[1:])).split('-', maxsplit=1)[0].strip())
elif "ipad" in s[0].lower():
return ("tenInchScreenshots", s[0].strip(), ('@'.join(s[1:])).split('-')[0].strip())
return ("tenInchScreenshots", s[0].strip(), ('@'.join(s[1:])).split('-', maxsplit=1)[0].strip())
else:
fragments = path.stem.lower().split("_")
device = "unknown"

View File

@@ -41,18 +41,18 @@ logging.basicConfig(format=logformat, level=loglevel)
tail = None
BASEBOX_DEFAULT = 'debian/bookworm64'
BASEBOX_VERSION_DEFAULT = "12.20250126.1"
BASEBOX_DEFAULT = 'debian/testing64'
BASEBOX_VERSION_DEFAULT = "20250426.1"
BASEBOX_CHECKSUMS = {
"12.20250126.1": {
"20250426.1": {
"libvirt": {
"box.img": "64eb111ab8b0785253c7542caaa7f560d4532b8133266ec94804882d209017d3",
"box.img": "f5b8527139e775083e9d42a590fbdfec180005e25ef95a683353838051907d8c",
"Vagrantfile": "f9c6fcbb47a4d0d33eb066859c8e87efd642287a638bd7da69a9e7a6f25fec47",
"metadata.json": "20dc0268a79410dbf01c7e544ba5138f6f695a298b53c56c87a25f68c5031173",
},
"virtualbox": {
"box.ovf": "d8493bdfc4c42b5f66b815efe2a90d20b639eb2ce12cc8c7c51a3039674d146a",
"box.vmdk": "6927001058f57b325544c399297c41ec9c6fbfc21cb764b58f2ff0495864a4fa",
"box.ovf": "0efe4d92ebe4a9ae3a9f332adfc56dd74318d1bca7ef842d649d8735504ca62b",
"box.vmdk": "d83566ba214a297e53db6750db0789213efcca027e583c0fcbf36bfaa1859487",
"Vagrantfile": "0bbc2ae97668d8da27ab97b766752dcd0bf9e41900e21057de15a58ee7fae47d",
"metadata.json": "ffdaa989f2f6932cd8042e1102371f405cc7ad38e324210a1326192e4689e83a",
}

View File

@@ -99,6 +99,9 @@ confidence = ["HIGH", "INFERENCE"]
disable = [
"broad-exception-caught",
"broad-exception-raised",
"global-statement",
"global-variable-not-assigned",
"global-variable-undefined",
"invalid-name",
"missing-class-docstring",
"missing-function-docstring",
@@ -107,6 +110,8 @@ disable = [
"no-else-raise",
"no-else-return",
"subprocess-run-check",
"too-many-positional-arguments",
"unspecified-encoding",
"use-dict-literal",
]

View File

@@ -103,7 +103,7 @@ setup(
'python-vagrant',
'PyYAML',
'qrcode',
'ruamel.yaml >= 0.15, < 0.17.22',
'ruamel.yaml >= 0.17.22',
'requests >= 2.5.2, != 2.11.0, != 2.12.2, != 2.18.0',
'sdkmanager >= 0.6.4',
'yamllint',

View File

@@ -1079,7 +1079,7 @@ class GitHubReleasesTest(unittest.TestCase):
{
"projectUrl": "https://github.com/custom/app",
"packageNames": ["more.custom.app"],
"token": "custom_token",
"token": "custom_token", # nosec B105
},
]
@@ -1121,7 +1121,7 @@ class GitHubReleasesTest(unittest.TestCase):
{
"projectUrl": "https://github.com/custom/app",
"packageNames": ["more.custom.app"],
"token": "custom_token",
"token": "custom_token", # nosec B105
},
"fri_result",
"fake_global_token",