Skip to content

Commit c03666e

Browse files
using dev dependencies
1 parent f40459c commit c03666e

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

.github/workflows/build_test.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Build and test
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [main, master]
66
pull_request:
7-
branches: [main]
7+
branches: [main, master]
88

99
jobs:
1010
build:
@@ -13,7 +13,6 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
# Combined all environments into a single matrix job
1716
os: [ubuntu-latest, windows-latest, macos-latest]
1817
python-version: ["3.12"]
1918

@@ -30,30 +29,26 @@ jobs:
3029
run: uv python install ${{ matrix.python-version }}
3130

3231
- name: Install Project
33-
# 'uv sync' automatically manages the virtual environment for you.
34-
# We include dev dependencies for linting and testing.
32+
# This installs everything in [project.dependencies]
33+
# AND everything in [dependency-groups] dev.
3534
run: uv sync --all-extras --dev
3635

3736
- name: Lint with flake8
38-
# We use 'uv run' to execute commands in the synced environment.
39-
# This works consistently across Linux, Mac, and Windows.
37+
# We no longer need 'uv pip install flake8' here
4038
run: |
4139
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4240
uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4341
4442
- name: Test with pytest
4543
timeout-minutes: 12
44+
shell: bash
4645
run: |
47-
# If torchvision/torchinfo are not in your pyproject.toml,
48-
# you can install them on the fly like this:
49-
uv pip install torchvision torchinfo
50-
51-
# Run pytest logic based on OS
46+
# Pytest and torch libraries are now pre-installed via uv sync
5247
if [ "${{ matrix.os }}" = "macos-latest" ]; then
5348
uv run pytest --ignore tests/deeplearning/test_hitters.py --ignore tests/deeplearning/test_mnist.py
5449
else
5550
uv run pytest
5651
fi
57-
shell: bash # Using bash as a shell on all OSs (including Windows) makes if-statements easier
52+
5853
5954

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ requires = ["setuptools>=42",
8181
"setuptools_scm"
8282
]
8383
build-backend = "setuptools.build_meta"
84+
85+
[dependency-groups]
86+
dev = [
87+
"flake8>=7.3.0",
88+
"pytest>=9.0.2",
89+
"torchinfo>=1.8.0",
90+
"torchvision>=0.25.0",
91+
]

0 commit comments

Comments
 (0)