From 6ae3d47a3fae5a7404d8f43017b79d71d778eba0 Mon Sep 17 00:00:00 2001 From: Florian Maas Date: Mon, 8 May 2023 17:18:19 +0200 Subject: [PATCH] Added usage example to README and index of docs (#370) * Added usage example to README and index of docs * changed terminal to console for syntax highlighting --- README.md | 24 ++++++++++++++++-------- docs/index.md | 21 ++++++++++++++++----- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 2ea9b83f..d34b1afc 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,13 @@ Dependency issues are detected by scanning for imported modules within all Pytho ### Installation -_deptry_ can be added to your project with +To add _deptry_ to your project, run one of the following commands: ```shell +# Install with poetry poetry add --group dev deptry -``` - -or with: -```shell - +# Install with pip pip install deptry ``` @@ -55,9 +52,20 @@ To scan your project for dependency issues, run: deptry . ``` -_deptry_ can be configured by using additional command line arguments, or by adding a `[tool.deptry]` section in _pyproject.toml_. +Example output could look as follows: + +```console +Scanning 2 files... + +foo/bar.py:1:0: DEP004 'numpy' imported but declared as a dev dependency +foo/bar.py:2:0: DEP001 'matplotlib' imported but missing from the dependency definitions +pyproject.toml: DEP002 'pandas' defined as a dependency but not used in the codebase +Found 3 dependency issues. +``` + +### Configuration -For more information, see the [documentation](https://fpgmaas.github.io/deptry/). +_deptry_ can be configured by using additional command line arguments, or by adding a `[tool.deptry]` section in _pyproject.toml_. For more information, see the [Usage and Configuration](https://fpgmaas.github.io/deptry/usage/) section of the documentation.. --- diff --git a/docs/index.md b/docs/index.md index 83a32e6c..a7803a8f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -32,15 +32,13 @@ Dependency issues are detected by scanning for imported modules within all Pytho ### Installation -_deptry_ can be added to your project with: +To add _deptry_ to your project, run one of the following commands: ```shell +# Install with poetry poetry add --group dev deptry -``` - -or with: -```shell +# Install with pip pip install deptry ``` @@ -60,5 +58,18 @@ To scan your project for dependency issues, run deptry . ``` +Example output could look as follows: + +```console +Scanning 2 files... + +foo/bar.py:1:0: DEP004 'numpy' imported but declared as a dev dependency +foo/bar.py:2:0: DEP001 'matplotlib' imported but missing from the dependency definitions +pyproject.toml: DEP002 'pandas' defined as a dependency but not used in the codebase +Found 3 dependency issues. +``` + +### Configuration + _deptry_ can be configured by using additional command line arguments, or by adding a `[tool.deptry]` section in `pyproject.toml`. For more information, see [Usage and Configuration](./usage.md)