Skip to content

Commit 513de89

Browse files
committed
deptry
1 parent df4bcfe commit 513de89

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/deptry.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This file is part of the tschm/.config-templates repository
2+
# (https://github.com/tschm/.config-templates).
3+
#
4+
# Workflow: Deptry
5+
#
6+
# Purpose: This workflow identifies missing and obsolete dependencies in the project.
7+
# It helps maintain a clean dependency tree by detecting unused packages and
8+
# implicit dependencies that should be explicitly declared.
9+
#
10+
# Trigger: This workflow runs on every push and on pull requests to main/master
11+
# branches (including from forks)
12+
13+
name: "DEPTRY"
14+
15+
# Permissions: Only read access to repository contents is needed
16+
permissions:
17+
contents: read
18+
19+
on:
20+
push:
21+
pull_request:
22+
branches: [ main, master ]
23+
24+
jobs:
25+
deptry_analysis:
26+
name: Check dependencies with deptry
27+
runs-on: ubuntu-latest
28+
container:
29+
image: ghcr.io/astral-sh/uv:0.9.5-python3.12-trixie
30+
31+
steps:
32+
- uses: actions/checkout@v5
33+
34+
- name: Run deptry
35+
run: |
36+
set -euo pipefail
37+
if [ -f "pyproject.toml" ]; then
38+
if [ -d "src" ]; then
39+
SOURCE_FOLDER="src"
40+
else
41+
SOURCE_FOLDER="."
42+
fi
43+
uvx deptry "$SOURCE_FOLDER"
44+
else
45+
printf "${YELLOW:-}[WARN] No pyproject.toml found, skipping deptry${RESET:-}\n"
46+
fi

0 commit comments

Comments
 (0)