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

fix linter complaints, cleanup gha caching #160

Merged
merged 2 commits into from
Oct 9, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:

- name: Set up Python ${{ matrix.pyv }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.pyv }}
cache: pip
Expand All @@ -73,7 +74,7 @@ jobs:
uses: actions/cache@v4
with:
path: /home/runner/.nox
key: ${{ runner.os }}-${{ matrix.pyv }}-${{ hashFiles('noxfile.py') }}
key: ${{ runner.os }}-python-${{steps.setup-python.outputs.python-version }}-${{ hashFiles('noxfile.py') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some CI failures seemed to be caused by the fact that the cache was create for python 3.12.6 but actions were setting up the newly released 3.12.7.

Let's use the correct key by using the setup-python action's outputs


- name: Lint code and check dependencies
run: nox --envdir ~/.nox --reuse-venv=yes -v -s lint-${{ matrix.pyv }}
Expand Down
4 changes: 2 additions & 2 deletions src/vllm_tgis_adapter/grpc/grpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def _handle_exception(
*args: tuple[Any],
**kwargs: dict[str, Any],
) -> None:
context: ServicerContext = kwargs.get("context", None) or args[-1]
context: ServicerContext = kwargs.get("context") or args[-1]
is_generate_fn = "generate" in func.__name__.lower()

# self.engine on the servicer
Expand All @@ -133,7 +133,7 @@ async def _handle_exception(
error_message = context.details()
else:
error_message = str(e)
request = kwargs.get("request", None) or args[-2]
request = kwargs.get("request") or args[-2]
logs.log_error(
request=request,
exception_str=error_message,
Expand Down