0

I'm thinking about releasing one of my github projects as package to PyPI and Conda. It would be the first time for me to release something and I'm new to the process, naturally I have a lot of questions. One of them concerns dependencies.

Usually there's a requirements.txt or environment.yaml file with all the dependencies for the package or some other kind of config file (setup.py, setup.cfg). For the documentation I'd like to include some examples on how to use my package in a separate examples folder. For this I'd like to use other libraries like matplotlib for plotting or pandas for nice table formatting, which are not essential for the usage my package.

If and how do I include non essential requirements to my project ?

Do I just leave those non essential packages out of the requirement / environment files and push my example scripts to the repo anyway? Or do I have to include those libraries as well?

sinoroc
  • 18,409
  • 2
  • 39
  • 70
Tinu
  • 2,432
  • 2
  • 8
  • 20
  • 2
    Are you looking for the _extras_ feature of Python packaging? Extras are lists of optional dependencies. -- https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies – sinoroc Dec 27 '20 at 11:34
  • 1
    Does this answer your question? [How to support alternate dependencies in a Python package?](https://stackoverflow.com/questions/52286940/how-to-support-alternate-dependencies-in-a-python-package) – phd Dec 27 '20 at 12:36
  • 1
    Thanks! The documentation solved my confusion. `extras_require` is where I should optional dependencies. – Tinu Dec 27 '20 at 15:15

0 Answers0