Skip to content

Commit

Permalink
fix typing error in python v3.9
Browse files Browse the repository at this point in the history
python v3.9 does not support "|", and `from __future__ import annotations` can solve this problem.
  • Loading branch information
CunliangGeng committed Mar 21, 2024
1 parent 6916378 commit 9de4fc2
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/nplinker/genomics/aa_pred.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# TODO This module is used in bgc.py, referenced in gcf.py and then in misc.py,
# NPLinker core business does not use it at all.

from __future__ import annotations
import argparse
from Bio import SeqIO

Expand Down
1 change: 1 addition & 0 deletions src/nplinker/genomics/antismash/antismash_downloader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os
import shutil
from os import PathLike
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import json
import re
import time
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/genomics/bigscape/runbigscape.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os
import subprocess
import sys
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/genomics/mibig/mibig_downloader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os
import shutil
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/metabolomics/gnps/gnps_annotation_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import csv
from os import PathLike
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/metabolomics/gnps/gnps_extractor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os
import zipfile
from os import PathLike
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/metabolomics/gnps/gnps_file_mapping_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import csv
from os import PathLike
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/metabolomics/gnps/gnps_format.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import zipfile
from enum import Enum
from enum import unique
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import csv
from os import PathLike
from nplinker.metabolomics.abc import MolecularFamilyLoaderBase
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/metabolomics/gnps/gnps_spectrum_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from os import PathLike
from pyteomics import mgf
from nplinker.logconfig import LogConfig
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/metabolomics/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import json
from os import PathLike
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/parsers/kcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import annotations
import json
import os
import re
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/scoring/linking/link_likelihood.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
from deprecated import deprecated
from nplinker.logconfig import LogConfig
from nplinker.scoring.linking.utils import calc_likelihood_matrix
Expand Down
1 change: 1 addition & 0 deletions src/nplinker/strain/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import json
from os import PathLike
from jsonschema import validate
Expand Down
1 change: 1 addition & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import os
import shutil
import tempfile
Expand Down

0 comments on commit 9de4fc2

Please sign in to comment.