Inspect Python package distributions and raise warnings on common problems.
Project description
pydistcheck
What is pydistcheck
?
pydistcheck
is a command line interface (CLI) for:
- inspecting the contents of Python package distributions during development
- enforcing constraints on Python package distributions in continuous integration
It's inspired by R's R CMD check
.
For more background on the value of such a tool, see the SciPY 2022 talk "Does that CSV Belong on PyPI? Probably Not" (video link).
Installation
Install with pipx
.
pipx install pydistcheck
Quickstart
Try it out on the test data in this project!
pydistcheck tests/data/problematic-package-*
Yields something like the following.
------------ check results -----------
1. [files-only-differ-by-case] Found files which differ only by case. Such files are not portable, since some filesystems are case-insensitive. Files: problematic-package-0.1.0/problematic_package/Question.py,problematic-package-0.1.0/problematic_package/question.PY,problematic-package-0.1.0/problematic_package/question.py
2. [path-contains-spaces] File paths with spaces are not portable. Found path with spaces: 'problematic-package-0.1.0/beep boop.ini'
3. [path-contains-spaces] File paths with spaces are not portable. Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code'
4. [path-contains-spaces] File paths with spaces are not portable. Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/__init__.py'
5. [path-contains-spaces] File paths with spaces are not portable. Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/ship-it.py'
6. [path-contains-non-ascii-characters] Found file path containing non-ASCII characters: 'problematic-package-0.1.0/problematic_package/?veryone-loves-python.py'
7. [unexpected-files] Found unexpected directory 'problematic-package-0.1.0/.git/'.
8. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/.gitignore'.
9. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/.hadolint.yaml'.
10. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/problematic_package/.gitignore'.
errors found while checking: 10
See https://pydistcheck.readthedocs.io/en/latest/ to learn more.
Related Projects
References
- Python packaging guides: https://packaging.python.org/en/latest/guides/#
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pydistcheck-0.3.0.tar.gz
(20.7 kB
view hashes)
Built Distribution
Close
Hashes for pydistcheck-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 967276d0a2da6c2c1b11d7e197605d26e1036a4bb776508e78744575358985e7 |
|
MD5 | ddc4b78be414e5c213b3cbbebef474ec |
|
BLAKE2b-256 | 0b17367cd172b62483a24a6e7101551be9af6f1fe0c4e17c29974b6376fbb6af |