Skip to content

Commit 4e5459b

Browse files
feat: add deptry tests for dependency analysis
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 969dec1 commit 4e5459b

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Dependency Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "airbyte_cdk/**"
9+
- "poetry.lock"
10+
- "pyproject.toml"
11+
pull_request:
12+
paths:
13+
- "airbyte_cdk/**"
14+
- "poetry.lock"
15+
- "pyproject.toml"
16+
17+
jobs:
18+
dependency-analysis:
19+
name: Dependency Analysis with Deptry
20+
runs-on: ubuntu-24.04
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.10'
28+
- name: Set up Poetry
29+
uses: Gr1N/setup-poetry@v9
30+
with:
31+
poetry-version: "2.0.1"
32+
- name: Install dependencies
33+
run: poetry install --all-extras
34+
35+
# Job-specific step(s):
36+
- name: Run Deptry
37+
run: |
38+
poetry run deptry .

pyproject.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ types-requests = "^2.32.0.20241016"
102102
types-python-dateutil = "^2.9.0.20241003"
103103
types-pyyaml = "^6.0.12.20240917"
104104
types-cachetools = "^5.5.0.20240820"
105+
deptry = "^0.23.0"
105106

106107
[tool.poetry.extras]
107108
file-based = ["avro", "fastavro", "pyarrow", "unstructured", "pdf2image", "pdfminer.six", "unstructured.pytesseract", "pytesseract", "markdown", "python-calamine", "python-snappy"]
@@ -196,3 +197,44 @@ optional_poetry_groups = ["dev"]
196197
poetry_extras = ["file-based", "vector-db-based"]
197198
poe_tasks = ["check-ci"]
198199
mount_docker_socket = true
200+
201+
[tool.deptry.per_rule_ignores]
202+
# This is a mapping of rules and package names to be ignored for that rule.
203+
DEP001 = [
204+
# Optional dependencies that might be imported conditionally
205+
"dagger", # Used in bin scripts but not a core dependency
206+
"source_declarative_manifest" # Used in tests but not a core dependency
207+
]
208+
DEP004 = [
209+
"pdoc", # Only used for generating documentation. Not a runtime dependency.
210+
"pytest", # Test dependencies
211+
"freezegun", # Test dependencies
212+
"requests_mock", # Test dependencies
213+
"_pytest", # Test dependencies
214+
"pympler" # Test dependencies
215+
]
216+
DEP002 = [
217+
# Dependencies that are imported indirectly through other packages
218+
"sqlalchemy", # Used through extras
219+
# Optional dependencies in extras
220+
"psutil",
221+
"rapidfuzz",
222+
"cohere",
223+
"markdown",
224+
"openai",
225+
"pdf2image",
226+
"pdfminer.six",
227+
"pytesseract",
228+
"python-calamine",
229+
"python-snappy",
230+
"tiktoken",
231+
"unstructured.pytesseract",
232+
"cryptography"
233+
]
234+
DEP003 = [
235+
# Transitive dependencies that are imported directly
236+
"typing_extensions", # Common transitive dependency
237+
"packaging", # Common transitive dependency
238+
"pydantic_core", # Pydantic internals
239+
"anyio" # Async dependency
240+
]

0 commit comments

Comments
 (0)