File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments