Configuration

This page describes how to configure pydistcheck.

pydistscheck resolves different sources of configuration in the following order.

  1. default values

  2. pyproject.toml

  3. CLI arguments

CLI arguments

pydistcheck

Run the contents of a distribution through a set of checks, and warn about any problematic characteristics that are detected.

pydistcheck [OPTIONS] [FILEPATHS]...

Options

--ignore <ignore>

comma-separated list of checks to skip, e.g. distro-too-large-compressed,path-contains-spaces.

--inspect

print diagnostic information about the distribution

--max-allowed-files <max_allowed_files>

maximum number of files allowed in the distribution

Default:

2000

--max-allowed-size-compressed <max_allowed_size_compressed>

maximum allowed compressed size, a string like ‘1.5M’ indicating ‘1.5 megabytes’. Supported units: - B = bytes - K = kilobytes - M = megabytes - G = gigabytes

Default:

50M

--max-allowed-size-uncompressed <max_allowed_size_uncompressed>

maximum allowed uncompressed size, a string like ‘1.5M’ indicating ‘1.5 megabytes’. Supported units: - B = bytes - K = kilobytes - M = megabytes - G = gigabytes

Default:

75M

--unexpected-directory-patterns <unexpected_directory_patterns>

comma-delimited list of patterns matching directories that are not expected to be found in the distribution. Patterns should be in the format understood by fnmatch.fnmatchcase(). See https://docs.python.org/3/library/fnmatch.html.

Default:

*/.appveyor,*/.binder,*/.circleci,*/.git,*/.github,*/.idea,*/.pytest_cache,*/.mypy_cache

--unexpected-file-patterns <unexpected_file_patterns>

comma-delimited list of patterns matching files that are not expected to be found in the distribution. Patterns should be in the format understood by fnmatch.fnmatchcase(). See https://docs.python.org/3/library/fnmatch.html.

Default:

*/appveyor.yml,*/.appveyor.yml,*/azure-pipelines.yml,*/.azure-pipelines.yml,*/.cirrus.star,*/.cirrus.yml,*/codecov.yml,*/.codecov.yml,*/.DS_Store,*/.gitignore,*/.gitpod.yml,*/.hadolint.yaml,*/.readthedocs.yaml,*/.travis.yml,*/vsts-ci.yml,*/.vsts-ci.yml

Arguments

FILEPATHS

Optional argument(s)

pyproject.toml

If a file pyproject.toml exists in the working directory pydistcheck is run from, pydistcheck will look there for configuration.

Put configuration in a [tool.pydistcheck] section.

The example below contains all of the configuration options for pydistcheck, set to their default values.

[tool.pydistcheck]

ignore = []
inspect = false
max_allowed_files = 2000
max_allowed_size_compressed = '50M'
max_allowed_size_uncompressed = '75M'
unexpected_directory_patterns = [
    '*/.appveyor',
    '*/.binder',
    '*/.circleci',
    '*/.git',
    '*/.github',
    '*/.idea',
    '*/.pytest_cache',
    '*/.mypy_cache'
]
unexpected_file_patterns = [
    '*/appveyor.yml',
    '*/.appveyor.yml',
    '*/azure-pipelines.yml',
    '*/.azure-pipelines.yml',
    '*/.cirrus.star',
    '*/.cirrus.yml',
    '*/codecov.yml',
    '*/.codecov.yml',
    '*/.DS_Store',
    '*/.gitignore',
    '*/.gitpod.yml',
    '*/.hadolint.yaml',
    '*/.readthedocs.yaml',
    '*/.travis.yml',
    '*/vsts-ci.yml',
    '*/.vsts-ci.yml'
]