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

[jythonscripting] Add a note not to use jython #15623

Merged
merged 4 commits into from
Oct 8, 2023

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Sep 19, 2023

@rkoshak WDYT?

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng requested a review from a team as a code owner September 19, 2023 09:28
@rkoshak
Copy link
Contributor

rkoshak commented Sep 19, 2023

I think it's worth marking it as deprecated somehow. I really worry what a massive mess it's going to make when it eventually breaks on us.

Copy link
Contributor

@rkoshak rkoshak left a comment

Choose a reason for hiding this comment

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

Just a suggestion to maybe not list specific alternatives and instead just link to all the alternatives.

Currently, the development of Jython stopped at version 2.7 with no definite timeline to support Python 3.x.
The 3rd party openHAB helper library for Jython is also no longer maintained.
We would not recommend using Jython scripting at this point in time.
For alternatives, check out [JS Scripting](../jsscripting/) and [JRuby](../jrubyscripting/).
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it makes sense to call out these two or just point them to the Automation Add-ons page. I'm sensitive to privileging any of the add-ons over the others too much. The thing that makes JS Scripting and jRuby really good are their helper libraries. But Groovy and Java Scripting are built around using the native Java APIs and do so much more naturally than even Rules DSL does. So is a lack of a helper library there a disadvantage? I'm not sure.

I also don't want to have to come back here if at some point in the future Common Lisp, Scheme, or even Clojure are added as options. Functional languages are objectively superior after all. 😜

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we mention HabApp here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've been ambivalent on that. Since HABApp is not actually a part of the OH project I'm cautious about including it in the official docs too much. However, it makes a whole lot of sense to mention it here.

I'm thinking yes, we should point the users to HABApp.

Copy link
Contributor

Choose a reason for hiding this comment

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

i think we should just mention the other supported language engines included with openHAB and not link to anything external.

Copy link
Contributor

Choose a reason for hiding this comment

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

The only reason why I think it's worth mentioning is because HABApp is the only viable way to use Python with OH. It feels like it does a disservice to the users who are clearly wanting to use Python because they are on this page in the first place to not mention the only way they can use Python with OH.

Ideally, with all due respect to what HABApp is and what it does, I'd like to see a GraalVM Python add-on created. But after two years there's no sign of anyone wanting to do that.

It feels wrong to essentially say "sorry, you'll have to learn a new programming language" when there is a viable Python option.

Note: I usually fall on the "don't mention HABApp because it's external" side of things, this one case feels different.

@jimtng
Copy link
Contributor Author

jimtng commented Sep 20, 2023

I think it's worth marking it as deprecated somehow. I really worry what a massive mess it's going to make when it eventually breaks on us.

Is there an actual process to do this?

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@rkoshak
Copy link
Contributor

rkoshak commented Sep 20, 2023

It all depends on how you want to maintain it.

I've never seen it done. That doesn't mean we don't need a process. Maybe this can be a first test case?

I was mainly thinking about something like adding "Deprecated" to the add-on name as it appears in MainUI or something like that. I wasn't thinking anything more formal than that.

@jimtng
Copy link
Contributor Author

jimtng commented Sep 21, 2023

The latest push adds (DEPRECATED) to the name.

image

@lsiepel
Copy link
Contributor

lsiepel commented Sep 23, 2023

You might consider to add a deprecated warning in the distro update notices.
Personally i think that is a good place to warn existing users of this binding. While the deprecated addition to the binding name is more for new addon users.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@rkoshak
Copy link
Contributor

rkoshak commented Sep 25, 2023

When/if this PR gets merged it will automatically be added to the release notes for the next version.

@lsiepel
Copy link
Contributor

lsiepel commented Sep 25, 2023

When/if this PR gets merged it will automatically be added to the release notes for the next version.

Documentation changes are usually not listed in the release notes.

If it needs to end up in the release notes, it should have the enhancement label attached. If i look at the distributions/openhab/src/main/resources/bin/update.lst there are more deprecated notices, so i think that is a good place to consider.

@rkoshak
Copy link
Contributor

rkoshak commented Sep 25, 2023

I know that's true for the docs repo. But if we need a tag added to this PR to show up that seems like a reasonable thing to add.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@lolodomo lolodomo merged commit 5a5cfc2 into openhab:main Oct 8, 2023
2 checks passed
@lolodomo lolodomo added this to the 4.1 milestone Oct 8, 2023
@jimtng jimtng deleted the jython-warning branch October 8, 2023 10:59
pat-git023 pushed a commit to pat-git023/openhab-addons that referenced this pull request Oct 13, 2023
* [jythonscripting] Add a note not to use jython
* [jythonscripting] Mark as deprecated

---------

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this pull request Oct 21, 2023
* [jythonscripting] Add a note not to use jython
* [jythonscripting] Mark as deprecated

---------

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this pull request Oct 29, 2023
* [jythonscripting] Add a note not to use jython
* [jythonscripting] Mark as deprecated

---------

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: querdenker2k <querdenker2k@gmx.de>
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
* [jythonscripting] Add a note not to use jython
* [jythonscripting] Mark as deprecated

---------

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants