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

Add optional dependencies to pip package #208

Open
damskii9992 opened this issue Dec 3, 2024 · 1 comment
Open

Add optional dependencies to pip package #208

damskii9992 opened this issue Dec 3, 2024 · 1 comment
Labels
dependencies Pull requests that update a dependency file deployment enhancement python

Comments

@damskii9992
Copy link

Installing Ncrystal using pip does not install all of the dependencies necessary to run all the commands of Ncrystal.
Users have to try and run the commands to get the errors telling them which packages they need to install in addition to Ncrystal.
When users then install these packages they automatically get the newest version which might be broken in Ncrystal.
In other words, users have to start debugging Ncrystal to use certain functionalities of Ncrystal.

This problem can be circumvented by having sets of optional pip dependencies with possibly pinned version numbers depending on the functionality in question. Possible suggestions for optional sets are: plotting (matplotlib), composer (spglib), cif and so on. Possibly with an all or dev set containing all the optional dependencies.

An alternative is to simply default to include all dependencies, but that might lead to bloated installations and possible dependency conflicts breaking all of Ncrystal.

@tkittel
Copy link
Member

tkittel commented Dec 3, 2024

Thanks for the issue and discussion today @damskii9992 ! Indeed, this sounds like a good idea - at least for the PyPI packages.

For my own reference, here are some quick for categories and what they would imply today (in addition to numpy which is always there for convenience, since it is so ubiquitous):

  • plot: matplotlib
  • composer: spglib
  • cif: spglib, gemmi, ase
  • endf: endfparserpy, PyNE (the latter is probably too problematic).
  • everything: all of the above (mostly for power users, CI scripts, etc.)
  • dev: everything + what is needed for CI and commit hooks etc (tomli, ruff, ...).

@tkittel tkittel added python deployment dependencies Pull requests that update a dependency file labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file deployment enhancement python
Projects
None yet
Development

No branches or pull requests

2 participants