mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
ci: Bump PySide6 version in Fedora end-user envs
Our end-user Fedora environments, that we create for testing how Dangerzone would operate on a clean Fedora system, require PySide6 to be installed. This package is not available from the official Fedora repos yet. We have a way instead to check the poetry.lock file, grab the latest PySide6 version from there, and install it from a URL. This is no longer necessary, now that PySide6 6.7.0 will soon be available in all stable Fedora releases. Since the last release maintained by FPF will be 6.6.3.1, we should pin this version in our env.py script. This way, we can bump poetry.lock independently, and let Windows/macOS users get different versions. Refs freedomofpress/maint-dangerzone-pyside6#5
This commit is contained in:
parent
7c4e62954f
commit
7cd73cab0e
1 changed files with 5 additions and 17 deletions
|
@ -17,6 +17,7 @@ DEFAULT_DEV = False
|
||||||
DEFAULT_SHOW_DOCKERFILE = False
|
DEFAULT_SHOW_DOCKERFILE = False
|
||||||
DEFAULT_DOWNLOAD_PYSIDE6 = False
|
DEFAULT_DOWNLOAD_PYSIDE6 = False
|
||||||
|
|
||||||
|
PYSIDE6_VERSION = "6.6.3.1"
|
||||||
PYSIDE6_RPM = "python3-pyside6-{pyside6_version}-1.fc{fedora_version}.x86_64.rpm"
|
PYSIDE6_RPM = "python3-pyside6-{pyside6_version}-1.fc{fedora_version}.x86_64.rpm"
|
||||||
PYSIDE6_URL = (
|
PYSIDE6_URL = (
|
||||||
"https://packages.freedom.press/yum-tools-prod/dangerzone/f{fedora_version}/%s"
|
"https://packages.freedom.press/yum-tools-prod/dangerzone/f{fedora_version}/%s"
|
||||||
|
@ -309,8 +310,8 @@ class PySide6Manager:
|
||||||
"""Provision PySide6 RPMs in our Dangerzone environments.
|
"""Provision PySide6 RPMs in our Dangerzone environments.
|
||||||
|
|
||||||
This class holds all the logic around checking and downloading PySide RPMs. It can
|
This class holds all the logic around checking and downloading PySide RPMs. It can
|
||||||
detect the PySide6 version that the project requires, check if an RPM is present
|
check if the required RPM version is present under "/dist", and optionally download
|
||||||
under "/dist", and download it.
|
it.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, distro_name, distro_version):
|
def __init__(self, distro_name, distro_version):
|
||||||
|
@ -320,22 +321,9 @@ class PySide6Manager:
|
||||||
self.distro_version = distro_version
|
self.distro_version = distro_version
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@functools.lru_cache
|
|
||||||
def version(self):
|
def version(self):
|
||||||
"""Retrieve the PySide6 version from poetry.lock.
|
"""The version of the PySide6 RPM."""
|
||||||
|
return PYSIDE6_VERSION
|
||||||
Read the poetry.lock file, and grep the version of the PySide6 library. The
|
|
||||||
results of this method call are cached, so we can call it repeatedly without any
|
|
||||||
performance cost.
|
|
||||||
"""
|
|
||||||
# FIXME: I don't like regexes, but problem is that `tomllib` is not present in
|
|
||||||
# Python < 3.11. So, since we don't want to rely on an external library yet, we
|
|
||||||
# have to resort to regexes. Note that the regex we choose uses Shiboken6,
|
|
||||||
# mainly because the PySide6 package and its version are in different lines.
|
|
||||||
with open(git_root() / "poetry.lock") as f:
|
|
||||||
toml = f.read()
|
|
||||||
match = re.search(r'^shiboken6 = "([\d.]+)"$', toml, re.MULTILINE)
|
|
||||||
return match.groups()[0]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rpm_name(self):
|
def rpm_name(self):
|
||||||
|
|
Loading…
Reference in a new issue