thebjorn / pydeps

Python Module Dependency graphs
BSD 2-Clause "Simplified" License
1.73k stars 111 forks source link

Exclude/include dependencies by filepath #217

Open JP01 opened 5 months ago

JP01 commented 5 months ago

I am migrating a number of Python packages to another location internally.

It would be very helpful to have an option to include/exclude based on module filepath, not just name. EG:

  1. --incdir: only include dependencies under a particular directory.
  2. --excdir: exclude dependencies under a particular directory.
thebjorn commented 5 months ago

Hi @JP01, and thank you for your interest in Pydeps.

The -x, -xx, and --only filters might do what you need:

  -x PATTERN [PATTERN ...], --exclude PATTERN [PATTERN ...]
                        input files to skip (e.g. `foo.*`), multiple file names can be provided
  -xx MODULE [MODULE ...], --exclude-exact MODULE [MODULE ...]
                        same as --exclude, except requires the full match. `-xx foo.bar` will exclude foo.bar, but not
                        foo.bar.blob
  --only MODULE_PATH [MODULE_PATH ...]
                        only include modules that start with MODULE_PATH