Skip to content

Commit

Permalink
ci ʘ‿ʘ
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich committed Jun 7, 2024
1 parent eb9da5a commit 27506c5
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--only=types --no-root"
poetry-export-options: "--only=types"
poetry-install-options: "--only=main --only=types --no-root"
poetry-export-options: "--only=main --only=types"

- name: Check types
run: poetry run mypy tesk/
Expand Down
6 changes: 6 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Global options:

[mypy]
plugins = pydantic.mypy
warn_return_any = True
warn_unused_configs = True

Expand All @@ -12,3 +13,8 @@ ignore_missing_imports = True

[mypy-foca]
ignore_missing_imports = True

[pydantic-mypy]
init_forbid_extra = True
init_typed = True
warn_required_dynamic_aliases = True
2 changes: 1 addition & 1 deletion poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ types-botocore = "^1.0.2"
types-requests = "^2.31.0.20240406"
types-urllib3 = "^1.26.25.14"
types-werkzeug = "^1.0.9"
types-pyyaml = "^6.0.12.20240311"

[tool.poetry.scripts]
api = 'tesk.app:main'
Expand Down
3 changes: 2 additions & 1 deletion tesk/api/ga4gh/tes/base/base_tesk_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ def response(self) -> dict:
dict: Serialized response for the specific endpoint.
"""
_response = self.api_response()
assert isinstance(_response, BaseModel)
if not isinstance(_response, BaseModel):
raise TypeError('API response must be a Pydantic model.')
return _response.dict()
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ def _hash_service_info_config(self) -> str:
Returns:
str: Hash of the service info configuration.
"""
if not self._service_info_present_in_config():
return ''
_service_info = self._get_service_info_present_in_config()
assert _service_info is not None
if _service_info is None:
return ''
_config_to_hash = _service_info.json().encode('utf-8')
return sha256(_config_to_hash).hexdigest()
10 changes: 6 additions & 4 deletions tesk/tesk_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@


# TODO: Maybe TeskApp should be a singleton, and extend the Foca class, so that
# we can have a single instance of the app, and we can access the configuration
# and other attributes from the instance itself. This way we can avoid passing
# the configuration file path to the Foca class, and we can have a single point
# of access to the configuration and other attributes.
# we can have a single instance of the app, and we can access the
# configuration and other attributes from the instance itself.
# This way we can avoid passing the configuration file path to the Foca class,
# and we can have a single point of access to the configuration and
# other attributes.


class TeskApp:
"""TESK API class."""
Expand Down

0 comments on commit 27506c5

Please sign in to comment.