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
2 changes: 1 addition & 1 deletion .github/workflows/black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Black version
run: pdm run black --version
- name: Black check
run: pdm run black . --check
run: make black
12 changes: 8 additions & 4 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
python-version: '3.11'
- name: Python version
run: python --version
- name: Mypy installation
run: pip install --user mypy pydantic types-PyYAML
- name: Type checks
run: mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --ignore-missing-imports --disable-error-code attr-defined src/
- name: PDM installation
run: pip install --user pdm
- name: Install dependencies
run: pdm install
- name: Install devel dependencies
run: pdm install --group default,dev
- name: Python linter
run: make check-types
12 changes: 8 additions & 4 deletions .github/workflows/pydocstyle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
python-version: '3.11'
- name: Python version
run: python --version
- name: Pydocstyle install
run: pip install --user pydocstyle
- name: Python docstring checks
run: pydocstyle -v .
- name: PDM installation
run: pip install --user pdm
- name: Install dependencies
run: pdm install
- name: Install devel dependencies
run: pdm install --group default,dev
- name: Python linter
run: make docstyle
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Install devel dependencies
run: pdm install --group default,dev
- name: Python linter
run: pdm run pylint src
run: make pylint
2 changes: 1 addition & 1 deletion .github/workflows/pyright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
- name: Install devel dependencies
run: pdm install --group default,dev
- name: Run Pyright tests
run: pdm run pyright src
run: make pyright
15 changes: 12 additions & 3 deletions .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ jobs:
pull-requests: read
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: actions/setup-python@v5
with:
args: 'check . --per-file-ignores=tests/*:S101 --per-file-ignores=scripts/*:S101'

python-version: '3.11'
- name: Python version
run: python --version
- name: PDM installation
run: pip install --user pdm
- name: Install dependencies
run: pdm install
- name: Install devel dependencies
run: pdm install --group default,dev
- name: Python linter
run: make ruff
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test-integration: ## Run integration tests tests
COVERAGE_FILE="${ARTIFACT_DIR}/.coverage.integration" pdm run pytest tests/integration --cov=src --cov-report term-missing --cov-report "json:${ARTIFACT_DIR}/coverage_integration.json" --junit-xml="${ARTIFACT_DIR}/junit_integration.xml" --cov-fail-under=10

check-types: ## Checks type hints in sources
MYPYPATH=src pdm run mypy --namespace-packages --explicit-package-bases --strict --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs src
pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --ignore-missing-imports --disable-error-code attr-defined src/

security-check: ## Check the project for security issues
bandit -c pyproject.toml -r src tests
Expand All @@ -43,3 +43,25 @@ shellcheck: ## Run shellcheck
shellcheck --version
shellcheck -- */*.sh

black:
pdm run black --check .

pylint:
pdm run pylint src

pyright:
pdm run pyright src

docstyle:
pdm run pydocstyle -v .

ruff:
pdm run ruff check . --per-file-ignores=tests/*:S101 --per-file-ignores=scripts/*:S101

verify:
$(MAKE) black
$(MAKE) pylint
$(MAKE) pyright
$(MAKE) ruff
$(MAKE) docstyle
$(MAKE) check-types
95 changes: 94 additions & 1 deletion pdm.lock

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

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dev = [
"pytest-asyncio>=1.0.0",
"pyright>=1.1.401",
"pylint>=3.3.7",
"pydocstyle>=6.3.0",
"mypy>=1.16.0",
"types-PyYAML>=6.0.2",
"ruff>=0.11.13",
]

[tool.pytest.ini_options]
Expand All @@ -47,4 +51,5 @@ distribution = true
start = "pdm run make run"
test-unit = "pdm run make test-unit"
test-integration = "pdm run make test-integration"
verify = "pdm run make verify"

4 changes: 1 addition & 3 deletions src/app/endpoints/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ def retrieve_response(
stream=False,
)

return str(
response.output_message.content # pyright: ignore[reportAttributeAccessIssue]
)
return str(response.output_message.content) # type: ignore[union-attr]


def validate_attachments_metadata(attachments: list[Attachment]) -> None:
Expand Down