Skip to content

Move Julia wrapper Python code into juliacall._jlwrap modules - #846

Merged
cjdoris merged 1 commit into
mainfrom
refactor/jlwrap-python-modules
Oct 24, 2026
Merged

cjdoris merged 1 commit into
mainfrom
refactor/jlwrap-python-modules

Conversation

@cjdoris

@cjdoris cjdoris commented Oct 24, 2026

Copy link
Copy Markdown
Member

Move the Python wrapper implementations embedded in src/JlWrap into matching files under pysrc/juliacall/_jlwrap. Each module uses a method-name dictionary populated by the corresponding Julia initializer, removing the need to interpolate method numbers into Python source.

_jlwrap exports all wrapper types, and juliacall imports them once the native ValueBase type is available. Preserve the public juliacall.*Value identities and read the array buffer method number from its module dictionary. Also move the callback wrapper lambda into Python.

Validation:

  • Julia suite: 3,517 passed, 2 broken/skipped.
  • Python suite, including notebooks: 21 passed.
  • Restored the original juliapkg.json after Python tests.
  • git diff --check passed.

@cjdoris

cjdoris commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@oxinabox I think this will fix the issue in #808 - could you try it please? AFAIU the issue is that pythoncall evals some python code with a filename that pytest doesn't class as being user code (because it's in a julia file in some non-python location). This change moves all that python code into the actual juliacall source, so pytest will now classify it correctly.

@cjdoris
cjdoris merged commit f661843 into main Oct 24, 2026
18 checks passed
@cjdoris
cjdoris deleted the refactor/jlwrap-python-modules branch October 24, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant