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

FLASH PR - Pin Pyright Version to 1.1.391 #2461

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

JackEAllen
Copy link
Collaborator

@JackEAllen JackEAllen commented Jan 17, 2025

Issue

FLASH PR

Description

Pinning version of Pyright to version 1.1.391 as the most recent version of pyright published, 1.1.392 picks up the following two errors reportGeneralTypeIssues's:

mantidimaging/gui/windows/live_viewer/presenter.py
  mantidimaging/gui/windows/live_viewer/presenter.py:122:18 - error: Object of type "NoReturn" cannot be used with "with" because it does not correctly implement __enter__ (reportGeneralTypeIssues)
  mantidimaging/gui/windows/live_viewer/presenter.py:122:18 - error: Object of type "NoReturn" cannot be used with "with" because it does not correctly implement __exit__ (reportGeneralTypeIssues)
2 errors, 0 warnings, 0 informations

Going forward, this should be explored further, but pinning as a temporary fix for the moment.

Testing

  • On main branch, rebuilt developer environment, ran pyright static analysis checks and verified that the reportGeneralTypeIssues pyright errors present in mantidimaging/gui/windows/live_viewer/presenter.py were returned
  • Switched to PR branch, checked that pyright was pinned to 1.1.391 in the environment.yml. Rebuilt developer environment, ran pyright static analysis checks again and verified that the pyright reportGeneralTypeIssues errors were no longer returned.

Acceptance Criteria

On main branch:

  • Rebuild development environment
    • mamba deactivate
    • python setup.py create_dev_env
    • mamba activate mantidimaging-dev
  • Run pyright: pyright
  • Verify that the following issues are included in pyright logs:
     mantidimaging/gui/windows/live_viewer/presenter.py:122:18 - error: Object of type "NoReturn" cannot be used with "with" because it does not correctly implement __enter__ (reportGeneralTypeIssues)
      mantidimaging/gui/windows/live_viewer/presenter.py:122:18 - error: Object of type "NoReturn" cannot be used with "with" because it does not correctly implement __exit__ (reportGeneralTypeIssues)

Switch to PR branch: git switch pyright_pin_version

  • Rebuild developer environment
    • mamba deactivate
    • python setup.py create_dev_env
    • mamba activate mantidimaging-dev
  • Run pyright: pyright
  • Verify that the reportGeneralTypeIssues previously seen on main are no longer returned.

Documentation

N/A - Not needed

Pinning version of Pyright to version 1.1.391 as the most recent version of pyright published, 1.1.392
picks up the following two errors `reportGeneralTypeIssues`'s:

```bash
mantidimaging/gui/windows/live_viewer/presenter.py
  mantidimaging/gui/windows/live_viewer/presenter.py:122:18 - error: Object of type "NoReturn" cannot be used with "with" because it does not correctly implement __enter__ (reportGeneralTypeIssues)
  mantidimaging/gui/windows/live_viewer/presenter.py:122:18 - error: Object of type "NoReturn" cannot be used with "with" because it does not correctly implement __exit__ (reportGeneralTypeIssues)
2 errors, 0 warnings, 0 informations
```

Going forward, this should be explored further, but pinning as a temporary fix for the moment.
@coveralls
Copy link

Coverage Status

coverage: 73.609%. remained the same
when pulling 3e9d6dc on pyright_pin_version
into 41617ac on main.

@ashleymeigh2 ashleymeigh2 self-requested a review January 17, 2025 13:06
@ashleymeigh2 ashleymeigh2 marked this pull request as ready for review January 17, 2025 13:06
Copy link
Collaborator

@ashleymeigh2 ashleymeigh2 left a comment

Choose a reason for hiding this comment

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

The errors related to Object of type "NoReturn" and the enter/exit methods are no longer appearing, and the static analysis is now passing. This confirms the problem has been successfully fixed.

@ashleymeigh2 ashleymeigh2 added this pull request to the merge queue Jan 17, 2025
Merged via the queue into main with commit a2e5302 Jan 17, 2025
8 checks passed
@ashleymeigh2 ashleymeigh2 deleted the pyright_pin_version branch January 17, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants