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 unbound variables #609

Merged

Conversation

janjagusch
Copy link
Collaborator

@janjagusch janjagusch commented Feb 18, 2023

Depends on #607
Closes #606

This is a first attempt to fix all possibly unbound variables in the code. I've decided to use the most straightforward fix I could think of. But I feel like some of the code has structural problems and that a refactoring might be in order.

@janjagusch janjagusch changed the title Pyright enable report unbound variable Enable Pyright reportUnboundVariable Feb 18, 2023
@@ -142,7 +142,7 @@ def test_repodata_zchunk(
with open('repodata.json') as f:
repodata_unzck = f.read()

assert repodata == repodata_unzck # NOQA
assert repodata == repodata_unzck # NOQA # type: ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems utterly broken. The repodata variable isn't defined anywhere. Do we run the plugin tests in CI?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We do, i can check this tomorrow 👍🏼

Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably the if branch is never run, and the else branch doesn't contain any asserts 🤷🏼‍♂️

Comment on lines +864 to +866
version_order = (
v.version_order if is_newer else v.version_order + 1 # type: ignore
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This needs to be improved.

@janjagusch janjagusch added the bug Something isn't working label Feb 18, 2023
@janjagusch janjagusch changed the title Enable Pyright reportUnboundVariable Enable pyright reportUnboundVariable Feb 18, 2023
@janjagusch janjagusch changed the title Enable pyright reportUnboundVariable Fix unbound variables Feb 20, 2023
@janjagusch janjagusch marked this pull request as ready for review February 20, 2023 11:37
@codecov-commenter
Copy link

Codecov Report

Base: 82.46% // Head: 81.50% // Decreases project coverage by -0.97% ⚠️

Coverage data is based on head (b82bdf6) compared to base (e0eeb5b).
Patch coverage: 58.33% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #609      +/-   ##
==========================================
- Coverage   82.46%   81.50%   -0.97%     
==========================================
  Files          78       78              
  Lines        6085     6104      +19     
==========================================
- Hits         5018     4975      -43     
- Misses       1067     1129      +62     
Impacted Files Coverage Δ
quetz/cli.py 74.83% <0.00%> (-0.25%) ⬇️
quetz/tasks/indexing.py 91.50% <0.00%> (-0.61%) ⬇️
quetz/pkgstores.py 42.54% <33.33%> (-11.69%) ⬇️
quetz/utils.py 81.86% <37.50%> (-2.04%) ⬇️
quetz/authentication/auth_dao.py 90.32% <100.00%> (+0.32%) ⬆️
quetz/config.py 90.20% <100.00%> (+0.05%) ⬆️
quetz/dao.py 89.18% <100.00%> (+0.02%) ⬆️
quetz/jobs/runner.py 89.65% <100.00%> (+0.04%) ⬆️
quetz/tasks/mirror.py 90.62% <100.00%> (+0.03%) ⬆️
quetz/testing/fixtures.py 95.67% <100.00%> (+0.02%) ⬆️
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@janjagusch janjagusch merged commit daa8d07 into mamba-org:main Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First level attribute can be unbound
3 participants