Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for python 3.13 #992

Closed
almet opened this issue Nov 6, 2024 · 3 comments
Closed

Add support for python 3.13 #992

almet opened this issue Nov 6, 2024 · 3 comments

Comments

@almet
Copy link
Member

almet commented Nov 6, 2024

Python 3.13 is available since Oct. 7, 2024. The reason we don't support it is because PySide6 didn't support it yet. They announced support for Python 3.13 will be added in Pyside6 6.8. .

But... I've been able to run it locally with the latest pyside6==6.8.0.1 release, so I wonder if we could get away with it:

> uv venv .venv -p python3.13
> uv pip install pyside6
Resolved 4 packages in 892ms
Prepared 4 packages in 38.00s
Installed 4 packages in 35ms
 + pyside6==6.8.0.2
 + pyside6-addons==6.8.0.2
 + pyside6-essentials==6.8.0.2
 + shiboken6==6.8.0.2
And then running a small UI from their doc, here if you want:

import sys
import random
from PySide6 import QtCore, QtWidgets, QtGui


class MyWidget(QtWidgets.QWidget):
    def __init__(self):
        super().__init__()

        self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"]

        self.button = QtWidgets.QPushButton("Click me!")
        self.text = QtWidgets.QLabel("Hello World", alignment=QtCore.Qt.AlignCenter)

        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.addWidget(self.text)
        self.layout.addWidget(self.button)

        self.button.clicked.connect(self.magic)

    @QtCore.Slot()
    def magic(self):
        self.text.setText(random.choice(self.hello))


if __name__ == "__main__":
    app = QtWidgets.QApplication([])

    widget = MyWidget()
    widget.resize(800, 600)
    widget.show()

    sys.exit(app.exec())

We currently fallback on Pyside2 in our code, when PySide6 isn't installed, which should be the case on systems where Python is older than Python3.11. We would probably need to trick the debian and fedora package building scripts to replace the python 3.13 dep with something older.

@almet
Copy link
Member Author

almet commented Jan 27, 2025

Our CI tests started failing due to our lack of support of python 3.13, as Debian Trixie switched python3-defaults to python3.13.1-2

At the same time, the Pyside6 version in Trixie is still < 6.8, and doesn't support python 3.13+

So, it seem that we'll need to find a way for our Debian packages to install python3 < 3.13

@apyrgio
Copy link
Contributor

apyrgio commented Jan 27, 2025

Woah, I hadn't realized that Debian has started shipping python3-pyside6. At last, that's amazing! I've captured the latest support matrix here: #211 (comment)

Regarding our issue, I think that the availability of python3-pyside6 does not change anything, because we don't use it, either in our prod or dev environments. We should start doing that though soon.

@apyrgio
Copy link
Contributor

apyrgio commented Jan 27, 2025

About supporting Python 3.13, we should have added a reminder here :-/. Turns out that with the latest PySide6 version in PyPI, it's as simple as bumping our upper bound on the Python version. Check out e388fe6.

Here are also the CI tests that pass with this change: https://github.com/freedomofpress/dangerzone/actions/runs/12988802826

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants