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

Review Pyright rule exceptions #1472

Open
17 tasks
victorlin opened this issue May 22, 2024 · 2 comments
Open
17 tasks

Review Pyright rule exceptions #1472

victorlin opened this issue May 22, 2024 · 2 comments

Comments

@victorlin
Copy link
Member

Pyright was added in #1246. The default Pyright configuration options result in many violations from Augur's code as-is. To allow incremental adoption of Pyright, all default rule violations were disabled.

Tasks

Go through each of these and either (1) decide to keep the exception or (2) remove the exception and fix all violations in the code.

  • reportArgumentType
  • reportAttributeAccessIssue
  • reportCallIssue
  • reportGeneralTypeIssues
  • reportIncompatibleMethodOverride
  • reportMissingImports
  • reportMissingModuleSource
  • reportOperatorIssue
  • reportOptionalIterable
  • reportOptionalMemberAccess
  • reportOptionalOperand
  • reportOptionalSubscript
  • reportPossiblyUnboundVariable
  • reportPrivateImportUsage
  • reportSelfClsParameterName
  • reportUndefinedVariable
  • reportUnusedExpression
@victorlin victorlin mentioned this issue May 22, 2024
4 tasks
@victorlin
Copy link
Member Author

From @jameshadfield in #1246 (comment):

I looked at a few of these - totally fine if we want to defer any and all to separate PRs beyond this one:

  • reportUnusedExpression - single failure, should fix
  • reportUndefinedVariable - single failure, already with a flake8 ignore comment
  • reportPrivateImportUsage - no failures
  • reportGeneralTypeIssues - 9 errors, but all seem worth fixing

@victorlin
Copy link
Member Author

reportPrivateImportUsage - no failures

I didn't get any errors locally but did in CI (noted in e5ced1c):

2024-05-17T00:31:30.1458148Z tests/test_pyright.py::test_pyright /home/runner/work/augur/augur/augur/clades.py
2024-05-17T00:31:30.1466206Z   /home/runner/work/augur/augur/augur/clades.py:328:18 - error: "read" is not exported from module "Bio.Phylo" (reportPrivateImportUsage)
…
2024-05-17T00:31:30.1553703Z 20 errors, 0 warnings, 0 informations 
2024-05-17T00:31:30.3631414Z FAILED

I now realize that it's specific to the Biopython version. Pyright passed in CI with biopython=1.80 but failed on latest (1.83).

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

No branches or pull requests

1 participant