Skip to content

Conversation

@ogenstad
Copy link
Contributor

Upgrade ruff and fix an issue with ruff rule: RUF031 [*] Avoid parentheses for tuples in subscripts.

This is mostly to fix an issue related to python SDK being on an earlier version compared to infrahub server.

So in the server code we'd get:

❯ ruff check .
python_sdk/infrahub_sdk/transfer/exporter/json.py:57:55: RUF031 [*] Avoid parentheses for tuples in subscripts.
   |
55 |                     # Record the relationship only if it's not known in one way or another
56 |                     if not forward and not backward:
57 |                         many_relationship_identifiers[(node_schema.kind, relationship.peer)] = relationship.identifier
   |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF031
58 |
59 |         return many_relationship_identifiers
   |
   = help: Remove the parentheses.

Found 1 error.
[*] 1 fixable with the `--fix` option.

I think it's because RUF031 probably didn't exist in ruff 0.5.0 so it was not disabled in the SDK config.

We could also disable checking within the SDK directory from the main project but I think it's quite convenient to be able to have everything in one command when working against both code bases.

@github-actions github-actions bot added the group/ci Issue related to the CI pipeline label Oct 26, 2024
@codecov
Copy link

codecov bot commented Oct 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
infrahub_sdk/transfer/exporter/json.py 0.00% 1 Missing ⚠️
@@           Coverage Diff            @@
##           develop     #108   +/-   ##
========================================
  Coverage    64.27%   64.27%           
========================================
  Files           74       74           
  Lines         6856     6856           
  Branches      1355     1355           
========================================
  Hits          4407     4407           
  Misses        2098     2098           
  Partials       351      351           
Flag Coverage Δ
python-3.10 43.26% <0.00%> (ø)
python-3.11 43.26% <0.00%> (ø)
python-3.12 43.26% <0.00%> (ø)
python-3.9 43.20% <0.00%> (ø)
python-filler-3.12 23.89% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
infrahub_sdk/transfer/exporter/json.py 19.79% <0.00%> (ø)

@ogenstad ogenstad marked this pull request as ready for review October 26, 2024 09:47
@ogenstad ogenstad requested a review from a team October 26, 2024 09:47
@ogenstad ogenstad merged commit 5bbb22d into develop Oct 26, 2024
12 checks passed
@ogenstad ogenstad deleted the pog-upgrade-ruff branch October 26, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/ci Issue related to the CI pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants