jupyterhub / mybinder.org-user-guide

Turn a Git repo into a collection of interactive notebooks. This is Binder's user documentation repository.
https://mybinder.readthedocs.io
BSD 3-Clause "New" or "Revised" License
150 stars 103 forks source link

Define extra Python env requirements on top of root directory requirements.txt #286

Closed biphasic closed 10 months ago

biphasic commented 10 months ago

Not all the dependencies that might be necessary in a binder environment are always present in the root requirements.txt, sometimes they are split into other files.

Proposed change

It would be great to be able to define extra environment dependencies that are not just in the root requirements.txt file. My library has another requirements.txt in the docs folder, to run the notebooks for example.

Alternative options

Who would use this feature?

Anyone who has separate dependencies for testing/documentation

(Optional): Suggest a solution

Make it possible to define extra environment files with the help of a .binder.yaml file

welcome[bot] commented 10 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

consideRatio commented 10 months ago

Your requirements.txt file can link to other requirements.txt files i think, right?

biphasic commented 10 months ago

that could be, but my main point is that the base requirements of the package are not always the same as the ones needed in a Binder env. In my case, the tutorial notebooks that I'd like users to be able to run require other large packages that I don't want to include in the root requirements.txt

betatim commented 10 months ago

You can create a .binder/ directory in your repository and files in that will take precedent over the repo root. That lets you have different requirements for tutorial notebooks and such.

biphasic commented 10 months ago

this worked perfectly! As I didn't see any note about that in the docs, I added a line in a PR: https://github.com/binder-examples/requirements/pull/25