Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #3

Merged
merged 7 commits into from
Nov 21, 2023
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
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
source = privatellm

[report]
exclude_lines =
pragma: no cover
@abstractmethod
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ files
apikey.txt
**/__pycache__
db

.coverage
.vscode/
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
fail_fast: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love that!

repos:
- repo: local
hooks:
- id: format-check
name: make format-check
entry: make format-check
language: system
pass_filenames: false
always_run: true
- id: lint
name: make lint
entry: make lint
language: system
pass_filenames: false
always_run: true
- id: mypy
name: make mypy
entry: make mypy
language: system
pass_filenames: false
always_run: true
- id: test
name: make test
entry: make test
language: system
pass_filenames: false
always_run: true
38 changes: 38 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
init:
poetry install
pre-commit install

format:
poetry run ruff format .
poetry run ruff . --fix

format-check:
poetry run ruff format . --check

lint:
poetry run ruff .

mypy:
poetry run mypy --install-types --non-interactive .


test:
poetry run pytest -vv -s --typeguard-packages=privatellm

coverage:
poetry run coverage run -m pytest
poetry run coverage html
poetry run coverage report

checks: format-check lint mypy test

image:
DOCKER_BUILDKIT=1 docker build --progress=plain -t texttitan:latest .

docs:
mkdocs serve

update:
poetry lock

.PHONY: init format format-check lint mypy test coverage checks image docs update
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ hacked during codecamp 2023.
# install dependencies
poetry install

# start postgres vectorstore
# start postgres vectorstore and jaeger trace collector
docker compose up -d
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4317"

# run texttitan
poetry run python privatellm/main.py
Expand Down
26 changes: 26 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[mypy]
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True
disallow_any_generics = True
disallow_subclassing_any = True

warn_return_any = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_unused_configs = True

ignore_missing_imports = True
follow_imports = silent
exclude = (?x)(
build/lib/*/*
| tests/*
| venv/Scripts/*
| venv/bin/*
)



[mypy-tests.*]
ignore_errors = True
768 changes: 422 additions & 346 deletions poetry.lock

Large diffs are not rendered by default.

Loading