Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfiles should use pyproject.toml to install optional dependencies #3135

Open
jhale opened this issue Apr 16, 2024 · 4 comments
Open

Dockerfiles should use pyproject.toml to install optional dependencies #3135

jhale opened this issue Apr 16, 2024 · 4 comments
Labels
ci Continuous Integration docker task A task to perform
Milestone

Comments

@jhale
Copy link
Member

jhale commented Apr 16, 2024

Describe new/missing feature

We currently attempt to include optional dependencies in our pyproject.toml file

https://github.com/FEniCS/dolfinx/blob/main/python/pyproject.toml

But this remains untested as the CI image builds manually type optional dependencies

https://github.com/FEniCS/dolfinx/blob/main/docker/Dockerfile.test-env#L156

There is some discussion of this issue here with respect to adding e.g. --only-deps option to pip install: pypa/pip#11440

Suggested user interface

Not applicable.

@jhale jhale added enhancement New feature or request docker ci Continuous Integration labels Apr 16, 2024
@jhale
Copy link
Member Author

jhale commented Apr 16, 2024

pip-tools seems to have support for creating requirements.txt files that can then be fed into pip.

https://github.com/jazzband/pip-tools

@garth-wells
Copy link
Member

How about we slim down the images and let the CI runner install Python optional dependencies, documentation dependencies, etc. This makes testing, pinning and un-pinning versions much easier

@francesco-ballarin
Copy link
Member

How about we slim down the images and let the CI runner install Python optional dependencies, documentation dependencies, etc. This makes testing, pinning and un-pinning versions much easier

👍👍👍

The only possible downside I see is that, if pinning was required, one would have to do that several times, for instance:

  • in the CI runner of dolfinx,
  • (in the CI runner of e.g. basix or ffcx, if the same pin were needed for them too)
  • in the end user dockerfile

@jhale
Copy link
Member Author

jhale commented Apr 19, 2024

@francesco-ballarin The pyproject.toml would be the single source for specifying light Python optional requirements. We're already doing this in e.g. Basix and it works well see e.g. https://github.com/FEniCS/basix/blob/main/.github/workflows/pythonapp.yml#L42
https://github.com/FEniCS/basix/blob/main/pyproject.toml#L28

petsc4py, mpi4py and numpy and the other heavy packages will be built inside the Dockerfile as they are now.

@garth-wells garth-wells added this to the 0.9.0 milestone Apr 25, 2024
@garth-wells garth-wells added task A task to perform and removed enhancement New feature or request labels Jun 8, 2024
@mscroggs mscroggs modified the milestones: 0.9.0, 0.10.0 Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration docker task A task to perform
Projects
None yet
Development

No branches or pull requests

4 participants