-
Notifications
You must be signed in to change notification settings - Fork 127
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
hooks: rewrite pygraphviz hook #849
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a functional test for `pygraphviz` that tries to use different `graphviz` programs and output formats, in order to ensure that `graphviz` programs and plugins are properly collected. This complements the existing test that ensures that `pygraphviz.AGraph` resolves the bundled copies of `graphviz` programs, but does not test their actual use.
Rewrite `pygraphviz` hook to fix discovery and collection of `graphviz` files under various Linux distributions, in Anaconda environments (Windows, Linux, and macOS), and msys2 environments (Windows). We now discover active `graphviz` installation on all OSes by looking for `dot` program in `PATH`. To find the location of shared libraries and the plugin directory on non-Windows, we now perform binary dependency analysis on the `dot` executable and look for known `graphviz` shared libraries in the results. This improves the discovery on various platforms, and also fixes the issue where system-installed (on Linux) or Homebrew-installed (on macOS) `graphviz` shared libraries and plugins would end up being collected instead of Anaconda-packaged ones when using Anaconda environment with Anaconda-packaged `graphviz`.
Tested with:
|
Enable `pygraphviz` tests on linux and macOS; requires installing `graphviz` via `brew install` (macOS runner) and `apt-get install` (Ubuntu runner).
bwoodsend
approved these changes
Jan 7, 2025
rokm
force-pushed
the
hook-pygraphviz
branch
2 times, most recently
from
January 7, 2025 21:51
e8bdbe7
to
0b1296f
Compare
On `macos-14` arm64 runners, Homebrew is installed in `/opt/homebrew` instead of `/usr/local` prefix, and its headers and shared libraries are not in the default search path. Add them by setting `CPPFLAGS` and `LDFLAGS`. This is required by `pygraphviz`, which needs to build its extension and link it against Homebrew-installed `graphviz`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rewrite
pygraphviz
hook to fix discovery and collection ofgraphviz
files under various Linux distributions, in Anaconda environments (Windows, Linux, and macOS), and msys2 environments (Windows).We now discover active
graphviz
installation on all OSes by looking fordot
program inPATH
. To find the location of shared libraries and the plugin directory on non-Windows, we now perform binary dependency analysis on thedot
executable and look for knowngraphviz
shared libraries in the results.This improves the discovery on various platforms, and also fixes the issue where system-installed (on Linux) or Homebrew-installed (on macOS)
graphviz
shared libraries and plugins would end up being collected instead of Anaconda-packaged ones when using Anaconda environment with Anaconda-packagedgraphviz
.Supersedes and closes #520.
Closes #705.