ComPWA / report

Technical Reports for the ComPWA Organization
https://compwa.github.io/report
Apache License 2.0
1 stars 1 forks source link

Pin all dependencies in the technical reports #13

Open redeboer opened 5 months ago

redeboer commented 5 months ago

Currently, TRs have a pip install statement where the packages that are required for the notebook itself. The packages are pinned to a specific version in an attempt to make the notebook reproducible, but indirect dependencies are not pinned. This results in bugs like ComPWA/compwa.github.io#272.

Unfortunately, Jupyter notebooks do not support launching sub-kernels. That would be the ideal solution: you have a main developer environment for the repository that you can for instance use to start Jupyter Lab, and then each notebook launches a subkernel with it's own specific set of dependencies.

The closest we can get to an isolated kernel is by doing a pip install with --prefix and then using sys.path.insert to import from that directory. You can create a constraint file for all indirect dependencies with pip compile (or faster: uv pip compile). Providing a constraint file for each notebook then makes each technical report reproducible.

Disadvantages:

redeboer commented 1 day ago

See also https://github.com/astral-sh/uv/issues/6969