Skip to content

Commit fc96653

Browse files
committed
Update python-package.yml
1 parent 6c8c725 commit fc96653

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

.github/workflows/python-package.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,16 @@ jobs:
3232
python -m pip install pytest
3333
pip install -r requirements.txt
3434
35-
if [ "${{ matrix.os }}" == "windows-latest" ]; then
36-
FOR /F "tokens=1,2 delims=," %%G IN ('python -c "import sys; print(sys.version_info[0:2])"') DO (
37-
IF "%%G"=="3" IF "%%H"=="7" (
38-
pip install "flake8>=5,<6"
39-
) ELSE (
40-
pip install flake8
41-
)
42-
)
35+
if [ "$RUNNER_OS" == "Windows" ]; then
36+
set PY_VERSION=%PYTHON_VERSION:~-3%
4337
else
44-
if [[ $(python -c "import sys; print(sys.version_info[0:2])") == "(3, 7)" ]]; then
45-
pip install "flake8>=5,<6"
46-
else
47-
pip install flake8
48-
fi
38+
PY_VERSION=$(python -c "import platform; print(platform.python_version()[:3])")
39+
fi
40+
41+
if [[ "$PY_VERSION" == "3.7" ]]; then
42+
pip install "flake8>=5,<6"
43+
else
44+
pip install flake8
4945
fi
5046
- name: Install the package locally
5147
run: pip install -e .

0 commit comments

Comments
 (0)