Reem commited on
Commit
c82d419
·
1 Parent(s): ae31fa6
.github/workflows/push_to_hf_space.yml CHANGED
@@ -30,19 +30,25 @@ jobs:
30
  - name: Install dependencies
31
  run: |
32
  pip install --upgrade pip
33
- pip install flake8
34
 
35
  # -------------------------
36
- # 3. Linting (QUALITY GATE)
37
- # Pipeline FAILS if lint fails
38
  # -------------------------
39
- - name: Run linting
40
  run: |
41
  flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42
 
43
  # -------------------------
44
- # 4. Block problematic files (pdf/xlsx)
45
- # Prevents HuggingFace sync crashes
 
 
 
 
 
 
 
46
  # -------------------------
47
  - name: Check for restricted file types
48
  run: |
@@ -51,25 +57,22 @@ jobs:
51
  exit 1
52
  fi
53
 
 
 
54
  # -------------------------
55
- # 5. Placeholder for unit tests
56
- # (does NOT fail pipeline yet)
57
- # Replace later with pytest
58
- # -------------------------
59
- - name: Run unit tests (placeholder)
60
- run: |
61
- echo "No tests implemented yet — placeholder step."
62
- echo "This will later run pytest."
 
 
63
 
64
- # this is the completed test step
65
- # - name: Run unit tests
66
- # run: |
67
- # pip install pytest
68
- # pytest A4/ -v --tb=short
69
-
70
  # -------------------------
71
- # 6. Push to HuggingFace
72
- # ONLY runs if lint passes
73
  # -------------------------
74
  - name: Push to hub
75
  env:
 
30
  - name: Install dependencies
31
  run: |
32
  pip install --upgrade pip
33
+ pip install flake8 nbqa
34
 
35
  # -------------------------
36
+ # 3. Lint Python files
 
37
  # -------------------------
38
+ - name: Lint .py files
39
  run: |
40
  flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
41
 
42
  # -------------------------
43
+ # 4. Lint notebooks with nbQA
44
+ # This checks .ipynb files
45
+ # -------------------------
46
+ - name: Lint notebooks
47
+ run: |
48
+ nbqa flake8 .
49
+
50
+ # -------------------------
51
+ # 5. Block problematic files
52
  # -------------------------
53
  - name: Check for restricted file types
54
  run: |
 
57
  exit 1
58
  fi
59
 
60
+ # -------------------------
61
+ # 6. Placeholder for unit tests
62
  # -------------------------
63
+ # - name: Run unit tests (placeholder)
64
+ # run: |
65
+ # echo "No tests implemented yet — placeholder step."
66
+ # echo "This will later run pytest."
67
+
68
+ # this is the completed test step
69
+ - name: Run unit tests
70
+ run: |
71
+ pip install pytest
72
+ pytest A4/ -v --tb=short
73
 
 
 
 
 
 
 
74
  # -------------------------
75
+ # 7. Push to HuggingFace
 
76
  # -------------------------
77
  - name: Push to hub
78
  env:
config.flake8 ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ [flake8]
2
+ max-line-length = 100
3
+ extend-ignore = E203, W503, E402
4
+