Skip to content

Comments

[homeassistant] Upgrade to Graal 25#19518

Merged
lsiepel merged 3 commits intoopenhab:mainfrom
ccutrer:homeassistant-graal-25
Oct 29, 2025
Merged

[homeassistant] Upgrade to Graal 25#19518
lsiepel merged 3 commits intoopenhab:mainfrom
ccutrer:homeassistant-graal-25

Conversation

@ccutrer
Copy link
Member

@ccutrer ccutrer commented Oct 21, 2025

Unfortunately, due to oracle/graalpython#559, I had to import Voluptuous completely, and modify it slightly to work around that bug. Other than that, all tests passed.

@ccutrer
Copy link
Member Author

ccutrer commented Oct 21, 2025

@HolgerHees @florian-h05: we should probably prepare all three add-ons to work with Graal 25, and submit the PRs together. I just don't know how well things will interact with having multiple versions of Graal in the OSGi process with how we've had to wrap the service lookups. Also, FYI openhab/openhab-osgiify#79 should be available soon (it's failing the build because the release just happened, and it looks like all artifacts aren't available yet).

@HolgerHees
Copy link
Contributor

I fully agree. Starting this weekend, I will spend time into it.


<properties>
<graalpy.version>25.0.0</graalpy.version>
<graalpy.version>25.0.1</graalpy.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use "${graalpy.version}" here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. this sets the value of that variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, sorry my mistake, I want to say, that you must not define it here. There is already an approach of having a more global variable

<graalpy.version>24.2.1</graalpy.version>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest renaming the global variable to graal.version, so I can use it for JS Scripting as well 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is changed as part of my current pull request

f799ff5

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adapt to ${graalvm.version}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased on top of #19568, and then switched to graalvm.version. Once that PR merges, I'll rebase again to resolve merge "conflicts" from that PR getting squashed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@HolgerHees
Copy link
Contributor

HolgerHees commented Oct 26, 2025

@ccutrer @florian-h05 just a first impression from pythonscripting upgrade to graalvm 25. No noticeable impact.

but I will test next days a bit more.

@florian-h05
Copy link
Contributor

GraalJS changelog is fairly short, everything looks good.
I have done some very basic testing, we should be fine with further testing in the snapshots.

@florian-h05
Copy link
Contributor

JS Scripting PR is open: #19567

@HolgerHees
Copy link
Contributor

Python Scripting PR is open: #19568

@HolgerHees
Copy link
Contributor

@ccutrer as requested by @florian-h05 , I renamed the global "graalpy.version" property to "graalvm.version" I had also to fix the usage in itests of mqtt.homeassistant.tests. I hope it is ok.

740b28c

otherwise the build would fail.

@HolgerHees
Copy link
Contributor

@ccutrer, @florian-h05 as milstone2 is out. Lets merge :-)

@lsiepel lsiepel requested a review from Copilot October 28, 2025 21:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades GraalVM Python dependencies from version 24.2.1 to 25.0.1 and replaces the external voluptuous Python package (previously installed via pip) with an embedded fork of the library included directly in the source tree.

Key changes:

  • GraalVM Python version upgraded from 24.2.1 to 25.0.1 across all configuration files
  • Voluptuous library (version 0.15.2) source code added to src/main/python/voluptuous/ directory
  • Voluptuous removed from pip package dependencies in pom.xml

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
itests/.../itest.bndrun Updated GraalVM dependency version ranges from 24.2.1 to 25.0.1
features/.../footer.xml Updated GraalVM Maven bundle versions from 24.2.1 to 25.0.1
bundles/.../feature.xml Updated GraalVM Maven bundle versions from 24.2.1 to 25.0.1
bundles/.../pom.xml Updated graalpy.version property to 25.0.1 and removed voluptuous from pip packages
bundles/.../NOTICE Added attribution for forked voluptuous library
bundles/.../python/voluptuous/*.py Added complete voluptuous library source code (5 modules)
Comments suppressed due to low confidence (4)

bundles/org.openhab.binding.mqtt.homeassistant/src/main/python/voluptuous/schema_builder.py:1

  • The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Union[SupportsAllComparisons, None] or typing.Optional[SupportsAllComparisons] instead.
# fmt: off

bundles/org.openhab.binding.mqtt.homeassistant/src/main/python/voluptuous/schema_builder.py:1

  • The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Union[SupportsAllComparisons, None] or typing.Optional[SupportsAllComparisons] instead.
# fmt: off

bundles/org.openhab.binding.mqtt.homeassistant/src/main/python/voluptuous/schema_builder.py:1

  • The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Union[SupportsAllComparisons, None] or typing.Optional[SupportsAllComparisons] instead.
# fmt: off

bundles/org.openhab.binding.mqtt.homeassistant/src/main/python/voluptuous/schema_builder.py:1

  • The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Union[typing.Container, typing.Iterable] instead.
# fmt: off

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

self,
schema_: Schemable,
msg: typing.Optional[str] = None,
description: typing.Any | None = None,
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Optional[typing.Any] instead.

Suggested change
description: typing.Any | None = None,
description: typing.Optional[typing.Any] = None,

Copilot uses AI. Check for mistakes.
schema: Schemable,
msg: typing.Optional[str] = None,
default: typing.Any = UNDEFINED,
description: typing.Any | None = None,
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Optional[typing.Any] instead.

Copilot uses AI. Check for mistakes.
schema: Schemable,
group_of_exclusion: str,
msg: typing.Optional[str] = None,
description: typing.Any | None = None,
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Optional[typing.Any] instead.

Suggested change
description: typing.Any | None = None,
description: typing.Optional[typing.Any] = None,

Copilot uses AI. Check for mistakes.
schema: Schemable,
group_of_inclusion: str,
msg: typing.Optional[str] = None,
description: typing.Any | None = None,
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Optional[typing.Any] instead.

Suggested change
description: typing.Any | None = None,
description: typing.Optional[typing.Any] = None,

Copilot uses AI. Check for mistakes.
schema: Schemable,
msg: typing.Optional[str] = None,
default: typing.Any = UNDEFINED,
description: typing.Any | None = None,
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The union type syntax using | requires Python 3.10+. For better compatibility with older Python versions, use typing.Optional[typing.Any] instead.

Copilot uses AI. Check for mistakes.
self.default = default_factory(default)


class Remove(Marker):
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class 'Remove' does not override 'eq', but adds the new attribute hash.

Copilot uses AI. Check for mistakes.
return self.__str__()


class Marker(object):
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class implements lt, but does not implement le or ge.

Copilot uses AI. Check for mistakes.
try:
validate(path, value)
break
except er.Invalid:
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except er.Invalid:
except er.Invalid:
# Ignore and try the next validator; only error if all validators fail.

Copilot uses AI. Check for mistakes.

def _exec(self, funcs, v, path=None):
error = None
for func in funcs:
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 'for' statement has a redundant 'else' as no 'break' is present in the body.

Copilot uses AI. Check for mistakes.

def _exec(self, funcs, v, path=None):
error = None
for func in funcs:
Copy link

Copilot AI Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This 'for' statement has a redundant 'else' as no 'break' is present in the body.

Copilot uses AI. Check for mistakes.
@ccutrer ccutrer force-pushed the homeassistant-graal-25 branch from 66b238b to 57bb2c5 Compare October 28, 2025 21:48
@ccutrer ccutrer marked this pull request as ready for review October 28, 2025 21:49
@ccutrer ccutrer requested review from a team and antroids as code owners October 28, 2025 21:49
@lsiepel
Copy link
Contributor

lsiepel commented Oct 29, 2025

when rebasing, could you also lookinto the co-pilot review?

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer force-pushed the homeassistant-graal-25 branch from 57bb2c5 to b6fd604 Compare October 29, 2025 13:24
@ccutrer
Copy link
Member Author

ccutrer commented Oct 29, 2025

Rebased. The copilot comments are all in the imported voluptuous code, so I don't intend to address them. The upstream bug in Graal has been fixed, so on the next Graal update the voluptuous code will be removed and we'll go back to using the packaged version of it.

@ccutrer ccutrer added the enhancement An enhancement or new feature for an existing add-on label Oct 29, 2025
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@lsiepel lsiepel merged commit af8a01c into openhab:main Oct 29, 2025
3 of 4 checks passed
@lsiepel lsiepel added this to the 5.1 milestone Oct 29, 2025
@ccutrer ccutrer deleted the homeassistant-graal-25 branch October 29, 2025 17:31
ErikDB87 pushed a commit to ErikDB87/openhab-addons that referenced this pull request Oct 31, 2025
* [homeassistant] Upgrade to Graal 25.01

Signed-off-by: Cody Cutrer <cody@cutrer.us>
Signed-off-by: Erik De Boeck <deboeck.erik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants