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

Build graph exclude stdlib #143

Open
sbrugman opened this issue Feb 25, 2024 · 1 comment
Open

Build graph exclude stdlib #143

sbrugman opened this issue Feb 25, 2024 · 1 comment

Comments

@sbrugman
Copy link

For the analysis of how heavily a package relies on external dependencies, we can use the include_external_packages argument in the build_graph. This analysis can be used to determine which modules are affected when a dependency is removed/replaced or made optional.

Standard library imports are not relevant for this analysis, as we cannot remove them anyway.

I would like to be able to exclude them, preferably when building the graph. Alternatively, they can be filtered out later.
For this use case, I would suggest exposing the build graph arguments through impulse so that users can perform this analysis quickly from the command line.

@seddonym
Copy link
Owner

So to summarize, we could have an API something like this:

graph = grimp.build_graph('mypackage', include_external_packages=True, exclude_stdlib=True)

And for completeness, possibly this would raise an exception:

graph = grimp.build_graph('mypackage', include_external_packages=False, exclude_stdlib=True)

I think I could get behind this proposal providing it doesn't introduce too much complexity, since as you say we could, alternatively, move this up a level and filter things out by libraries that use Grimp. Feel free to submit something if you'd find it helpful.

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

No branches or pull requests

2 participants