From 01ff75e1c34aab1c679df8c9c32b6c334c40330f Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Thu, 4 Jan 2024 16:04:49 -0500 Subject: [PATCH] fix: fix coverage issues and grepping for slow imports --- .github/workflows/tests.yml | 2 +- g2p/constants.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b71d686..bcca2a3f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -56,7 +56,7 @@ jobs: echo "CLI load time: $CLI_LOAD_TIME" > import-message.txt echo "PR head ${{ github.event.pull_request.head.sha }}" >> import-message.txt echo "Imports that take more than 0.1 s:" >> import-message.txt - grep -E 'cumulative|[0-9]{6}' importtime.txt >> import-message.txt + grep -E 'cumulative|[0-9]{6} ' importtime.txt >> import-message.txt if [[ "$CLI_LOAD_TIME" > "0:01.00" ]]; then \ echo "ERROR: g2p --help is too slow."; \ echo "Please run 'PYTHONPROFILEIMPORTTIME=1 g2p -h 2> importtime.txt; tuna importtime.txt' and tuck away expensive imports so that the CLI doesn't load them until it uses them."; \ diff --git a/g2p/constants.py b/g2p/constants.py index 498d07b4..a84ef148 100644 --- a/g2p/constants.py +++ b/g2p/constants.py @@ -23,7 +23,7 @@ class BaseTransducer(ABC): @abstractmethod def __call__(self, to_convert: str): - pass + """Transduce to_convert.""" class BaseTransductionGraph(ABC): @@ -32,7 +32,7 @@ class BaseTransductionGraph(ABC): @property @abstractmethod def tiers(self): - pass + """A list of BaseTransductionGraph objects for each tier in the graph.""" class BaseTokenizer(ABC): @@ -40,4 +40,4 @@ class BaseTokenizer(ABC): @abstractmethod def tokenize_text(self, text): - pass + """Tokenize text."""