pydistcheck


Namepydistcheck JSON
Version 0.6.0 PyPI version JSON
download
home_page
SummaryInspect Python package distributions and raise warnings on common problems.
upload_time2024-02-18 06:01:54
maintainer
docs_urlNone
author
requires_python>=3.8
licenseBSD 3-Clause License Copyright (c) 2022, James Lamb All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords linter python-packaging testing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydistcheck

[![conda-forge version](https://img.shields.io/conda/vn/conda-forge/pydistcheck.svg)](https://anaconda.org/conda-forge/pydistcheck)
[![conda-forge downloads](https://img.shields.io/conda/dn/conda-forge/pydistcheck.svg)](https://anaconda.org/conda-forge/pydistcheck)
[![PyPI Version](https://img.shields.io/pypi/v/pydistcheck.svg?logo=pypi&logoColor=white)](https://pypi.org/project/pydistcheck)
[![PyPI downloads](https://static.pepy.tech/badge/pydistcheck)](https://pypi.org/project/pydistcheck)
[![Documentation Status](https://readthedocs.org/projects/pydistcheck/badge/?version=latest)](https://pydistcheck.readthedocs.io/)
[![GitHub Actions](https://github.com/jameslamb/pydistcheck/workflows/unit-tests/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/unit-tests.yml)
[![GitHub Actions](https://github.com/jameslamb/pydistcheck/workflows/smoke-tests/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/smoke-tests.yml)

## What is `pydistcheck`?

`pydistcheck` is a command line interface (CLI) that you run on Python packages, which can:

* detect common portability issues
* print useful summaries of the package's contents

It's inspired by R's `R CMD check`.

Supported formats:

* Python sdists
* Python wheels
* `conda` packages (both `.conda` and `.tar.bz2`)
* any `.tar.bz2`, `.tar.gz`, or `.zip` archive

See ["How to Test a Python Distribution"](https://pydistcheck.readthedocs.io/en/latest/how-to-test-a-python-distribution.html) to see how it and similar tools like [`auditwheel`](https://github.com/pypa/auditwheel), [`check-wheel-contents`](https://github.com/jwodder/check-wheel-contents), and [`twine check`](https://twine.readthedocs.io/en/stable/#twine-check) fit into Python development workflows.

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](https://www.youtube.com/watch?v=1a7g5l_g_U8)).

## Installation

Install with `pipx`.

```shell
pipx install pydistcheck
```

## Quickstart

Try it out on the test data in this project ...

```shell
pydistcheck tests/data/problematic-package-*
```

... to see the types of issues it checks for.

```text
------------ 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
```

And on a built distribution containing compiled objects ...

```shell
pydistcheck tests/data/debug-baseballmetrics*.whl
```

... `pydistcheck` can detect the inclusion of debug symbols (which increase distribution size).

```text
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
```

See https://pydistcheck.readthedocs.io/en/latest/ to learn more.

## References

* Python packaging guides: https://packaging.python.org/en/latest/guides/#

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pydistcheck",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "James Lamb <jaylamb20@gmail.com>",
    "keywords": "linter,python-packaging,testing",
    "author": "",
    "author_email": "James Lamb <jaylamb20@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/35/98/6a7e1ba1a688d482b08d5b5634e94fddcb643b16a2019e28dce78e0ffb6b/pydistcheck-0.6.0.tar.gz",
    "platform": null,
    "description": "# pydistcheck\n\n[![conda-forge version](https://img.shields.io/conda/vn/conda-forge/pydistcheck.svg)](https://anaconda.org/conda-forge/pydistcheck)\n[![conda-forge downloads](https://img.shields.io/conda/dn/conda-forge/pydistcheck.svg)](https://anaconda.org/conda-forge/pydistcheck)\n[![PyPI Version](https://img.shields.io/pypi/v/pydistcheck.svg?logo=pypi&logoColor=white)](https://pypi.org/project/pydistcheck)\n[![PyPI downloads](https://static.pepy.tech/badge/pydistcheck)](https://pypi.org/project/pydistcheck)\n[![Documentation Status](https://readthedocs.org/projects/pydistcheck/badge/?version=latest)](https://pydistcheck.readthedocs.io/)\n[![GitHub Actions](https://github.com/jameslamb/pydistcheck/workflows/unit-tests/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/unit-tests.yml)\n[![GitHub Actions](https://github.com/jameslamb/pydistcheck/workflows/smoke-tests/badge.svg?branch=main)](https://github.com/jameslamb/pydistcheck/actions/workflows/smoke-tests.yml)\n\n## What is `pydistcheck`?\n\n`pydistcheck` is a command line interface (CLI) that you run on Python packages, which can:\n\n* detect common portability issues\n* print useful summaries of the package's contents\n\nIt's inspired by R's `R CMD check`.\n\nSupported formats:\n\n* Python sdists\n* Python wheels\n* `conda` packages (both `.conda` and `.tar.bz2`)\n* any `.tar.bz2`, `.tar.gz`, or `.zip` archive\n\nSee [\"How to Test a Python Distribution\"](https://pydistcheck.readthedocs.io/en/latest/how-to-test-a-python-distribution.html) to see how it and similar tools like [`auditwheel`](https://github.com/pypa/auditwheel), [`check-wheel-contents`](https://github.com/jwodder/check-wheel-contents), and [`twine check`](https://twine.readthedocs.io/en/stable/#twine-check) fit into Python development workflows.\n\nFor more background on the value of such a tool, see the SciPy 2022 talk \"Does that CSV Belong on PyPI? Probably Not\" ([video link](https://www.youtube.com/watch?v=1a7g5l_g_U8)).\n\n## Installation\n\nInstall with `pipx`.\n\n```shell\npipx install pydistcheck\n```\n\n## Quickstart\n\nTry it out on the test data in this project ...\n\n```shell\npydistcheck tests/data/problematic-package-*\n```\n\n... to see the types of issues it checks for.\n\n```text\n------------ check results -----------\n1. [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\n2. [mixed-file-extensions] Found a mix of file extensions for the same file type: .NDJSON (1), .jsonl (1), .ndjson (1)\n3. [mixed-file-extensions] Found a mix of file extensions for the same file type: .yaml (2), .yml (1)\n4. [path-contains-non-ascii-characters] Found file path containing non-ASCII characters: 'problematic-package-0.1.0/problematic_package/?veryone-loves-python.py'\n5. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/beep boop.ini'\n6. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/'\n7. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/__init__.py'\n8. [path-contains-spaces] Found path with spaces: 'problematic-package-0.1.0/problematic_package/bad code/ship-it.py'\n9. [unexpected-files] Found unexpected directory 'problematic-package-0.1.0/.git/'.\n10. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/.gitignore'.\n11. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/.hadolint.yaml'.\n12. [unexpected-files] Found unexpected file 'problematic-package-0.1.0/problematic_package/.gitignore'.\nerrors found while checking: 12\n```\n\nAnd on a built distribution containing compiled objects ...\n\n```shell\npydistcheck tests/data/debug-baseballmetrics*.whl\n```\n\n... `pydistcheck` can detect the inclusion of debug symbols (which increase distribution size).\n\n```text\nchecking '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'\n------------ check results -----------\n1. [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\"'.\nerrors found while checking: 1\n\nchecking 'tests/data/debug-baseballmetrics-py3-none-manylinux_2_28_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.whl'\n------------ check results -----------\n1. [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\"'.\nerrors found while checking: 1\n```\n\nSee https://pydistcheck.readthedocs.io/en/latest/ to learn more.\n\n## References\n\n* Python packaging guides: https://packaging.python.org/en/latest/guides/#\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2022, James Lamb All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Inspect Python package distributions and raise warnings on common problems.",
    "version": "0.6.0",
    "project_urls": {
        "changelog": "https://github.com/jameslamb/pydistcheck/releases",
        "documentation": "https://pydistcheck.readthedocs.io/en/latest/",
        "homepage": "https://pydistcheck.readthedocs.io/en/latest/",
        "repository": "https://github.com/jameslamb/pydistcheck"
    },
    "split_keywords": [
        "linter",
        "python-packaging",
        "testing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "493ccf92eeead074d805e5d7af6e5e8089782c86c38f457f5e1e3a4d28d76bae",
                "md5": "07c611e3b2a7bf110039c7984eb1fb42",
                "sha256": "0fea599700fc9f9a89cd1c2cf8f97ae62a6c9bedca7fbda72f7b0d03191ce60e"
            },
            "downloads": -1,
            "filename": "pydistcheck-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07c611e3b2a7bf110039c7984eb1fb42",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19294,
            "upload_time": "2024-02-18T06:01:51",
            "upload_time_iso_8601": "2024-02-18T06:01:51.872034Z",
            "url": "https://files.pythonhosted.org/packages/49/3c/cf92eeead074d805e5d7af6e5e8089782c86c38f457f5e1e3a4d28d76bae/pydistcheck-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "35986a7e1ba1a688d482b08d5b5634e94fddcb643b16a2019e28dce78e0ffb6b",
                "md5": "f20f7d9d4c57ccc8ebe19925f82a598e",
                "sha256": "e72a54739fc5d6c2c6edb8738a69aea2a94f006e322431e38fcf1a071f9b5298"
            },
            "downloads": -1,
            "filename": "pydistcheck-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f20f7d9d4c57ccc8ebe19925f82a598e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26867,
            "upload_time": "2024-02-18T06:01:54",
            "upload_time_iso_8601": "2024-02-18T06:01:54.006964Z",
            "url": "https://files.pythonhosted.org/packages/35/98/6a7e1ba1a688d482b08d5b5634e94fddcb643b16a2019e28dce78e0ffb6b/pydistcheck-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-18 06:01:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jameslamb",
    "github_project": "pydistcheck",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pydistcheck"
}
        
Elapsed time: 0.18469s