pydistcheck icon indicating copy to clipboard operation
pydistcheck copied to clipboard

[feature request] re-structure `summarize`

Open jameslamb opened this issue 3 years ago • 3 comments

What change would you like to see?

The project should have a way to print diagnostic information about Python distributions, to aid developers in trimming the size of their distributions and addressing other warnings raised by pydistcheck.

That sort of exists today, in the form of pydistcheck-summarize.

https://github.com/jameslamb/pydistcheck/blob/931cb8a6990262f4ae64f51cced79989c8ed86ea/setup.cfg#L46

https://github.com/jameslamb/pydistcheck/blob/931cb8a6990262f4ae64f51cced79989c8ed86ea/src/pydistcheck/cli.py#L135-L137

But that entrypoint isn't really tested or documented.

That functionality deserves some attention.

First, decide on an interface.

# option 1: separate CLI
pydistcheck-summarize

# option 2: sub-command
pydistcheck summarize

# option 3: print output while also enforcing checks...
pydistcheck --summarize

# ... or with the checks turned off
pydistcheck --summarize-only

then:

  • [x] tests covering 100% of the current functionality
  • [x] update documentation
  • [ ] cut other issues in the backlog documenting improvements and extensions

How would implementing this improve pydistcheck?

Would allow the use of pydistcheck to identify opportunities to improve distributions.

Notes

No response

jameslamb avatar Oct 24 '22 04:10 jameslamb

flake8 took the "add a flag to the main entrypoint" approach for some functionality.

flake8 --help

# --benchmark           Print benchmark information about this run of Flake8
# --bug-report          Print information necessary when preparing a bug report
# --statistics          Count errors and warnings

I like that 😎

jameslamb avatar Oct 26 '22 03:10 jameslamb

pylint also uses options to switch, although they make them mutually exclusive (instead of additive)

pylint --help
Commands:
  Options which are actually commands. Options in this group are mutually exclusive.

  --rcfile RCFILE       Specify a configuration file to load.
  --output OUTPUT       Specify an output file.
  --help-msg HELP_MSG [HELP_MSG ...]
                        Display a help message for the given message id and exit. The value may be a
                        comma separated list of message ids.
  --list-msgs           Display a list of all pylint's messages divided by whether they are emittable
                        with the given interpreter.
  --list-msgs-enabled   Display a list of what messages are enabled, disabled and non-emittable with
                        the given configuration.
  --list-groups         List pylint's message groups.
  --list-conf-levels    Generate pylint's confidence levels.
  --list-extensions     List available extensions.
  --full-documentation  Generate pylint's full documentation.
  --generate-rcfile     Generate a sample configuration file according to the current configuration.
                        You can put other options before this one to get them in the generated
                        configuration.
  --generate-toml-config
                        Generate a sample configuration file according to the current configuration.
                        You can put other options before this one to get them in the generated
                        configuration. The config is in the .toml format.
  --long-help           Show more verbose help.

jameslamb avatar Oct 26 '22 03:10 jameslamb

I'm considering one of the following for this functionality.

pydistcheck --audit
pydistcheck --info
pydistcheck --inspect
pydistcheck --summarize

I kind of like --inspect as an entrypoint for "print diagnostic information".

jameslamb avatar Oct 26 '22 03:10 jameslamb

cut other issues in the backlog documenting improvements and extensions

  • #116
  • #201

With those written up, I think this is complete.

pydistcheck --inspect has been really helpful for me so far, I hope others will find it helpful too.

jameslamb avatar May 27 '24 05:05 jameslamb