-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
4.1.0: Test failures with Python 3.8 #498
Comments
We're targetting CPython 3.5.2 right now. I wouldn't expect minor versions of Python to break backwards compatibility. They're usually pretty good on this part. Maybe it's because they are still in beta. In any case, we don't intend to support all versions of all our dependencies. That's why we package CPython with our releases. In the future we're probably going to upgrade to newer versions of Python, if we need a newer version for some new feature (I love the formatted strings for instance). We'll look to support those new versions then. |
As a Fedora packager of Cura, I unfortunately cannot package CPython 3.5.2 with Cura (note that you should probably look at least at Python 3.5.6). So far CPython 3.7 worked pretty good, but 3.8 fails. If it's because it is beta, than maybe it's a bug in CPython itself that needs to be fixed. Or maybe it is not because it is beta. Would you at least accept a fix if I figure this out? |
This breakage probably caused by this change in Python: I have a fix ready, would you accept it, or should I carry it downstream forever? diff --git a/UM/Settings/SettingFunction.py b/UM/Settings/SettingFunction.py
index 9ca0d30..28739c7 100644
--- a/UM/Settings/SettingFunction.py
+++ b/UM/Settings/SettingFunction.py
@@ -177,10 +177,16 @@ class _SettingExpressionVisitor(ast.NodeVisitor):
self.values.add(node.id)
self.keys.add(node.id)
+ # This one is used before Python 3.8
def visit_Str(self, node: ast.AST) -> None:
if node.s not in self._knownNames and node.s not in dir(builtins): # type: ignore #AST uses getattr stuff, so ignore type of node.s.
self.keys.add(node.s) # type: ignore
+ # This one is used on Python 3.8+
+ def visit_Constant(self, node: ast.AST) -> None:
+ if isinstance(node.value, str) and node.value not in self._knownNames and node.value not in dir(builtins): # type: ignore #AST uses getattr stuff, so ignore type of node.value.
+ self.keys.add(node.value) # type: ignore
+
_knownNames = {
"math",
"max",
|
Sure, we'll accept that bugfix. |
The Cura builds target CPython 3.5.2 now so it's not a problem for that, but if we upgrade to CPython 3.8 or higher in the future, or right now for the package managers in Linux, this fixes some function evaluations. Fixes #498.
See commit here: d7ed5eb |
Thanks. |
I see those build failures on Python 3.8.0b2 and Uranium 4.1.0:
The failures were also present in 4.0.0 with older Python 3.8.0 releases.
The text was updated successfully, but these errors were encountered: