check-sdist


Namecheck-sdist JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryCheck the contents of an SDist vs. git
upload_time2024-10-15 14:26:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords lint packaging sdist
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # check-sdist

[![Actions Status][actions-badge]][actions-link]
[![codecov][codecov-badge]][codecov-link]
[![PyPI version][pypi-version]][pypi-link]
[![PyPI platforms][pypi-platforms]][pypi-link]

Have you ever shipped broken SDists with missing files or possibly dirty SDists
with files that shouldn't have been there? Have you noticed that standards
compliant tools aren't making the same SDist that `flit build` is? Is hatchling
adding `.DSStore` files when you ship from your macOS? No matter what
build-backend you use, check-sdist can help!

Check-sdist builds an SDist and compares the contents with your Git repository
contents. It can even temporarily inject common junk files (like pycache files
or OS specific files) and help verify that those aren't getting bundled into
your SDist. If you are getting files you didn't expect or missing files you did
expect, consult your build backend's docs to see how to include or exclude
files.

### Quick start

To run with [pipx][]:

```console
$ pipx run check-sdist[uv]
```

Or, if you like [uv][] instead (faster):

```console
$ uvx check-sdist
```

You can add `--no-isolation` to disable build isolation (faster, but must
preinstall build dependencies), `--source-dir` to select a different source
directory to check, and `--inject-junk` to temporarily inject some common junk
files while running. You can select an installer for build to use with
`--installer=`, choices are `uv`, `pip`, or `uv|pip`, which will use uv if
available (the default).

If you need the latest development version:

```console
$ pipx run --spec git+https://github.com/henryiii/check-sdist check-sdist
```

### Pre-commit integration

To use the [pre-commit](https://pre-commit.com) integration, put this in your
`.pre-commit-config.yaml`:

```yaml
- repo: https://github.com/henryiii/check-sdist
  rev: v1.2.0
  hooks:
    - id: check-sdist
      args: [--inject-junk]
      additional_dependencies: [] # list your build deps here
```

This requires your build dependencies, but in doing so, it can cache the
environment, making it quite fast. The installation is handled by pre-commit;
see [`pre-commit-uv`](https://pypi.org/p/pre-commit-uv) if you want to try to
optimize the initial setup. If uv is present (including in your
`additional_dependencies`), the build will be slightly faster, as uv is used to
do the build. If you don't mind slower runs and don't want to require a build
dependency listing:

```yaml
- repo: https://github.com/henryiii/check-sdist
  rev: v1.2.0
  hooks:
    - id: check-sdist-isolated
      args: [--inject-junk]
```

This one defaults to including `uv` in `additional_dependencies`; you shouldn't
have to specify anything else.

### Configuration

To configure, these options are supported in your `pyproject.toml` file:

```toml
[tool.check-sdist]
sdist-only = []
git-only = []
default-ignore = true
recurse-submodules = true
mode = "git"
build-backend = "auto"
```

You can add `.gitignore` style lines here, and you can turn off the default
ignore list, which adds some default git-only files.

By default, check-sdist recursively scans the contents of Git submodules, but
you can disable this behavior (e.g. to support older Git versions that don't
have this capability).

You can also select `mode = "all"`, which will instead check every file on your
system. Be prepared to ignore lots of things manually, like `*.pyc` files, if
you use this.

You can tell check-sdist to look for exclude lists for a specific build backend
with `build-backend`, or `"none"` to only use it's own exclude list. Build
backends supported are `"flit_core.buildapi"`, `"hatchling.build"`,
`"scikit_build_core.build"`, `"pdm.backend"`, `"maturin"`, and
`"poetry.core.masonry.api"`. The default, `"auto"`, will try to detect the build
backend if `build-system.build-backend` is set to a known value.

### See also

- [check-manifest](https://github.com/mgedmin/check-manifest): A (currently)
  setuptools specific checker that can suggest possible ways to include/exclude
  files.
- [Scientific Python Development Guide](https://learn.scientific-python.org/development/):
  Guidelines on which this package was designed.

<!-- prettier-ignore-start -->
[actions-badge]:            https://github.com/henryiii/check-sdist/workflows/CI/badge.svg
[actions-link]:             https://github.com/henryiii/check-sdist/actions
[pypi-link]:                https://pypi.org/project/check-sdist/
[pypi-platforms]:           https://img.shields.io/pypi/pyversions/check-sdist
[pypi-version]:             https://img.shields.io/pypi/v/check-sdist
[codecov-badge]:            https://codecov.io/gh/henryiii/check-sdist/graph/badge.svg?token=noB2wxFVBr
[codecov-link]:             https://codecov.io/gh/henryiii/check-sdist
[pipx]:                     https://pipx.pypa.io
[uv]:                       https://docs.astral.sh/uv
<!-- prettier-ignore-end -->

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "check-sdist",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "lint, packaging, sdist",
    "author": null,
    "author_email": "Henry Schreiner <henryschreineriii@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/62/70/736a14df53b496dc7e2edfd1c4e45babd5506c8c93c77053b25eff3ffcdb/check_sdist-1.2.0.tar.gz",
    "platform": null,
    "description": "# check-sdist\n\n[![Actions Status][actions-badge]][actions-link]\n[![codecov][codecov-badge]][codecov-link]\n[![PyPI version][pypi-version]][pypi-link]\n[![PyPI platforms][pypi-platforms]][pypi-link]\n\nHave you ever shipped broken SDists with missing files or possibly dirty SDists\nwith files that shouldn't have been there? Have you noticed that standards\ncompliant tools aren't making the same SDist that `flit build` is? Is hatchling\nadding `.DSStore` files when you ship from your macOS? No matter what\nbuild-backend you use, check-sdist can help!\n\nCheck-sdist builds an SDist and compares the contents with your Git repository\ncontents. It can even temporarily inject common junk files (like pycache files\nor OS specific files) and help verify that those aren't getting bundled into\nyour SDist. If you are getting files you didn't expect or missing files you did\nexpect, consult your build backend's docs to see how to include or exclude\nfiles.\n\n### Quick start\n\nTo run with [pipx][]:\n\n```console\n$ pipx run check-sdist[uv]\n```\n\nOr, if you like [uv][] instead (faster):\n\n```console\n$ uvx check-sdist\n```\n\nYou can add `--no-isolation` to disable build isolation (faster, but must\npreinstall build dependencies), `--source-dir` to select a different source\ndirectory to check, and `--inject-junk` to temporarily inject some common junk\nfiles while running. You can select an installer for build to use with\n`--installer=`, choices are `uv`, `pip`, or `uv|pip`, which will use uv if\navailable (the default).\n\nIf you need the latest development version:\n\n```console\n$ pipx run --spec git+https://github.com/henryiii/check-sdist check-sdist\n```\n\n### Pre-commit integration\n\nTo use the [pre-commit](https://pre-commit.com) integration, put this in your\n`.pre-commit-config.yaml`:\n\n```yaml\n- repo: https://github.com/henryiii/check-sdist\n  rev: v1.2.0\n  hooks:\n    - id: check-sdist\n      args: [--inject-junk]\n      additional_dependencies: [] # list your build deps here\n```\n\nThis requires your build dependencies, but in doing so, it can cache the\nenvironment, making it quite fast. The installation is handled by pre-commit;\nsee [`pre-commit-uv`](https://pypi.org/p/pre-commit-uv) if you want to try to\noptimize the initial setup. If uv is present (including in your\n`additional_dependencies`), the build will be slightly faster, as uv is used to\ndo the build. If you don't mind slower runs and don't want to require a build\ndependency listing:\n\n```yaml\n- repo: https://github.com/henryiii/check-sdist\n  rev: v1.2.0\n  hooks:\n    - id: check-sdist-isolated\n      args: [--inject-junk]\n```\n\nThis one defaults to including `uv` in `additional_dependencies`; you shouldn't\nhave to specify anything else.\n\n### Configuration\n\nTo configure, these options are supported in your `pyproject.toml` file:\n\n```toml\n[tool.check-sdist]\nsdist-only = []\ngit-only = []\ndefault-ignore = true\nrecurse-submodules = true\nmode = \"git\"\nbuild-backend = \"auto\"\n```\n\nYou can add `.gitignore` style lines here, and you can turn off the default\nignore list, which adds some default git-only files.\n\nBy default, check-sdist recursively scans the contents of Git submodules, but\nyou can disable this behavior (e.g. to support older Git versions that don't\nhave this capability).\n\nYou can also select `mode = \"all\"`, which will instead check every file on your\nsystem. Be prepared to ignore lots of things manually, like `*.pyc` files, if\nyou use this.\n\nYou can tell check-sdist to look for exclude lists for a specific build backend\nwith `build-backend`, or `\"none\"` to only use it's own exclude list. Build\nbackends supported are `\"flit_core.buildapi\"`, `\"hatchling.build\"`,\n`\"scikit_build_core.build\"`, `\"pdm.backend\"`, `\"maturin\"`, and\n`\"poetry.core.masonry.api\"`. The default, `\"auto\"`, will try to detect the build\nbackend if `build-system.build-backend` is set to a known value.\n\n### See also\n\n- [check-manifest](https://github.com/mgedmin/check-manifest): A (currently)\n  setuptools specific checker that can suggest possible ways to include/exclude\n  files.\n- [Scientific Python Development Guide](https://learn.scientific-python.org/development/):\n  Guidelines on which this package was designed.\n\n<!-- prettier-ignore-start -->\n[actions-badge]:            https://github.com/henryiii/check-sdist/workflows/CI/badge.svg\n[actions-link]:             https://github.com/henryiii/check-sdist/actions\n[pypi-link]:                https://pypi.org/project/check-sdist/\n[pypi-platforms]:           https://img.shields.io/pypi/pyversions/check-sdist\n[pypi-version]:             https://img.shields.io/pypi/v/check-sdist\n[codecov-badge]:            https://codecov.io/gh/henryiii/check-sdist/graph/badge.svg?token=noB2wxFVBr\n[codecov-link]:             https://codecov.io/gh/henryiii/check-sdist\n[pipx]:                     https://pipx.pypa.io\n[uv]:                       https://docs.astral.sh/uv\n<!-- prettier-ignore-end -->\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Check the contents of an SDist vs. git",
    "version": "1.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/henryiii/check-sdist/issues",
        "Changelog": "https://github.com/henryiii/check-sdist/releases",
        "Homepage": "https://github.com/henryiii/check-sdist"
    },
    "split_keywords": [
        "lint",
        " packaging",
        " sdist"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e99ef59f3a9331be078b8fac853fdf6c0ced7cd623d3df8c319b9ce92ced651a",
                "md5": "19be3afa0c209beef7f5491cfb3639eb",
                "sha256": "8b3f4630cec288a3dd6e91b661910e8fe689d6e8767f7162483d33857c59fb37"
            },
            "downloads": -1,
            "filename": "check_sdist-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "19be3afa0c209beef7f5491cfb3639eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 13342,
            "upload_time": "2024-10-15T14:26:55",
            "upload_time_iso_8601": "2024-10-15T14:26:55.044248Z",
            "url": "https://files.pythonhosted.org/packages/e9/9e/f59f3a9331be078b8fac853fdf6c0ced7cd623d3df8c319b9ce92ced651a/check_sdist-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6270736a14df53b496dc7e2edfd1c4e45babd5506c8c93c77053b25eff3ffcdb",
                "md5": "0cbda0e9a82635d3bb3d56c00b3db7dd",
                "sha256": "7b74d61590768b90f233e61b11183ca910cac27c1818e11e981b2ef13843f741"
            },
            "downloads": -1,
            "filename": "check_sdist-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0cbda0e9a82635d3bb3d56c00b3db7dd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16949,
            "upload_time": "2024-10-15T14:26:56",
            "upload_time_iso_8601": "2024-10-15T14:26:56.216517Z",
            "url": "https://files.pythonhosted.org/packages/62/70/736a14df53b496dc7e2edfd1c4e45babd5506c8c93c77053b25eff3ffcdb/check_sdist-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-15 14:26:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "henryiii",
    "github_project": "check-sdist",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "check-sdist"
}
        
Elapsed time: 0.35914s