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

Use individual notebook requirements #606

Merged
merged 43 commits into from
Oct 10, 2024
Merged

Conversation

jeffjennings
Copy link
Contributor

@jeffjennings jeffjennings commented Sep 26, 2024

  • Removes the top-level requirements.txt in favor of individual requirements.txt specified in each folder in tutorials.

  • Applies these individual requirements in the execute and convert commands of the Makefile. There, packages are force re-installed (not re-installed if the cache already contains the same version) for each group of notebooks (a group is the set of notebooks in each folder in tutorials).

  • Adds a cell near the top of each notebook specifying the required packages to run the notebook (pulled from the relevant requirements.txt.

Note to reviewer: The diffs for the notebook files are showing changes to metadata, even though it seems like the pre-commit is supposed to strip that. The only change to each notebook file is the addition of the cell printing the required packages (and in a few cases the consolidation of markdown cells at the top of the notebook that constitute the preamble, to adhere to the 'Template intro guide' in case some search indexing is done that assumes the entire preamble is contained in the first cell).

Closes #601

  • Check the box to confirm that you are familiar with the contributing guidelines and/or indicate (check the box) that you are familiar with our contributing workflow.
  • Confirm that any contributed tutorials contain a complete Introduction which includes an Author list, Learning Goals, Keywords, Companion Content (if applicable), and a Summary.
  • Check the box to confirm that you are familiar with the Astropy community code of conduct and you agree to follow the CoC.

@jeffjennings jeffjennings marked this pull request as draft September 26, 2024 12:42
@jeffjennings jeffjennings mentioned this pull request Sep 26, 2024
3 tasks
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jeffjennings jeffjennings added the Run all tutorials Tells the GitHub actions CI to run all tutorials in the repo (vs. only modified ones) label Oct 9, 2024
@jeffjennings jeffjennings marked this pull request as ready for review October 10, 2024 05:59
@jeffjennings jeffjennings changed the title [WIP] Use individual notebook requirements Use individual notebook requirements Oct 10, 2024
Copy link
Member

@adrn adrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I think this will be a good change for users!

I'd like to discuss one implication of this change, which is that in this new way of managing requirements, pinning dependencies now requires updating many files. It would be nice if we didn't have to keep track of this. But I can't think of a better way of managing that! Thoughts?

Relatedly, I can see a use case (at least for us as developers) for wanting to be able to install all dependencies in one go. The old top-level requirements.txt file provided this. Would it make sense to provide a makefile command that just loops through all of the tutorial directories and installs all requirements?

@jeffjennings
Copy link
Contributor Author

Yes it's a good idea! Unfortunately there are a few cases where the version for the same requirement differs, making it hard to have a single, top-level set of requirements.

Copy link
Member

@adrn adrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jeffjennings -- LGTM!

@adrn adrn merged commit 4c373d7 into astropy:main Oct 10, 2024
3 checks passed
@jeffjennings jeffjennings mentioned this pull request Oct 28, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run all tutorials Tells the GitHub actions CI to run all tutorials in the repo (vs. only modified ones)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix broken build process - implement nox?
2 participants