Skip to content

Commit

Permalink
added from typing import TYPE_CHECKING
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocontrerasmoreira committed Nov 14, 2024
1 parent b960e2d commit 688bb53
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 9 additions & 8 deletions repeats/AnnotRedRepeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@
# pyenv local 3.7.6
# pip install --user sqlalchemy==1.3.23 sqlalchemy_utils pymysql
#
# Copyright [2020-21] EMBL-European Bioinformatics Institute
# Copyright [2020-24] EMBL-European Bioinformatics Institute

import argparse
import os
import re
import errno
import subprocess

import sqlalchemy as db
import sqlalchemy_utils as db_utils
from typing import TYPE_CHECKING

# sqlalchemy requires MySQLdb but MySQLdb doesn't support Python 3.x
# pymysql can be imported and used instead
import pymysql

pymysql.install_as_MySQLdb()
if TYPE_CHECKING: # False at runtime
import sqlalchemy as db
import sqlalchemy_utils as db_utils
# sqlalchemy requires MySQLdb but MySQLdb doesn't support Python 3.x
# pymysql can be imported and used instead
import pymysql
pymysql.install_as_MySQLdb()


def fetch_repeats_FASTA(logpath, synpath, annotdir, minlen):
Expand Down
17 changes: 9 additions & 8 deletions repeats/Red2Ensembl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# pyenv local 3.7.6
# pip install --user sqlalchemy==1.3.23 sqlalchemy_utils pymysql
#
# Copyright [2020-22] EMBL-European Bioinformatics Institute
# Copyright [2020-24] EMBL-European Bioinformatics Institute

import argparse
import sys
Expand All @@ -19,14 +19,15 @@
import errno
import subprocess

import sqlalchemy as db
import sqlalchemy_utils as db_utils
from typing import TYPE_CHECKING

# sqlalchemy requires MySQLdb but MySQLdb doesn't support Python 3.x
# pymysql can be imported and used instead
import pymysql

pymysql.install_as_MySQLdb()
if TYPE_CHECKING: # False at runtime
import sqlalchemy as db
import sqlalchemy_utils as db_utils
# sqlalchemy requires MySQLdb but MySQLdb doesn't support Python 3.x
# pymysql can be imported and used instead
import pymysql
pymysql.install_as_MySQLdb()


def _is_gz_file(filepath):
Expand Down

0 comments on commit 688bb53

Please sign in to comment.