JuliaPy / pyjuliapkg

Manage your Julia dependencies from Python
MIT License
45 stars 12 forks source link

wrong juliapkg.json path found #17

Open Roger-luo opened 1 year ago

Roger-luo commented 1 year ago

this is just a standard python package setup as following

.
├── README.md
├── juliapkg.json
├── pdm.lock
├── pdm_build.py
├── pyproject.toml
├── src
│   └── bloqade
│       ├── __init__.py
└── tests
    ├── __init__.py
    ├── test_scalar.py
    └── test_shape.py

where in the bloqade module, it calls juliacall, directly running python test_shape.py will not use juliapkg.json but creates an empty new one. This behavior does not look right.

This is causing things like pytest not working

Roger-luo commented 1 year ago

Ok, I realize currently you are doing this by copying juliapkg-dev.json to juliapkg.json in CI...

So it has to live next to the module __init__.py file? Or I'm missing something?

This is really annoying tbh while writing a Python package along with the Julia components because juliapkg-dev.json has to be there, then releasing gets annoying because I will need to run an extra hook to do it.

I don't have a good way of doing this after spending the whole afternoon tweaking pre-build hooks...

cjdoris commented 1 year ago

juliapkg-dev.json is not relevant here - that is simply to force PythonCall and JuliaCall to both be working from the same local version while developing those packages.

However yes you're right that the juliapkg.json file needs to be next to the top __init__.py. This is because files higher up do not necessarily get installed with the package.