Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ jobs:
shell: bash
if: matrix.task == 'check'
run: |
uv run pyright src test tools gmail
uv run pyright src tests tools gmail

- name: Run Format
shell: bash
if: matrix.task == 'format'
run: |
uv run black -tpy312 -tpy313 -tpy314 src test tools gmail demo --check
uv run black -tpy312 -tpy313 -tpy314 src tests tools gmail demo --check

- name: Login to Azure
if: matrix.task == 'test'
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ all: venv format check test build

.PHONY: format
format: venv
.venv/bin/isort src test tools gmail demo $(FLAGS)
.venv/bin/black -tpy312 -tpy313 -tpy314 src test tools gmail demo $(FLAGS)
.venv/bin/isort src tests tools gmail demo $(FLAGS)
.venv/bin/black -tpy312 -tpy313 -tpy314 src tests tools gmail demo $(FLAGS)

.PHONY: check
check: venv
.venv/bin/pyright --pythonpath .venv/bin/python src test tools gmail
.venv/bin/pyright --pythonpath .venv/bin/python src tests tools gmail

.PHONY: test
test: venv
Expand Down Expand Up @@ -88,7 +88,7 @@ help:
@echo "make all # venv, format, check, test, build"
@echo "make format # Run isort and black"
@echo "make check # Run pyright"
@echo "make test # Run pytest (tests are in test/)"
@echo "make test # Run pytest (tests are in tests/)"
@echo "make coverage # Run tests with coverage"
@echo "make build # Build the wheel (under dist/)"
@echo "make demo # python tools/query.py (interactive)"
Expand Down
6 changes: 3 additions & 3 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ goto help
:format
if not exist ".venv\" call make.bat venv
echo Formatting code...
.venv\Scripts\isort src test tools gmail demo
.venv\Scripts\black src test tools gmail demo
.venv\Scripts\isort src tests tools gmail demo
.venv\Scripts\black src tests tools gmail demo
goto end

:check
if not exist ".venv\" call make.bat venv
echo Running type checks...
.venv\Scripts\pyright --pythonpath .venv\Scripts\python src test tools gmail demo
.venv\Scripts\pyright --pythonpath .venv\Scripts\python src tests tools gmail demo
goto end

:test
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module-root = "src"

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
testpaths = ["test"]
testpaths = ["tests"]

[tool.pyright]
reportUnusedVariable = true
Expand All @@ -83,7 +83,7 @@ force_sort_within_sections = true

sections = ["FUTURE", "STDLIB", "THIRDPARTY", "AI", "FIRSTPARTY", "LOCALFOLDER"]
known_ai = ["mcp", "openai", "pydantic", "pydantic_ai", "tiktoken", "typechat"]
known_first_party = ["typeagent", "test", "tools", "gmail", "demo"]
known_first_party = ["typeagent", "tests", "tools", "gmail", "demo"]
known_local_folder = ["conftest"]

[dependency-groups]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions test/test_embeddings.py → tests/test/test_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
import openai

from typeagent.aitools.embeddings import AsyncEmbeddingModel
from conftest import embedding_model # type: ignore # Magic, prevents side effects of mocking
from conftest import FakeEmbeddings

from conftest import (
embedding_model, # type: ignore # Magic, prevents side effects of mocking
)
from conftest import (
FakeEmbeddings,
)


@pytest.mark.asyncio
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
)
from typeagent.transcripts.transcript_ingest import ingest_vtt_transcript

tests_dir = os.path.dirname(__file__)
root_dir = os.path.dirname(tests_dir)


@pytest.mark.asyncio
async def test_incremental_index_building():
Expand Down Expand Up @@ -141,8 +144,9 @@ async def test_incremental_index_with_vtt_files():
# First VTT file ingestion
print("\n=== Import first VTT file ===")
# Import the first transcript
DEFAULT_FILE = os.path.join(root_dir, "testdata", "Confuse-A-Cat.vtt")
transcript1 = await ingest_vtt_transcript(
"testdata/Confuse-A-Cat.vtt",
DEFAULT_FILE,
settings,
dbname=db_path,
)
Expand All @@ -165,8 +169,9 @@ async def test_incremental_index_with_vtt_files():
settings2.semantic_ref_index_settings.auto_extract_knowledge = False

# Ingest the second transcript
DEFAULT_FILE = os.path.join(root_dir, "testdata", "Parrot_Sketch.vtt")
transcript2 = await ingest_vtt_transcript(
"testdata/Parrot_Sketch.vtt",
DEFAULT_FILE,
settings2,
dbname=db_path,
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion test/test_podcasts.py → tests/test/test_podcasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
from typeagent.podcasts import podcast_ingest
from typeagent.podcasts.podcast import Podcast

tests_dir = os.path.dirname(__file__)
root_dir = os.path.dirname(tests_dir)
DEFAULT_FILE = os.path.join(root_dir, "testdata", "FakePodcast.txt")


@pytest.mark.asyncio
async def test_ingest_podcast(
Expand All @@ -21,7 +25,7 @@ async def test_ingest_podcast(
# Import the podcast
settings = ConversationSettings(embedding_model)
pod = await podcast_ingest.ingest_podcast(
"testdata/FakePodcast.txt",
DEFAULT_FILE,
settings,
None,
Datetime.now(timezone.utc), # Use timezone-aware datetime
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading