Skip to content

Commit

Permalink
remove async
Browse files Browse the repository at this point in the history
  • Loading branch information
mshannon-sil committed Aug 20, 2024
1 parent fcad321 commit 463dc5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 39 deletions.
31 changes: 1 addition & 30 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ json-stream = "^1.3.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.2"
pytest-asyncio = "0.23.8"
black = "^24.1.1" # match the vscode extension
flake8 = "^7.0.0"
isort = "^5.9.3"
Expand All @@ -83,7 +82,6 @@ pandas = "^2.0.3"
pyright = "^1.1.362"
decoy = "^2.1.0"
pep8-naming = "^0.14.1"
aiofiles = "^24.1.0"

[tool.poetry.group.gpu.dependencies]
# Torch is not included in the normal install to allow the user to choose the versions of these dependencies when
Expand Down
12 changes: 5 additions & 7 deletions tests/corpora/test_usfm_manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pathlib import Path
from typing import List, Tuple

import aiofiles
import pytest
from testutils.corpora_test_helpers import TEST_DATA_PATH, USFM_SOURCE_PROJECT_PATH, USFM_TARGET_PROJECT_PATH

Expand Down Expand Up @@ -48,16 +47,15 @@ def __post_init__(self):


@pytest.mark.skip(reason="This is for manual testing only. Remove this decorator to run the test.")
@pytest.mark.asyncio
async def test_create_usfm_file():
def test_create_usfm_file():
parser = FileParatextProjectSettingsParser(PARATEXT_PROJECT_PATH)
settings: ParatextProjectSettings = parser.parse()

# Read text from pretranslations file
async with aiofiles.open(PRETRANSLATION_PATH, mode="r") as pretranslation_stream:
with open(PRETRANSLATION_PATH, mode="r") as pretranslation_stream:
pretranslations_dto: List[PretranslationDto] = [
PretranslationDto(text_id=item["textId"], refs=item["refs"], translation=item["translation"])
for item in json.loads(await pretranslation_stream.read())
for item in json.loads(pretranslation_stream.read())
]

pretranslations: List[Tuple[List[ScriptureRef], str]] = [
Expand All @@ -71,8 +69,8 @@ async def test_create_usfm_file():
for sfm_file_name in Path(PARATEXT_PROJECT_PATH).rglob(f"{settings.file_name_prefix}*{settings.file_name_suffix}"):
updater = UsfmTextUpdater(pretranslations, strip_all_text=True, prefer_existing_text=True)

async with aiofiles.open(sfm_file_name, mode="r") as sfm_file:
usfm: str = await sfm_file.read()
with open(sfm_file_name, mode="r") as sfm_file:
usfm: str = sfm_file.read()

parse_usfm(usfm, updater, settings.stylesheet, settings.versification)
new_usfm: str = updater.get_usfm(settings.stylesheet)
Expand Down

0 comments on commit 463dc5c

Please sign in to comment.