Skip to content

Commit cce8562

Browse files
committed
Provide requirements file and update linting workflow to use (pins linting tool versions).
1 parent c5f4e46 commit cce8562

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.github/workflows/linting.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,15 @@ jobs:
3535
- name: Install Dependencies
3636
run: |
3737
python -m pip install --upgrade pip
38-
python -m venv ftorch
39-
. ftorch/bin/activate
38+
python -m venv ftorch_venv
39+
. ftorch_venv/bin/activate
4040
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
41-
pip install fortitude-lint
42-
pip install ruff
41+
pip install -r requirements.txt
4342
4443
# Run CMake build to get compile commands for clang
4544
- name: FTorch CMake
4645
run: |
47-
. ftorch/bin/activate
46+
. ftorch_venv/bin/activate
4847
export FT_DIR=$(pwd)
4948
VN=$(python -c "import sys; print('.'.join(sys.version.split('.')[:2]))")
5049
export Torch_DIR=${VIRTUAL_ENV}/lib/python${VN}/site-packages
@@ -59,7 +58,7 @@ jobs:
5958
if: always()
6059
run: |
6160
cd ${{ github.workspace }}
62-
. ftorch/bin/activate # Uses .clang-tidy config file if present
61+
. ftorch_venv/bin/activate # Uses .clang-tidy config file if present
6362
fortitude check src/
6463
6564
# Apply C++ and C linter and formatter, clang
@@ -86,13 +85,13 @@ jobs:
8685
if: always()
8786
run: |
8887
cd ${{ github.workspace }}
89-
. ftorch/bin/activate
88+
. ftorch_venv/bin/activate
9089
fortitude check examples
9190
9291
- name: ruff
9392
if: always()
9493
run: |
9594
cd ${{ github.workspace }}
96-
. ftorch/bin/activate
95+
. ftorch_venv/bin/activate
9796
ruff format --diff ./
9897
ruff check --diff ./

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ venv/
157157
ENV/
158158
env.bak/
159159
venv.bak/
160+
ftorch_venv/
160161

161162
# Spyder project settings
162163
.spyderproject

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ruff==0.7.3
2+
fortitude-lint
3+
clang-format==19.1.3
4+
clang-tidy==19.1.0

0 commit comments

Comments
 (0)