Skip to content

Commit eaebf0f

Browse files
committed
test: Ensure pilot fails keep compaibility with Python 2.7
1 parent 7cd41f0 commit eaebf0f

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/basic.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,23 @@ jobs:
8888
${{ matrix.command }}
8989
env:
9090
REFERENCE_BRANCH: ${{ github['base_ref'] || github['head_ref'] }}
91+
92+
pylint-py27:
93+
name: Pylint for Python 2.7 in Pilot files
94+
runs-on: ubuntu-latest
95+
if: github.event_name != 'push' || github.repository == 'DIRACGrid/DIRAC'
96+
steps:
97+
- uses: actions/checkout@v2
98+
- name: Fail-fast for outdated pipelines
99+
run: .github/workflows/fail-fast.sh
100+
- name: prepare environment
101+
run: |
102+
conda config --set add_pip_as_python_dependency false
103+
conda create -c conda-forge -n test-env python=2.7 pylint=1.9.2 astroid=1.6.5
104+
- name: run pilot wrapper test
105+
run: |
106+
eval "$(conda shell.bash hook)" && conda activate test-env
107+
pylint -E \
108+
tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py \
109+
src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py \
110+
src/DIRAC/Resources/Computing/BatchSystems/*.py

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,23 @@ repos:
2222
rev: 22.1.0
2323
hooks:
2424
- id: black
25+
exclude: |
26+
(?x)^(
27+
src/DIRAC/Resources/Computing/BatchSystems/[^/]+.py|
28+
src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py|
29+
tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py
30+
)$
31+
32+
- repo: https://github.com/psf/black
33+
rev: 21.9b0
34+
hooks:
35+
- id: black
36+
name: black for files with Python 2.7 compatibility
37+
additional_dependencies: [".[python2]"]
38+
args: ["--target-version=py27"]
39+
files: |
40+
(?x)^(
41+
src/DIRAC/Resources/Computing/BatchSystems/[^/]+.py|
42+
src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py|
43+
tests/Integration/WorkloadManagementSystem/Test_GenerateAndExecutePilotWrapper.py
44+
)$

0 commit comments

Comments
 (0)