Skip to content

Commit

Permalink
fix module resolution for pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Dec 6, 2023
1 parent a834672 commit 4134a5e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,6 @@ jobs:

- name: Run Tests
if: ${{ steps.check_tests.outputs.HAS_TEST_DIR == 'true' }}
run: pytest -vvv ${{ matrix.domain }}/tests
run: |
cd ${{ matrix.domain }}/notebooks
python -m pytest -vvv ../tests
2 changes: 1 addition & 1 deletion nlp/notebooks/nl2q_eval/query_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sys
from typing import Any, Dict, List, MutableMapping, Tuple

from typedefs import JSON
from nl2q_eval.MetricsClasses import (
ANNOTATION_TYPES,
DATA_TYPES,
Expand All @@ -23,6 +22,7 @@
SpanMeasures,
ValueMeasures
)
from typedefs import JSON


def eval_query(gold: JSON, test: JSON) -> (DataMeasures, SpanMeasures, AttributeMeasures, ValueMeasures):
Expand Down
2 changes: 1 addition & 1 deletion nlp/notebooks/nl2query/V1/Vars_values_textsearch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from textsearch import TextSearch

from nl2query.V1.vocab.Vocabulary import Vocabulary
from nl2query.NL2QueryInterface import (
LocationAnnotation,
NL2QueryInterface,
Expand All @@ -9,6 +8,7 @@
TargetAnnotation,
TemporalAnnotation
)
from nl2query.V1.vocab.Vocabulary import Vocabulary


class Vars_values_textsearch(NL2QueryInterface):
Expand Down
3 changes: 2 additions & 1 deletion nlp/notebooks/stac_wrapper/query_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from configparser import ConfigParser

import ipywidgets as widgets
from typedefs import JSON
from pystac_client import Client

from typedefs import JSON


class STAC_query_handler:
""" class to handle running a stac query"""
Expand Down
3 changes: 2 additions & 1 deletion nlp/tests/test_MetricsClasses.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import unittest

from tests import GOLD_FILE, TEST_FILE
from nl2q_eval.MetricsClasses import AttributeMeasures, DataMeasures, SpanMeasures, ValueMeasures
from nl2q_eval.query_eval import read_files

from ..tests import GOLD_FILE, TEST_FILE


class MetricsClassesTests(unittest.TestCase):

Expand Down
3 changes: 2 additions & 1 deletion nlp/tests/test_query_eval.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest

from tests import GOLD_FILE, TEST_FILE
from nl2q_eval.MetricsClasses import (
ANNOTATION_TYPES,
VALUE_TYPES,
Expand All @@ -11,6 +10,8 @@
)
from nl2q_eval.query_eval import global_stats, read_files

from ..tests import GOLD_FILE, TEST_FILE

annot_counts = {"property": 20, "location": 6, "tempex": 3, "target": 5, "global": 34}


Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ treat_all_comments_as_code = true
default_section = THIRDPARTY
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
extra_standard_library = posixpath,typing,typing_extensions
known_third_party = cornice_swagger,cwltool,cwt,docker,mock
known_first_party = nl2q_eval,nl2query,stac_wrapper,tests
known_third_party = docker,mock
known_first_party = nl2q_eval,nl2query,stac_wrapper,typedefs,tests
skip = *.egg*,build,env,src,venv,reports,node_modules

0 comments on commit 4134a5e

Please sign in to comment.