Skip to content

Commit

Permalink
[docs] update docs on configuration (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored May 22, 2024
1 parent ff3e945 commit fc65d1e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: conda-incubator/setup-miniconda@v3
with:
environment-file: docs/env.yml
activate-environment: pydistscheck-docs
activate-environment: pydistcheck-docs
miniforge-variant: Mambaforge
use-mamba: true
- name: build docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fetch-depth: 1
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pydistscheck-tests
activate-environment: pydistcheck-tests
miniforge-variant: Mambaforge
use-mamba: true
python-version: ${{ matrix.python_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
fetch-depth: 1
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pydistscheck-tests
activate-environment: pydistcheck-tests
miniforge-variant: Mambaforge
use-mamba: true
python-version: ${{ matrix.python_version }}
Expand Down
25 changes: 25 additions & 0 deletions docs/_static/defaults.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
[tool.pydistcheck]

# List of checks to ignore.
# See https://pydistcheck.readthedocs.io/en/latest/check-reference.html for
# a complete list.
ignore = []

# Set to true to print a summary of the distribution, like its total
# size and largest files.
inspect = false

# If more than this many files is found in the distribution,
# pydistcheck reports a 'too-many-files' check failure.
max_allowed_files = 2000

# If the distribution is larger than this size (compressed),
# pydistcheck reports a 'distro-too-large-compressed' check failure.
#
# See 'pydistcheck --help' for available units.
max_allowed_size_compressed = '50M'

# If the distribution is larger than this size (uncompressed),
# pydistcheck reports a 'distro-too-large-compressed' check failure.
#
# See 'pydistcheck --help' for available units.
max_allowed_size_uncompressed = '75M'

# List of fnmatch.fnmatchcase() patterns to be compared to directories
# in the distribution.
unexpected_directory_patterns = [
'*/.appveyor',
'*/.binder',
Expand All @@ -15,6 +37,9 @@ unexpected_directory_patterns = [
'*/.pytest_cache',
'*/.mypy_cache'
]

# List of fnmatch.fnmatchcase() patterns to be compared to files
# in the distribution.
unexpected_file_patterns = [
'*/appveyor.yml',
'*/.appveyor.yml',
Expand Down
6 changes: 4 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ Configuration

This page describes how to configure ``pydistcheck``.

``pydistscheck`` resolves different sources of configuration in the following order.
``pydistcheck`` combines different sources of configuration in the following order.

1. default values
2. :ref:`pyproject-toml`
2. :ref:`pyproject-toml` (or custom TOML file passed via ``--config``)
3. :ref:`cli-arguments`

Configuration found further down the list overrides configuration found earlier in the list.

.. toctree::
:maxdepth: 2
:caption: Contents:
Expand Down
2 changes: 1 addition & 1 deletion docs/env.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: pydistscheck-docs
name: pydistcheck-docs
channels:
- nodefaults
- conda-forge
Expand Down
4 changes: 3 additions & 1 deletion src/pydistcheck/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ class ExitCodes:
is_flag=True,
show_default=False,
default=_Config.inspect,
help="print diagnostic information about the distribution",
help=(
"Print a summary of the distribution, like its total size and largest files."
),
)
@click.option( # type: ignore[misc]
"--max-allowed-files",
Expand Down

0 comments on commit fc65d1e

Please sign in to comment.