mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-19 12:57:58 +00:00
Add workflow to prevent torch in main dependencies
- Checks pyproject.toml on every PR that modifies it - Fails loudly if torch is in main dependencies - Provides clear guidance on moving to optional deps
This commit is contained in:
parent
522e049d27
commit
f2d3060db6
1 changed files with 40 additions and 0 deletions
40
.github/workflows/check-no-torch.yml
vendored
Normal file
40
.github/workflows/check-no-torch.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Check No Torch in Main Dependencies
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'pyproject.toml'
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'pyproject.toml'
|
||||
|
||||
jobs:
|
||||
check-torch:
|
||||
runs-on: ubuntu-latest
|
||||
name: Ensure torch is not in main dependencies
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check pyproject.toml for torch in main dependencies
|
||||
run: |
|
||||
echo "🔍 Checking if torch is in main dependencies..."
|
||||
|
||||
# Check if torch appears in the main dependencies section
|
||||
if grep -A 50 '^\[project\]' pyproject.toml | grep -B 50 '^\[project.optional-dependencies\]\|^\[build-system\]\|^\[tool\]' | grep -E '^\s*"torch' | grep -v '^#'; then
|
||||
echo "❌ ERROR: torch found in main dependencies!"
|
||||
echo "🚨 TORCH SHOULD NOT BE IN MAIN DEPENDENCIES! 🚨"
|
||||
echo ""
|
||||
echo "Torch is a 2GB+ dependency that significantly slows down CI and installations."
|
||||
echo "Please move torch to optional dependencies (e.g., under 'rewardfns' or similar)."
|
||||
echo ""
|
||||
echo "Example fix in pyproject.toml:"
|
||||
echo "[project.optional-dependencies]"
|
||||
echo "rewardfns = ["
|
||||
echo ' "torch"'
|
||||
echo "]"
|
||||
exit 1
|
||||
else
|
||||
echo "✅ No torch found in main dependencies"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue