检查Python包分发,对常见问题发出警告。
项目描述
pydistcheck
什么是pydistcheck
?
pydistcheck
是一个命令行界面(CLI),您可以在Python包上运行,它可以
- 检测常见兼容性问题
- 打印出包内容的实用摘要
它受到R语言的R CMD check
的启发。
支持的格式
- Python sdists
- Python wheels
conda
包(包括.conda
和.tar.bz2
)- 任何
.tar.bz2
、.tar.gz
或.zip
存档
请参阅"如何测试Python发行版",了解它以及类似工具(如auditwheel
、check-wheel-contents
和twine check
)如何融入Python开发工作流程。
有关此类工具价值的更多背景信息,请参阅SciPy 2022演讲"那个CSV属于PyPI吗?可能不是"(视频链接)。
安装
使用pip
安装。
pip install pydistcheck
或conda
。
conda install -c conda-forge pydistcheck
有关更多详细信息,请参阅"安装"(链接)。
快速入门
在这个项目的测试数据上试一试...
pydistcheck tests/data/problematic-package-*
...以查看它检查的问题类型。
------------ check results -----------
1. [files-only-differ-by-case] Found files which differ only by case. 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. [mixed-file-extensions] Found a mix of file extensions for the same file type: .NDJSON (1), .jsonl (1), .ndjson (1)
3. [mixed-file-extensions] Found a mix of file extensions for the same file type: .yaml (2), .yml (1)
4. [path-contains-non-ascii-characters] Found file path containing non-ASCII characters: 'problematic-package-0.1.0/problematic_package/?veryone-loves-python.py'
5. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/beep boop.ini'
6. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/'
7. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/__init__.py'
8. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/ship-it.py'
9. [unexpected-files] Found unexpected directory 'problematic-package-0.1.0/.git/'.
10. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/.gitignore'.
11. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/.hadolint.yaml'.
12. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/problematic_package/.gitignore'.
errors found while checking: 12
以及在包含编译对象的构建发行版上...
pydistcheck tests/data/debug-baseballmetrics*.whl
...pydistcheck
可以检测包含调试符号(这会增加发行版大小)。
checking 'tests/data/debug-baseballmetrics-0.1.0-py3-none-macosx_10_15_x86_64.macosx_11_6_x86_64.macosx_12_5_x86_64.whl'
------------ check results -----------
1. [compiled-objects-have-debug-symbols] Found compiled object containing debug symbols. For details, extract the distribution contents and run 'dsymutil -s "lib/lib_baseballmetrics.dylib"'.
errors found while checking: 1
checking 'tests/data/debug-baseballmetrics-py3-none-manylinux_2_28_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl'
------------ check results -----------
1. [compiled-objects-have-debug-symbols] Found compiled object containing debug symbols. For details, extract the distribution contents and run 'objdump --all-headers "lib/lib_baseballmetrics.so"'.
errors found while checking: 1
请参阅https://pydistcheck.readthedocs.io/en/latest/以了解更多信息。
参考文献
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。
源发行版
pydistcheck-0.7.1.tar.gz (28.2 KB 查看哈希值)
构建发行版
pydistcheck-0.7.1-py3-none-any.whl (19.8 KB 查看哈希值)
关闭
pydistcheck-0.7.1.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 365d69550c0a0c5ab6e10cb9dac06f363e04e98ea7fb37a1e217f9b5541e9d4e |
|
MD5 | dd13c85ce7665d08faca087a313c680a |
|
BLAKE2b-256 | a6a1d984dad483f613764b6adda3ed3f1adb3d232ead189d95063d5d8edb9ce7 |
关闭
pydistcheck-0.7.1-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | c4deef444158e05316c1c2d2d77c30d4856e70e907cb76e1388376df9ca1c8b9 |
|
MD5 | 63ced00ff56d9a65dbdd5a845982416c |
|
BLAKE2b-256 | 93447e4e554b651c377953c729294953df2e761ee2a5c7c2f2db2704ae22cc22 |