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

Install dependencies based on core, dev, doc or test use case #130

Closed
EwoutH opened this issue May 18, 2022 · 3 comments · Fixed by #166
Closed

Install dependencies based on core, dev, doc or test use case #130

EwoutH opened this issue May 18, 2022 · 3 comments · Fixed by #166
Assignees
Milestone

Comments

@EwoutH
Copy link
Collaborator

EwoutH commented May 18, 2022

Currently everything in requirements.txt is always installed no matter the use case. For essential usage (core) a lot less dependencies are needed than for development or docs generation. sphinx and nbsphinx (and pyscaffold?) are for example only needed when building docs. The jupyter and ipython stuff is also only needed in some cases.

I was thinking of using Extras as defined in PEP 508.

Suggested options for PyPI:

  • pip install ema-workbench installs the ema-workbench and core dependencies (numpy etc.)
  • pip install ema-workbench[jupyter] installs all the Jupyter stuff to run in notebooks including parallel
  • pip install ema-workbench[dev] installs everything needed for development and testing
  • pip install ema-workbench[docs] installs everything for doc generation
  • pip install ema-workbench[all] installs a superset of all of the above.

Combinations can be used, like pip install ema-workbench[jupyter,dev].

I need a bit of time to sort out how to structure all this, but if agreed this is useful I can create a draft PR.

@quaquel
Copy link
Owner

quaquel commented May 18, 2022

a PR on this would be very welcome

@EwoutH
Copy link
Collaborator Author

EwoutH commented May 18, 2022

I found a project that has quite a nice setup, pyimgui. Most of the stuff is in the setup.py and a bit in pyproject.toml.

What would you prefer, dependencies defined in:

  1. The main setup.py file
  2. A separate setup.cfg file
  3. A seperate pyproject.toml file
  4. Separate files like dev-requirements.txt, jupyter-requirements.txt, etc.

I think a separate setup.cfg is the most clean. It's also an old method however, pyproject.toml seems the new standard according to PEP 518 and PEP 621.

See also: setuptools: Optional dependencies.

@quaquel
Copy link
Owner

quaquel commented May 18, 2022

it seems the pyproject.toml is the new standard, so my hunch would be to got with that to also future proof the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants