Skip to main content

A CLI tool and library for interacting with Thoth

Project description

Thoth pre-commit hook

Get Thoth advise on your dependencies with the Thoth pre-commit hook.

Usage

Example usage in .pre-commit-config.yaml:

---
repos:
  - repo: https://github.com/thoth-station/test-thoth-pre-commit-hook
    hooks:
      - id: thoth-advise
        args: ["--recommendation-type", "security"]

The list of arguments that can be specified can be found by running Thamos, the command line interface to communicate with Thoth's backend:

 Usage: thamos advise [OPTIONS]

 Ask Thoth for recommendations on the application stack.
 Ask the remote Thoth service for advise on the application stack used. The command collects information stated in the .thoth.yaml file for the given runtime
 environment, static source code analysis and requirements for the application and sends them to the remote service. Optionally, install packages resolved by Thoth.
 Examples:
 thamos advise --runtime-environment testing --labels 'foo=bar,qux=baz'
 thamos advise --dev
 thamos advise --install
 thamos advise --no-static-analysis --no-user-stack

╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│  --debug                                                        Run analysis in debug mode on Thoth.                                                               │
│  --no-write                        -W                           Do not write results to files, just print them.                                                    │
│  --recommendation-type             -t  RECOMMENDATION_TYPE      Use selected recommendation type, do not load it from Thoth's config file.                         │
│  --no-wait                                                      Do not wait for analysis to finish, just submit it.                                                │
│  --no-user-stack                                                Do not submit lock file with the request, this lock file is normally used as a base for            │
│                                                                 comparision to recommend a better stack than the one used.                                         │
│  --no-static-analysis                                           Do not perform static analysis of source code files.                                               │
│  --json                            -j                           Print output in JSON format.                                                                       │
│  --force                                                        Force analysis run bypassing server-side cache.                                                    │
│  --runtime-environment             -r  NAME                     Specify explicitly runtime environment to get recommendations for; defaults to the first entry in  │
│                                                                 the configuration file.                                                                            │
│  --dev                                                          Consider or do not consider development dependencies during the resolution. [default: no-dev]      │
│  --install                                                      Install dependencies once the advise is done. [default: False]                                     │
│  --write-advised-manifest-changes      FILE                     Write advised manifest changes to a file.                                                          │
│  --labels                          -l  KEY1=VALUE1,KEY2=VALUE2  Labels used to label the request.                                                                  │
│  --help                                                         Show this message and exit.                                                                        │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

 Check Thamos documentation: https://thoth-station.ninja/docs/developers/thamos

To be able to run this pre-commit hook, the repository must be configured with a .thoth.yaml file as specified in the Thamos CLI documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thoth_pre_commit_hook-0.1.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

thoth_pre_commit_hook-0.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file thoth_pre_commit_hook-0.1.0.tar.gz.

File metadata

  • Download URL: thoth_pre_commit_hook-0.1.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

File hashes

Hashes for thoth_pre_commit_hook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44802eed1bb37d4b920ea3c45f23b394491184fd12e762246601426cae6c1e05
MD5 480563180b502c1b571663e556dc50e7
BLAKE2b-256 1e8cae6c275ac934d64b25066446d5cd42c76def9e74374bac213df6aac98d40

See more details on using hashes here.

File details

Details for the file thoth_pre_commit_hook-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: thoth_pre_commit_hook-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.8

File hashes

Hashes for thoth_pre_commit_hook-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2cee7ead30d8cc77ad0bbe88c19460d4963b7e78c2a4403c99614e2a6d4564cf
MD5 61b32a294210763320d36aee36ce0909
BLAKE2b-256 cacb1af0cd3dbd75d10a1906ee8a3fd8db4fbabdd1191dd712f386a32bbe166a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page