File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Linting Linux
2+
3+ on :
4+ pull_request :
5+
6+ jobs :
7+ linting :
8+ strategy :
9+ fail-fast : false
10+ matrix :
11+ os : [ubuntu-latest]
12+ python-version :
13+ - " 3.11"
14+
15+ name : linting
16+ runs-on : ${{ matrix.os }}
17+
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v3
21+
22+ - name : Set up Python
23+ uses : actions/setup-python@v4
24+ with :
25+ python-version : ${{ matrix.python-version }}
26+
27+ - name : Install flake8
28+ run : |
29+ python -m pip install flake8
30+
31+ - name : Check format without making corrections
32+ run : |
33+ flake8
Original file line number Diff line number Diff line change 11name : Unit Test Linux
22
33on :
4- push :
5- # pull_request:
4+ workflow_run :
5+ workflows : [Linting Linux]
6+ types :
7+ - completed
68
79jobs :
8- run-tests :
10+ unit-test :
911 strategy :
1012 fail-fast : false
1113 matrix :
1517
1618 name : unit-test
1719 runs-on : ${{ matrix.os }}
18- # runs-on: python:alpine
20+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
1921
2022 steps :
2123 - name : Checkout code
3739 - name : Run tests
3840 run : |
3941 python -m unittest discover -v
40-
Original file line number Diff line number Diff line change 1- # placeholder file to modularize (to package) .py files under the directory "funcs ", making the files importable.
1+ # placeholder file to modularize (to package) .py files under the directory "tests ", making the files importable.
Original file line number Diff line number Diff line change 11def sum (x : float , y : float ) -> float :
2- return x + y
2+ return x + y
Original file line number Diff line number Diff line change 1- annotated-types == 0.5.0
2- anyio == 3.7.1
3- fastapi == 0.101.1
4- idna == 3.4
5- numpy == 1.25.2
6- pandas == 2.0.3
7- pydantic == 2.3.0
8- pydantic_core == 2.6.3
9- python-dateutil == 2.8.2
10- pytz == 2023.3
11- six == 1.16.0
12- sniffio == 1.3.0
13- starlette == 0.27.0
14- typing_extensions == 4.7.1
15- tzdata == 2023.3
1+ flake8 == 6.1.0
2+ mccabe == 0.7.0
3+ pycodestyle == 2.11.0
4+ pyflakes == 3.1.0
Original file line number Diff line number Diff line change 1+ [flake8]
2+ max-line-length = 120
3+ exclude =
4+ .git,
5+ __pycache__,
6+ docs/source/conf.py,
7+ old,
8+ build,
9+ dist,
10+ venv
Original file line number Diff line number Diff line change 1- # placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.
1+ # placeholder file to modularize (to package) .py files under the directory "tests", making the files importable.
Original file line number Diff line number Diff line change 11import unittest
22from funcs import func
33
4+
45class Test (unittest .TestCase ):
56
67 def test_sum (self ):
7- self .assertEqual (func .sum (2 ,3 ), 5 )
8+ self .assertEqual (func .sum (2 , 3 ), 5 )
9+
810
911if __name__ == "__main__" :
10- unittest .main ()
12+ unittest .main ()
You can’t perform that action at this time.
0 commit comments