Skip to content

Commit

Permalink
chore: Check dependency issues with deptry (#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored May 8, 2024
1 parent 3d1d792 commit 9d0c08b
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- { session: tests, python-version: "3.12", os: "ubuntu-latest", sqlalchemy: "1" }
- { session: doctest, python-version: "3.12", os: "ubuntu-latest", sqlalchemy: "2" }
- { session: mypy, python-version: "3.12", os: "ubuntu-latest", sqlalchemy: "2" }
- { session: deps, python-version: "3.12", os: "ubuntu-latest", sqlalchemy: "2" }

steps:
- uses: actions/checkout@v4
Expand Down
8 changes: 8 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,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."""
Expand Down
26 changes: 25 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -221,6 +222,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"
Expand Down

0 comments on commit 9d0c08b

Please sign in to comment.