Skip to content

Commit

Permalink
chore: small python linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ngruelaneo committed Apr 19, 2024
1 parent 7d14e6c commit 599ece4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
run: pip install "$(echo pkg/armonik*.whl)[dev]"

- name: Lint
run: python -m ruff .
run: python -m ruff check .

# - name: Check typing
# run: python -m mypy --exclude src/armonik/protogen/ src/
Expand Down
5 changes: 1 addition & 4 deletions packages/python/ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ fix = false
# Enable application of unsafe fixes.
unsafe-fixes = false

# Whether to show source code snippets when reporting lint violation.
show-source = false

# Enumerate all fixed violations.
show-fixes = true

# Disable preview features.
preview = false

# The minimum Python version targetted is Python 3.10.
target-version = "py310"
target-version = "py38"

# Allow imports relative to the "src/armonik" and "test" directories.
src = ["src/armonik", "test"]
Expand Down
8 changes: 6 additions & 2 deletions packages/python/src/armonik/client/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def __init__(self, grpc_channel: Channel):
def get_events(
self,
session_id: str,
event_types: Iterable[EventTypes], # TODO: make EventTypes an enum when Python 3.8 support will be not supported
event_types: Iterable[
EventTypes
], # TODO: make EventTypes an enum when Python 3.8 support will be not supported
event_handlers: List[Callable[[str, EventTypes, Event], bool]],
task_filter: Optional[Filter] = None,
result_filter: Optional[Filter] = None,
Expand All @@ -64,7 +66,9 @@ def get_events(
if task_filter:
request.tasks_filters = cast(rawTaskFilters, task_filter.to_disjunction().to_message())
if result_filter:
request.results_filters = cast(rawResultFilters, result_filter.to_disjunction().to_message())
request.results_filters = cast(
rawResultFilters, result_filter.to_disjunction().to_message()
)

streaming_call = self._client.GetEvents(request)
for message in streaming_call:
Expand Down
6 changes: 3 additions & 3 deletions packages/python/src/armonik/client/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def cancel_session(self, session_id: str) -> Session:
request = CancelSessionRequest(session_id=session_id)
response: CancelSessionResponse = self._client.CancelSession(request)
return Session.from_message(response.session)

def pause_session(self, session_id: str) -> Session:
"""Pause a session by its id.
Expand Down Expand Up @@ -215,7 +215,7 @@ def purge_session(self, session_id: str) -> Session:
Args:
session_id: Id of the session to be purged.
Returns:
session metadata
"""
Expand All @@ -236,7 +236,7 @@ def delete_session(self, session_id: str) -> Session:
response: DeleteSessionResponse = self._client.DeleteSession(request)
return Session.from_message(response.session)

def stop_submission_session(self, session_id: str, client: bool, worker:bool) -> Session:
def stop_submission_session(self, session_id: str, client: bool, worker: bool) -> Session:
"""Stops clients and/or workers from submitting new tasks in the given session.
Args:
Expand Down

0 comments on commit 599ece4

Please sign in to comment.