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

♻️ Make matplotlib dependency optional #1061

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Nov 6, 2023

This PR supercedes #493

It makes matplotlib and numpy optional dependencies, using pip install sphinx-needs[plotting], by:

  1. Removing direct uses of numpy
  2. Moving the matplotlib import to a function, which can return None
  3. Handling the None case in the needbar/needpie post-processing, by emmiting a warning and replacing the nodes with error admonitions.

A seperate test job and related test file is added for testing builds with needbar/needpie directives, when matplotlib is uninstalled.

@chrisjsewell chrisjsewell force-pushed the make-matplotlib-optional branch from 7b2074c to 24f95ad Compare November 7, 2023 07:24
@chrisjsewell chrisjsewell marked this pull request as ready for review November 7, 2023 07:32
@sigma67
Copy link

sigma67 commented Nov 7, 2023

yes please 🙏 thanks for picking this up

same issue as superceded PR though, lack of tests without matplotlib present?

@chrisjsewell chrisjsewell force-pushed the make-matplotlib-optional branch from f43b545 to 2217df5 Compare November 8, 2023 10:11
@chrisjsewell chrisjsewell force-pushed the make-matplotlib-optional branch from 2217df5 to 8573961 Compare November 8, 2023 10:23
@chrisjsewell chrisjsewell merged commit 5783d92 into master Nov 8, 2023
@chrisjsewell chrisjsewell deleted the make-matplotlib-optional branch November 8, 2023 15:24
@OverkillGuy
Copy link

Congrats @chrisjsewell, you got it across the line for us all \o/

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 this pull request may close these issues.

4 participants