Skip to content

Comments

Improvements to the pyinterfacegen tool#50

Merged
steve-s merged 14 commits intooracle:mainfrom
mikehearn:j2pyi
Feb 23, 2026
Merged

Improvements to the pyinterfacegen tool#50
steve-s merged 14 commits intooracle:mainfrom
mikehearn:j2pyi

Conversation

@mikehearn
Copy link
Contributor

Misc improvements including:

  • POM metadata is now derived from the root pom.xml
  • .pyi generation accuracy is much improved with many bug fixes, especially in the area of generics and overloads.
  • The j2pyi Gradle plugin now supports running mypy over it, which can detect internal inconsistencies and mistypings.
  • Some package namespaces have been fixed.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 28, 2026
@mikehearn
Copy link
Contributor Author

@steve-s The deploy-local-repo script has been tested but I don't know how best to simulate a full release. That might be the best I can do - if there are bugs the release team may need to study the issue further.

How does it look?

@steve-s
Copy link
Member

steve-s commented Feb 9, 2026

I can confirm that the deployment script also works for me locally without any issues. I skimmed over the artifacts and I think there are some missing bits:

  • j2pyi-doclet is missing <name> and <description> in the pom file
  • the gradle plugin artifacts are missing <license>, <developers>, and <scm> in their pom files
  • the javadoc and sources jars are missing (it's silly, but even if you don't have JavaDoc, AFAIK the jar must be there)

(note: signing is the only bit that we don't do ourselves and the release team takes care of that)

@steve-s
Copy link
Member

steve-s commented Feb 9, 2026

Also the artifacts are deployed in a new groupId - is that intentional? Can we make them all be in org.graalvm.python like the rest of the artifacts in this repo?

@mikehearn
Copy link
Contributor Author

@steve-s How does it look now?

@steve-s
Copy link
Member

steve-s commented Feb 18, 2026

Now the j2pyi-gradle-plugin seems to be missing name and description. Idk if that changed or I missed that when I checked the artifacts last time. Otherwise looks good.

@mikehearn
Copy link
Contributor Author

Oops, sorry about that. I'm not sure either but I think it didn't have those originally either, good catch.

@steve-s
Copy link
Member

steve-s commented Feb 23, 2026

Thanks @mikehearn, LGTM. Do you want to rebase before merge?

…e stubs.

This is useful to sanity check the resulting files.
- Use single quoting for docstrings unless necessary to switch.
- Avoid emitting Python reserved words as parameter names.
- Switch to the older PEP 484 generics for more compatibility.
- Stop emitting references to JDK types as we don't have .pyi stubs for those.
- Collapse overloads as mypy has issues with Java style overloads.
- Fix enum syntax.
- Track co/contravariance properly for generic type vars.
- Move to correct namespace packages.
- Generalize the JDK package -> object mapping so other packages can be excluded, and add a few more.
- Handle broken Java where a type exposes a private inner type.
- Improve the generics variance inference.
- Improve the handling of varargs methods when computing overload dominance.
- Delete some dead code.
Prefer for loops to top level .forEach calls; they are the same but the former is clearer to my eye.
…ween top level and gradle-plugin subprojects.
@steve-s steve-s merged commit 5c5b93d into oracle:main Feb 23, 2026
28 checks passed
@mikehearn mikehearn deleted the j2pyi branch February 25, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants