Skip to content

Build graph exclude stdlib #143

Open

Description

@sbrugman

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.

Activity

  1. seddonym commented on Feb 26, 2024

    @seddonym
    Collaborator

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions