跳转到主要内容

检查Python包分发,对常见问题发出警告。

项目描述

pydistcheck

conda-forge version conda-forge downloads PyPI Version PyPI downloads Documentation Status GitHub Actions GitHub Actions

什么是pydistcheck

pydistcheck是一个命令行界面(CLI),您可以在Python包上运行,它可以

  • 检测常见兼容性问题
  • 打印出包内容的实用摘要

它受到R语言的R CMD check的启发。

支持的格式

  • Python sdists
  • Python wheels
  • conda包(包括.conda.tar.bz2
  • 任何.tar.bz2.tar.gz.zip存档

请参阅"如何测试Python发行版",了解它以及类似工具(如auditwheelcheck-wheel-contentstwine 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 查看哈希值

上传时间 Python 3

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面