Having a julia package inside a monorepo called from python

so I have a largish python code base in a nice mono-repo.
(Its also got some typescript in there).

I want to move some of our core logic to julia for performanced.

So I thought I would make a (local, unregistered) julia package inside the mono repo.
and then uses JuliaCall (PythonCall) to call it from python.
And it in turn would load whatever packages it needs.

However, I seem to be running in to no end of trouble with getting things to instantiate etc.

It seems like the more well trodden path is to use some registered 3rd party julia package from python.
But i do not want that, I want to write and develop the julia code along side the python code.

is my workflow sillly?
Does anyone have a working setup for this?

I think it is this:

Create your local package at Monorepo/foo/Bar.
With it’s Project.toml at Monorepo/foo/Bar/Project.toml
which must contain a name Bar and a UUID like dea5d25c-9d64-4551-98ce-2df8e018f89c
and it’s Manifest.toml at Monorepo/foo/Bar/Manifest.toml
and it’s source code at Monorepo/foo/Bar/src/Bar.jl

then:

import juliapkg
juliapkg.add(
    "Bar",
    "dea5d25c-9d64-4551-98ce-2df8e018f89c",
     path="Monorepo/foo/Bar"),
    dev=True
)
juliapkg.resolve()

and do not touch JULIA_LOAD_PATH.
and do not set PYTHON_JULIAPKG_PROJECT or PYTHON_JULIACALL_PROJECT to Monorepo/foo/Bar
(but potentiallly do set it to Monorepo/julia_env)

Then Bar is a normal julia package that you have locally.
And you have installed it (dev’d it) into the enviroment for the python project

1 Like