Skip to content

Commit 6f47700

Browse files
authored
Merge pull request #5885 from chrisburr/the-future-is-here
[8.0] Remove __future__ imports
2 parents 3f4c6e4 + eaebf0f commit 6f47700

File tree

624 files changed

+40
-2201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

624 files changed

+40
-2201
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+
)$

docs/diracdoctools/Config.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
"""Configuration for the documentation scripts."""
2-
from __future__ import absolute_import
3-
from __future__ import division
4-
from __future__ import print_function
5-
62
import os
73
import glob
84
import logging

docs/diracdoctools/CustomizedDocs/CustomDErrno.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"""Additional docstring for the DErrno module."""
2-
from __future__ import absolute_import
3-
from __future__ import division
4-
from __future__ import print_function
52

63

74
class CustomDErrno(object): # pylint: disable=too-few-public-methods

docs/diracdoctools/CustomizedDocs/CustomTransformation.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
"""Additional docstring for the Transformation module."""
2-
from __future__ import absolute_import
3-
from __future__ import division
4-
from __future__ import print_function
5-
62
import textwrap
73

84
MODULE = "DIRAC.TransformationSystem.Client.Transformation"

docs/diracdoctools/Utilities.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
"""Utilities used by the documentation scripts."""
2-
from __future__ import absolute_import
3-
from __future__ import division
4-
from __future__ import print_function
5-
6-
from __future__ import absolute_import
72

83
from builtins import open
94

docs/diracdoctools/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
44
Scripts to build code documentation, and also some mocking, etc.
55
"""
6-
from __future__ import absolute_import
7-
from __future__ import division
8-
from __future__ import print_function
9-
106
# list of packages that should be mocked in sphinx
117
# TODO: check if we can install more of these
128
DIRAC_DOC_MOCK_LIST = [

docs/diracdoctools/cmd/codeReference.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/usr/bin/env python
22
""" create rst files for documentation of DIRAC """
3-
4-
from __future__ import absolute_import
5-
from __future__ import division
6-
from __future__ import print_function
7-
83
import os
94
import shutil
105
import socket

docs/diracdoctools/cmd/commandReference.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/usr/bin/env python
22
"""Module to create command references for DIRAC."""
3-
from __future__ import absolute_import
4-
from __future__ import division
5-
from __future__ import print_function
6-
73
from concurrent.futures import ThreadPoolExecutor
84
import logging
95
import os

docs/diracdoctools/cmd/concatcfg.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#!/usr/bin/env python
22
"""script to concatenate the dirac.cfg file's Systems sections with the content of the ConfigTemplate.cfg files."""
3-
from __future__ import absolute_import
4-
from __future__ import division
5-
from __future__ import print_function
6-
73
from collections import OrderedDict
84
import logging
95
import os

0 commit comments

Comments
 (0)