aboutcode-org / python-inspector

Inspect Python code and PyPI package manifests. Resolve Python dependencies.
22 stars 19 forks source link

Operating system and python version are now required fields in CLI #99

Closed TG1999 closed 2 years ago

TG1999 commented 2 years ago

Signed-off-by: Tushar Goel tushar.goel.dav@gmail.com

TG1999 commented 2 years ago

The new help look like this

Usage: python-inspector [OPTIONS]

  Resolve the dependencies for the package requirements listed in one or more
  REQUIREMENT-FILE file, one or more SPECIFIER and one setuptools SETUP-PY-
  FILE file and save the results as JSON to FILE.

  Resolve the dependencies for the requested ``--python-version`` PYVER and
  ``--operating_system`` OS combination.

  Download from the provided PyPI simple --index-url INDEX(s) URLs defaulting
  to PyPI.org.

  Provide source distributions over binary distributions with the --prefer-
  source option. If no source distribution is available then binary
  distributions are used.

  Error and progress are printed to stderr.

  For example, display the results of resolving the dependencies for
  flask==2.1.2 on screen::

      python-inspector --spec "flask==2.1.2" --json -

Options:
  -r, --requirement REQUIREMENT-FILE
                                  Path to pip requirements file listing
                                  thirdparty packages. This option can be used
                                  multiple times.
  -s, --setup-py SETUP-PY-FILE    Path to setuptools setup.py file listing
                                  dependencies and metadata. This option can
                                  be used multiple times.
  --spec, --specifier SPECIFIER   Package specifier such as django==1.2.3.
                                  This option can be used multiple times.
  -p, --python-version PYVER      Python version to use for dependency
                                  resolution.  [required]
  -o, --operating-system OS       OS to use for dependency resolution.
                                  [required]
  --index-url INDEX               PyPI simple index URL(s) to use in order of
                                  preference. This option can be used multiple
                                  times.  [default: https://pypi.org/simple]
  --json FILE                     Write output as pretty-printed JSON to FILE.
                                  Use the special '-' file name to print
                                  results on screen/stdout.
  --json-pdt FILE                 Write output as pretty-printed JSON to FILE
                                  as a tree in the style of pipdeptree. Use
                                  the special '-' file name to print results
                                  on screen/stdout.
  --use-pypi-json-api             Use PyPI JSON API to fetch dependency data.
                                  Faster but not always correct. --index-url
                                  are ignored when this option is active.
  --analyze-setup-py-insecurely   Enable collection of requirements in
                                  setup.py that compute these dynamically.
                                  This is an insecure operation as it can run
                                  arbitrary code.
  --prefer-source                 Prefer source distributions over binary
                                  distributions if no source distribution is
                                  available then binary distributions are used
  -V, --version                   Show the version and exit.
  -h, --help                      Show this message and exit.