1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02:00

Merge branch 'fix-ci' into 'master'

fix CI

See merge request fdroid/fdroidserver!1288
This commit is contained in:
Hans-Christoph Steiner 2023-02-02 15:42:41 +00:00
commit 7f1e96fe63
8 changed files with 37 additions and 10 deletions

View File

@ -220,9 +220,10 @@ lint_format_safety_bandit_checks:
black:
image: python:slim
image: debian:bookworm-slim
<<: *apt-template
script:
- pip install black
- apt-get install black
- black --check --diff --color
examples/fdroid_clean_repos.py
examples/fdroid_extract_repo_pubkey.py

7
.safety-policy.yml Normal file
View File

@ -0,0 +1,7 @@
---
security:
ignore-vulnerabilities:
52495:
reason: setuptools comes from Debian
expires: '2025-01-31'

View File

@ -159,7 +159,6 @@ def main():
output = 'git commit ' + subprocess.check_output(['git', 'rev-parse', 'HEAD'],
universal_newlines=True)
elif os.path.exists('setup.py'):
import re
m = re.search(r'''.*[\s,\(]+version\s*=\s*["']([0-9a-z.]+)["'].*''',
open('setup.py').read(), flags=re.MULTILINE)
if m:

View File

@ -430,12 +430,12 @@ def update_servergitmirrors(servergitmirrors, repo_section):
repo.index.commit("fdroidserver git-mirror")
if options.verbose:
bar = progress.Bar()
progressbar = progress.Bar()
class MyProgressPrinter(git.RemoteProgress):
def update(self, op_code, current, maximum=None, message=None):
if isinstance(maximum, float):
bar.show(current, maximum)
progressbar.show(current, maximum)
progress = MyProgressPrinter()
else:
progress = None
@ -497,7 +497,7 @@ def update_servergitmirrors(servergitmirrors, repo_section):
logging.debug(remote.url + ': ' + pushinfo.summary)
if progress:
bar.done()
progressbar.done()
def upload_to_android_observatory(repo_section):

View File

@ -252,7 +252,7 @@ def main():
tmp_importer_dir = None
local_metadata_files = common.get_local_metadata_files()
if local_metadata_files != []:
if local_metadata_files:
raise FDroidException(_("This repo already has local metadata: %s") % local_metadata_files[0])
build = metadata.Build()

View File

@ -323,7 +323,7 @@ class FDroidBuildVm:
boxfile = abspath(boxfile)
if not isfile(boxfile):
raise FDroidBuildVmException(
'supplied boxfile \'%s\' does not exist', boxfile
'supplied boxfile \'%s\' does not exist' % boxfile
)
self.vgrnt.box_add(boxname, abspath(boxfile), force=force)

View File

@ -49,7 +49,27 @@ confidence = ["HIGH", "INFERENCE"]
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable = ["invalid-name", "missing-module-docstring", "missing-class-docstring", "missing-function-docstring", "no-member"]
# TODO many of these could be fixed if someone wants to spend the time
disable = [
"broad-exception-caught",
"broad-exception-raised",
"consider-iterating-dictionary",
"consider-using-sys-exit",
"invalid-name",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-else-break",
"no-else-continue",
"no-else-raise",
"no-else-return",
"no-member",
"pointless-exception-statement",
"subprocess-run-check",
"use-dict-literal",
]
[tool.pylint.miscellaneous]
# List of note tags to take in consideration, separated by a comma.

View File

@ -1358,7 +1358,7 @@ class UpdateTest(unittest.TestCase):
# pylint: disable=protected-access
icons_src = fdroidserver.update._get_apk_icons_src('urzip-release.apk', None)
assert icons_src == {}
assert not icons_src
def test_strip_and_copy_image(self):
tmptestsdir = tempfile.mkdtemp(