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

Fixes a lot of the errors raised by ruff #275

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Psycojoker
Copy link
Collaborator

Ruff isn't running on this project for various reason and it raises a LOT of errors.

This PR fixes a good part of the errors but not all of them but all this improvements can already be merged so we can benefit from it.

Related ClickUp, GitHub or Jira tickets : ALEPH-127

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • All new code is covered by relevant tests.

@Psycojoker Psycojoker changed the title fix: run ruff --fix Fixes a lot of the errors raised by ruff Sep 25, 2024
@Psycojoker Psycojoker requested a review from hoh September 25, 2024 19:11
@Psycojoker Psycojoker mentioned this pull request Sep 25, 2024
Copy link

Failed to retrieve llama text: POST 504:

504 Gateway Time-out


The server didn't respond in time.

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 38.70968% with 38 lines in your changes missing coverage. Please review.

Project coverage is 38.31%. Comparing base (bc41292) to head (54cbee7).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/aleph_client/commands/instance/__init__.py 23.80% 16 Missing ⚠️
src/aleph_client/utils.py 0.00% 4 Missing ⚠️
src/aleph_client/commands/instance/display.py 40.00% 3 Missing ⚠️
src/aleph_client/commands/message.py 0.00% 3 Missing ⚠️
src/aleph_client/commands/utils.py 57.14% 3 Missing ⚠️
src/aleph_client/__init__.py 0.00% 2 Missing ⚠️
src/aleph_client/commands/aggregate.py 0.00% 2 Missing ⚠️
src/aleph_client/commands/domain.py 66.66% 2 Missing ⚠️
src/aleph_client/models.py 0.00% 2 Missing ⚠️
src/aleph_client/commands/program.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #275      +/-   ##
==========================================
- Coverage   38.56%   38.31%   -0.25%     
==========================================
  Files          18       18              
  Lines        1932     1939       +7     
  Branches      335      335              
==========================================
- Hits          745      743       -2     
- Misses       1151     1160       +9     
  Partials       36       36              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -695,17 +709,17 @@ async def list(
echo(messages.json(indent=4))
else:
# Since we filtered on message type, we can safely cast as InstanceMessage.
messages = cast(List[InstanceMessage], messages)
messages = cast(builtins.list[InstanceMessage], messages)
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if we should not update filter_only_valid_messages to use generics 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure it's in the scope of this PR? We probably want to use Sequence instead of list for it as a type anyway

@Psycojoker
Copy link
Collaborator Author

@hoh what version of python do we target? Right now it's stucked on 3.9 and some new notation aren't supported, I want to know if I need to revert them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants