-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[pythonscripting] current marketplace version of pythonscripting next #19190
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
Conversation
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/python3-binding-discussion/161914/164 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert changes to this file. The translations are managed by crowdin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i18n default translations are regenerated and committed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not delete the file, revert changes to it, so it is left untouched in the PR.
If needed, you can download a fresh copy from the github repo and overwrite the file so it is in the same state as before this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but no.
You reverted changes to pythonscripting.properties while it should have been pythonscripting_de.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, I was not aware of this file. It never exists in my branch. I reverted now both to match the version from main branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These "rules" might be a bit hard to understand if you're not aware of how the Crowdin integration works, but English is the "source language". It is what is found in pythonscripting.properties
. If you want to change any of the texts, you should make changes in this file.
This file is then automatically uploaded to Crowdin, so that the "source strings" there are updated and translators are notified that there is something new that needs to be translated. After a while (when the translators have had time to make the translations), all the "translation files" (pythonscripting_xx.properties
) are generated from the translations made at Crowdin, and these files are merged.
So, you should change pythonscripting.properties
and you should not change pythonscripting_xx.properties
.
...openhab.automation.pythonscripting/src/main/resources/OH-INF/i18n/pythonscripting.properties
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR, I will split the review.
Review of the README:
return "String has " + str(len(input)) + " characters" | ||
calc(input) | ||
``` | ||
[>> openHAB Python Scripting <<](https://github.com/openhab/openhab-python/blob/main/README.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to integrate this into the openHAB website where the other docs reside. We can take care of that later though, please remind me though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to split the binding documentation from the helper lib documentation.
Both documentations together was getting longer and longer. I still gave some scripting examples in the binding documentation itself, to get an impression how it works. But the whole helper lib documentation should resist in the same repo as the helper lib itself. Before, I was always synchronizing the README's after each tiny change in the helper libs, which affects the README. Sometimes, I forgot to synchronize.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For next.openhab.org, all external documentation is synced every night, and for www.openhab.org we can also get something like this up and running.
Please also fix the conflicts |
maybe I should recreate the pull request. Solving the merge conflict inside the pom is not a problem. But solving the GraalPythonScriptEngineFactory conflict is not possible, The file is renamed and completely refactored. The change in the current main branch does not make sense anymore. I would recommend to finish the review first and then recreate the "next" branch on latest master branch and apply my changes on top of it. At the end, it completely replaces the current pythonscripting folder from main branch. |
There is no reason to create a new PR. You can force push anything to this one. The local and remote branches don't even need to have the same name, so you could create a completely new branch locally, and still push that to What I would probably do is create a new branch locally when checked out on this branch, so that you have a copy - and then, after making the copy, reset |
I will wait until the review is done and then, maybe someone with deeper knowledge about git can help me solving this. As I'm not a git expert... every time I tried something like this, I completely "messed up" the pull request. That's why I'm a bit more cautious about things like that :-) |
<pmdFilter>${project.basedir}/suppressions.properties</pmdFilter> | ||
</configuration> | ||
</plugin> | ||
<!-- workaround for failing clean of checked out git repo breaking the Windows build, #19250 --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks if this works, this has been quite annoying, since I've had to manually delete the target folder every time.
I tried it right now with the result I feared. First, I added upstream repo to my git config This is my config now.
After, I called Thats the result he showed me.
Then I resolved the conflicts (they are as simple as I expected). But I got hundred of modified files like below.
Whats should I do. I just want to solve the merge conflicts of the last 2 files. |
I thought that I never (almost - the exception is rarely with the So, my question is what you wanted to do. To get out of the current situation, you can probably do a If you want to rebase on latest git fetch upstream
git rebase upstream/main ...then resolve any potential conflicts, after which I'd run: git rebase --continue ...as many times as needed until all conflicts had been worked out. As for the conflict resolution itself, I still think a proper GUI tool is needed, I know that there are people that does this in command line editors, but I just don't understand how they manage to. The conflict doesn't have to be very complicated for me to lose track of dealing with that using only the cryptic conflict information Git creates.
How did you resolve the conflicts? Did you run some script or something, since you got all the modified files? I never do that, I manually resolve each conflict... because I don't think getting everything "tainted" by some script is that much fun to clean up later. |
the conflicts are not the problem. They affect only
and they are easy to solve. So no need for a GUI. the hundred of changed files are the result the merge. I never touched them. They are marked as changes after the merge. now I tried your recommendation regarding a rebase.
rebase was done. If I try to run
As recommended, I run I got conflicts with files outside of my pythonscripting changes
The result I want is very simple. I just want to ignore the conflicts and overwrite them with my version. Thats all. |
All was fine until here.... as I said, you almost never want to do The reason you can't push is that you have rebased the existing commits so that they no longer "match" those already existing in the But, after rebasing, we must overwrite what's there, that's what we called a "forced push". To do that, simply run: git push --force-with-lease This will "force push" as long as the state of the remote still is as your local Git expects (that is, nobody else has pushed since you fetched). If you use just If you do a |
Hey, Thanks a lot! |
Please also adjust the signoff. Instructions are here: |
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
thanks for the hint. Is changed now. |
I hope @wborn is able to look at this as my knowledge about both python and the scripting part of addons is limited to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks really good to me, I don't have much to comment.
I have reviewed everything except for all the console command stuff, I don't think this does much related to script engine and Graal stuff and is more "standard" Java code, hence I will leave the review to the add-on maintainers.
|
||
@Override | ||
public Object invokeFunction(String name, Object... objects) throws ScriptException, NoSuchMethodException { | ||
if ("scriptUnloaded".equals(name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to to the same for JS? Very likely yes?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it can happen that the engine is closed, before this is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me guess, you experienced this issue when using SCRIPT transformation?
In case your answer is yes, the following PR should fix the cause: openhab/openhab-core#5063.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this was the scenario, I will change my code, when your fix is merged!
...in/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngineConfiguration.java
Show resolved
Hide resolved
...in/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngineConfiguration.java
Show resolved
Hide resolved
...src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngineFactory.java
Show resolved
Hide resolved
...src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngineFactory.java
Outdated
Show resolved
Hide resolved
...tomation/pythonscripting/internal/scriptengine/InvocationInterceptingPythonScriptEngine.java
Show resolved
Hide resolved
.../org/openhab/automation/pythonscripting/internal/scriptengine/graal/GraalPythonBindings.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.automation.pythonscripting/src/main/resources/OH-INF/config/config.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.automation.pythonscripting/src/main/resources/OH-INF/config/config.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.automation.pythonscripting/src/main/resources/OH-INF/config/config.xml
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngineFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Holger Hees <holger.hees@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, thanks!
Again: I haven't reviewed the console command code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 31 out of 41 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (1)
bundles/org.openhab.automation.pythonscripting/src/main/resources/OH-INF/config/config.xml:1
- Corrected capitalization of 'python' to 'Python' for consistency in UI text.
<?xml version="1.0" encoding="UTF-8"?>
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.../openhab/automation/pythonscripting/internal/scriptengine/graal/GraalPythonScriptEngine.java
Outdated
Show resolved
Hide resolved
.../openhab/automation/pythonscripting/internal/scriptengine/graal/GraalPythonScriptEngine.java
Outdated
Show resolved
Hide resolved
...ipting/src/main/java/org/openhab/automation/pythonscripting/internal/PythonScriptEngine.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Holger Hees <holger.hees@gmail.com>
Signed-off-by: Holger Hees <holger.hees@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
Could you add an upgrade notice to the distro repo for the user facing breaking changes?
@lsiepel just to let you know... Will add breaking changes soon. Currently I'm sick... |
Hello @florian-h05, @ccutrer, @wborn
Because you helped me so much last time, I'm asking you for another review :-) and in advance, sorry for the size of these pull request!
This pull request is trying to merge the current marketplace version of pythonscripting next.