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

2348 Pyright #2349

Merged
merged 24 commits into from
Nov 14, 2024
Merged

2348 Pyright #2349

merged 24 commits into from
Nov 14, 2024

Conversation

JackEAllen
Copy link
Collaborator

@JackEAllen JackEAllen commented Oct 22, 2024

Issue

Closes #2348

Description

Add a description of the changes made.

  • Add pyright as a dependancy to the project
  • Add Pyright to conda and windows workflows
  • Add Pyright pre-commit check to project
  • Configure basic ruleset so Pyright does not initially overwhelm us with too many warnings
  • Resolve some of the basic Pyright issues blagged up in the basic configuration to get us started with refactorign the project to be Pyright compliant.

This PR once merged in, provides a good starting point to begin disabling rules currently set to false within pyproject.toml to eventually allow for the typeChecking mode to be increased from "basic" to "Standard" and eventually to "strict".

Testing

Describe the tests that were used to verify your changes.

  • Tested workflows fail if Pyright issues exist within the project
  • Tested pre-commit fails if Pyright issues exist in any staged files.
  • Tested Mantid Imaging basic Workflows
  • Ran unit tests

Acceptance Criteria

How should the reviewer test your changes?

  • Rebuilding a developer environmnet inlcudes Pyright in the list of dependancies
  • Conda and Windows Pyright workflows will fail if a Pyright issue exists in the project
  • Pyright pre-commit check will block a commit if any of the staged files do not pass Pyright checks
  • Mantid Imaging still performs as expected:
    • Run through operations, reconstructions and test spectrum viewer all still work as expected.

Documentation

How have you changed the documentation to reflect your changes? All changes should be noted in the appropriate file in docs/release_notes

See docs/release_notes/next/dev-2348-Pyright

@coveralls
Copy link

coveralls commented Oct 22, 2024

Coverage Status

coverage: 74.22% (-0.04%) from 74.259%
when pulling 3b1c28f on 2348_pyright
into fa4fb94 on main.

@JackEAllen JackEAllen force-pushed the 2348_pyright branch 3 times, most recently from d17ac55 to 29b23a2 Compare November 1, 2024 12:07
@JackEAllen JackEAllen force-pushed the 2348_pyright branch 2 times, most recently from cd99f30 to 3c4aaaa Compare November 1, 2024 13:42
@JackEAllen JackEAllen self-assigned this Nov 1, 2024
@JackEAllen JackEAllen added dependencies Pull requests that update a dependency file cleanup labels Nov 1, 2024
@JackEAllen JackEAllen marked this pull request as ready for review November 1, 2024 14:25
Operator 'in' not supported for types 'Literal['deg']' and Empty | ndarray[Any, dtype[Unknown]] | ndarray[Any, dtype[float64]]
error:  is not iterable   method not defined (reportGeneralTypeIssues)
Resolve Pyright reportSelfClsParameterName by simplifying how linux memory is returned by get_memory_usage_linux() and replacing cls with self where applicable
error: Operator '//' not supported for 'None'
error: Type 'Unknown | None' is not assignable to declared type 'ImageStack'
Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

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

Thanks. A good set of improvements.

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Nov 14, 2024
Merged via the queue into main with commit 507d6e8 Nov 14, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the 2348_pyright branch November 14, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Pyright Implementation
3 participants