-
Notifications
You must be signed in to change notification settings - Fork 641
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
Port Packed Producing Python Programs, #1008 #1067
Conversation
This diff is larger than I'd like it to be, so I'm going to update the scripts to deviate from Lucene's whitespace style to make the diff smaller and easier to review. (edit: this is 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.
That looks pretty good.
I have a couple of minor nit-picky things, but I will leave it up to you whether we should actually change them.
- The name of the workflow
Lucene-Net-Packed-Python-Scripts.yml
doesn't reflect the namespace where packed is (Util
). - In the IDE, it is more obvious that a file is generated by giving it a special name than having to rely on scrolling to the top of the file to see a warning that it is generated. In ICU4N, we are using the convention
.generated.cs
as a suffix for generated code. The tradeoff here is that we are also using a convention of keeping the file names 1-to-1 with the Java file names so it is easy to compare them lexographicallly in File Explorer so we can quickly tell when we have differences. Using the former approach may affect the latter to some extent, but I think it is something we can deal with (especially being that they are generated).
I'm renaming the GitHub workflow file. I think we should keep the current names because it more closely matches the Java file names. This can always be revisited later in a separate PR if desired. |
Ports the Python scripts for generating the various Lucene.Net.Util.Packed files.
Fixes #1008
Description
This ports the four Python scripts in the Packed package/namespace that generate the various files there, and updates them to produce C# code instead, as well as updates them to be compatible with Python 3 (as Python 2, which was used at the time, is now very out of support). This results in some minor syntax differences in the generated code. The README.md file in this folder explains how to run the scripts (which is simply to run them with Python 3, no virtual environment or dependencies needed).
Having these scripts ported will help us ensure that the code is being generated the same way as in Java, as well as to assist any necessary future changes to how the files are generated. It also just helps complete our 1:1 port of the Lucene code, be it Java or Python.
This also corrects an out-of-date type name in the package.md documentation for this namespace.