pydeps icon indicating copy to clipboard operation
pydeps copied to clipboard

Exclude/include dependencies by filepath

Open JP01 opened this issue 1 year ago • 1 comments

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.

JP01 avatar Apr 10 '24 21:04 JP01

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

thebjorn avatar Apr 11 '24 08:04 thebjorn