Skip to content

Commit

Permalink
Update to Qt6 and adjust entrypoint Python script
Browse files Browse the repository at this point in the history
  • Loading branch information
arnk-basyskom authored and plfiorini committed Jan 24, 2024
1 parent 8bfbc8e commit ae8876a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

FROM alpine:latest

RUN apk add python3 py3-pip qt5-qtdeclarative-dev python3-dev build-base py3-pygithub
RUN apk add python3 py3-pip qt6-qtdeclarative-dev python3-dev build-base py3-pygithub

ADD entrypoint /
ENTRYPOINT ["/entrypoint"]
20 changes: 11 additions & 9 deletions entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ def error(message, **kwargs):


def find_qmllint():
for name in ('qmllint-qt5', 'qmllint'):
exe = shutil.which(name)
if exe is not None:
return exe
exe = shutil.which("/usr/lib/qt6/bin/qmllint")
if exe is not None:
return exe
return None


Expand All @@ -52,12 +51,12 @@ def find_files(directory, pattern):
yield filename


def lint(filename):
qmllint = find_qmllint()
if qmllint is None:
def lint(filename, qmllint_bin):

if qmllint_bin is None:
raise SystemExit('Cannot find qmllint executable')

result = subprocess.run([qmllint, filename], capture_output=True)
result = subprocess.run([qmllint_bin, filename], capture_output=True)
if result.returncode != 0:
errmsg = result.stderr.decode().strip()
match = re.match('.+:(\d+) : (.+)', errmsg)
Expand Down Expand Up @@ -91,9 +90,12 @@ if __name__ == '__main__':
if ci is False:
update_status('pending', 'About to verify QML files')

qmllint_bin = find_qmllint()

for suffix in ('qml', 'js'):
for filename in Path('.').glob('**/*.' + suffix):
if lint(filename) is False:

if lint(filename, qmllint_bin) is False:
failed = True

if failed is True:
Expand Down

0 comments on commit ae8876a

Please sign in to comment.