diff --git a/noxfile.py b/noxfile.py index b7730b43ff..0b50d37cf6 100644 --- a/noxfile.py +++ b/noxfile.py @@ -121,6 +121,14 @@ def benches(session: Session) -> None: ) +@session(name="deps", python=python_versions) +def dependencies(session: Session) -> None: + """Check issues with dependencies.""" + session.install(".[s3,testing]") + session.install("deptry") + session.run("deptry", "singer_sdk", *session.posargs) + + @session(python=main_python_version) def update_snapshots(session: Session) -> None: """Update pytest snapshots.""" diff --git a/poetry.lock b/poetry.lock index 144a62dc9b..451faed9f7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -519,6 +519,30 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["certifi", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] +[[package]] +name = "deptry" +version = "0.16.1" +description = "A command line utility to check for unused, missing and transitive dependencies in a Python project." +optional = false +python-versions = ">=3.8" +files = [ + {file = "deptry-0.16.1-cp38-abi3-macosx_10_12_x86_64.whl", hash = "sha256:29ed8ae61b8f5664dd484717c79eef7ec66d965940efd828fca0d3c09220a1db"}, + {file = "deptry-0.16.1-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:738a772b538f51e9a7bb8d5cb9a61cfea8794a79371d171919b01cff0dc895bf"}, + {file = "deptry-0.16.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56b78f7c860def8000e93f88345a24809f1b91e2f7836ac9a08285cb405e2762"}, + {file = "deptry-0.16.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3e86a04ea87ddece0f68ba204feb950f588205808c8320e6628300f03ff66dc"}, + {file = "deptry-0.16.1-cp38-abi3-win_amd64.whl", hash = "sha256:01b5098739a56c93f3e1e40efec5f20452f22a9a8436a59809d46201fcb94bcf"}, + {file = "deptry-0.16.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7e29dc4c1bbb933c9482e8cef85fafe2be7f46aeb90a8a07ba5f2b22af60876f"}, + {file = "deptry-0.16.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8dfab68c247566c87a40f55f405be8549ffe4cea0b9b5384b7ae73a6f1d5cd1"}, + {file = "deptry-0.16.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1228493926b6e59cd2df7cb6016e10c255553cc31db24edcf7fc8d5474b81be6"}, + {file = "deptry-0.16.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:99c3ac60b78ad1b8fb9844c25393e7ebc969cc950601ce3c050f56d196da5a79"}, + {file = "deptry-0.16.1.tar.gz", hash = "sha256:39fb62da4a8f4d17ed282310f7bcaadec55a95a8c471b01e0fcdf5351a7ac323"}, +] + +[package.dependencies] +click = ">=8.0.0,<9" +colorama = {version = ">=0.4.6", markers = "sys_platform == \"win32\""} +tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} + [[package]] name = "docutils" version = "0.20.1" @@ -2644,4 +2668,4 @@ testing = ["pytest", "pytest-durations"] [metadata] lock-version = "2.0" python-versions = ">=3.8" -content-hash = "fb53e23587b43db9d5dcf2150b7d6d8c4c21cb0104afba8f0fc8da803e08e730" +content-hash = "73a1b66976e6a559796c566916561f3df254ccf756e834af58b59a45d36d0015" diff --git a/pyproject.toml b/pyproject.toml index 2ece8c6196..6e353beb68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,6 +118,7 @@ faker = ["faker"] [tool.poetry.group.dev.dependencies] coverage = {extras = ["toml"], version = ">=7.4"} +deptry = ">=0.15.0" # TODO: Remove the Python 3.12 marker when DuckDB supports it duckdb = { version = ">=0.8.0", python = "<3.12" } @@ -219,6 +220,43 @@ exclude_also = [ fail_under = 82 show_missing = true +[tool.deptry] +known_first_party = ["singer_sdk"] +pep621_dev_dependency_groups = ["testing"] + +[tool.deptry.package_module_name_map] +backports-datetime-fromisoformat = "backports" +importlib-metadata = "importlib_metadata" +importlib-resources = "importlib_resources" +PyJWT = "jwt" +types-jsonschema = "jsonschema" +types-pytz = "pytz" +types-PyYAML = "yaml" +types-requests = "requests" + +[tool.deptry.per_rule_ignores] +DEP002 = [ + # Deprecated dependencies + "python-dateutil", + # Transitive constraints + "numpy", + "urllib3", + # Python version-specific dependencies + "backports-datetime-fromisoformat", + # Docs extras + "furo", + "myst-parser", + "sphinx", + "sphinx-autobuild", + "sphinx-copybutton", + "sphinx-inline-tabs", + "sphinx-notfound-page", + "sphinx-reredirects", + # Plugins + "fs-s3fs", + "pytest-durations", +] + [tool.mypy] exclude = "tests" files = "singer_sdk"