checkdeps


Namecheckdeps JSON
Version 0.9.0 PyPI version JSON
download
home_pagehttps://github.com/python-packaging/checkdeps/
SummaryEnsures your first-order deps are correct
upload_time2024-01-21 16:13:35
maintainer
docs_urlNone
authorTim Hatch
requires_python>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # checkdeps

It's really easy to accidentally use your transitive deps by accident.  This
project allows you to check (given a working venv) that everything you import
actually comes from either relative imports, your explicit first-order deps, or
stdlib.

Usage:

```
# Run within a working venv
# For CI
$ python -m checkdeps checkdeps

# If you use non-relative imports for your own project's code, also add
$ python -m checkdeps checkdeps --allow-names checkdeps

# For humans, pass -v
$ python -m checkdeps -v checkdeps/cli.py
checkdeps/cli.py:
  click available from ['click']
  pathlib.Path stdlib
  stdlibs.stdlib_module_names available from ['stdlibs']
  sys stdlib
  trailrunner available from ['trailrunner']
  typing.Dict stdlib
  typing.List stdlib
  typing.Optional stdlib
  typing.Set stdlib
```

Exits nonzero if there are any issues.

# But what if I don't want to run it from the same venv

Make sure you specify `--installed-path` to the site-packages dir and run from the same
python version.  A parent of your `target_dir` should be obviously the root of your
project (`pyproject.toml`, `.git`, etc), which is what the `requirements` are relative to.

# But aren't there projects that do this already?

I've looked at them, and I don't like the assumptions they make about top-level
names, stdlib, or namespace packages.  I think this project is more correct and
more self-contained.

# Future work

* Read project metadata instead of requirements
* Ensure metadata and requirements match
* Offer to add missing deps
* Better handling of version-dependent deps in an `if` or `try`/`except`

# License

checkdeps is copyright [Tim Hatch](https://timhatch.com/), and licensed under
the MIT license.  I am providing code in this repository to you under an open
source license.  This is my personal repository; the license you receive to
my code is from me and not from my employer. See the `LICENSE` file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/python-packaging/checkdeps/",
    "name": "checkdeps",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tim Hatch",
    "author_email": "tim@timhatch.com",
    "download_url": "https://files.pythonhosted.org/packages/04/fe/318ee5fb06a9cc5e5e0c6d7a30bd961efd23ea5ba7c1f2068c8911f6ced4/checkdeps-0.9.0.tar.gz",
    "platform": null,
    "description": "# checkdeps\n\nIt's really easy to accidentally use your transitive deps by accident.  This\nproject allows you to check (given a working venv) that everything you import\nactually comes from either relative imports, your explicit first-order deps, or\nstdlib.\n\nUsage:\n\n```\n# Run within a working venv\n# For CI\n$ python -m checkdeps checkdeps\n\n# If you use non-relative imports for your own project's code, also add\n$ python -m checkdeps checkdeps --allow-names checkdeps\n\n# For humans, pass -v\n$ python -m checkdeps -v checkdeps/cli.py\ncheckdeps/cli.py:\n  click available from ['click']\n  pathlib.Path stdlib\n  stdlibs.stdlib_module_names available from ['stdlibs']\n  sys stdlib\n  trailrunner available from ['trailrunner']\n  typing.Dict stdlib\n  typing.List stdlib\n  typing.Optional stdlib\n  typing.Set stdlib\n```\n\nExits nonzero if there are any issues.\n\n# But what if I don't want to run it from the same venv\n\nMake sure you specify `--installed-path` to the site-packages dir and run from the same\npython version.  A parent of your `target_dir` should be obviously the root of your\nproject (`pyproject.toml`, `.git`, etc), which is what the `requirements` are relative to.\n\n# But aren't there projects that do this already?\n\nI've looked at them, and I don't like the assumptions they make about top-level\nnames, stdlib, or namespace packages.  I think this project is more correct and\nmore self-contained.\n\n# Future work\n\n* Read project metadata instead of requirements\n* Ensure metadata and requirements match\n* Offer to add missing deps\n* Better handling of version-dependent deps in an `if` or `try`/`except`\n\n# License\n\ncheckdeps is copyright [Tim Hatch](https://timhatch.com/), and licensed under\nthe MIT license.  I am providing code in this repository to you under an open\nsource license.  This is my personal repository; the license you receive to\nmy code is from me and not from my employer. See the `LICENSE` file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Ensures your first-order deps are correct",
    "version": "0.9.0",
    "project_urls": {
        "Homepage": "https://github.com/python-packaging/checkdeps/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6394d80517af39ea2e7b079187f280dae12dbc8a6252a0860f7d0adbfb49b127",
                "md5": "c0eb8eafdb6746530280417d754f0e87",
                "sha256": "15cec29977a08bcc57d029307b4250b3f97f99aa45d932c8322b3cd0a4059c2f"
            },
            "downloads": -1,
            "filename": "checkdeps-0.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c0eb8eafdb6746530280417d754f0e87",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 13666,
            "upload_time": "2024-01-21T16:13:34",
            "upload_time_iso_8601": "2024-01-21T16:13:34.331713Z",
            "url": "https://files.pythonhosted.org/packages/63/94/d80517af39ea2e7b079187f280dae12dbc8a6252a0860f7d0adbfb49b127/checkdeps-0.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04fe318ee5fb06a9cc5e5e0c6d7a30bd961efd23ea5ba7c1f2068c8911f6ced4",
                "md5": "0f79c1694190e5f38c69e08a45e27857",
                "sha256": "b4382c1dbada0f5b7aa458402af4fa0003d3cb54c7c83cd2661d441e0c416973"
            },
            "downloads": -1,
            "filename": "checkdeps-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0f79c1694190e5f38c69e08a45e27857",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 12906,
            "upload_time": "2024-01-21T16:13:35",
            "upload_time_iso_8601": "2024-01-21T16:13:35.866594Z",
            "url": "https://files.pythonhosted.org/packages/04/fe/318ee5fb06a9cc5e5e0c6d7a30bd961efd23ea5ba7c1f2068c8911f6ced4/checkdeps-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-21 16:13:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "python-packaging",
    "github_project": "checkdeps",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "checkdeps"
}
        
Elapsed time: 0.50247s