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 new flake8-bugbear B039 and mypy type-var errors #18755

Merged
merged 3 commits into from
Aug 31, 2024

Conversation

nsoranzo
Copy link
Member

@nsoranzo nsoranzo commented Aug 30, 2024

Also fix some DeprecationWarnings.
B039 fixes required for #18578 .
See individual commits for more details.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

Fix the following warning when running unit tests:

```
test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py::test_request_scoped_sa_session_single_request
test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py::test_request_scoped_sa_session_exception
test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py::test_request_scoped_sa_session_concurrent_requests_sync
test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py::test_request_scoped_sa_session_concurrent_requests_async
test/unit/webapps/test_request_scoped_sqlalchemy_sessions.py::test_request_scoped_sa_session_concurrent_requests_and_background_thread
  /usr/users/ga002/soranzon/software/nsoranzo_galaxy/.venv/lib/python3.10/site-packages/httpx/_client.py:1426: DeprecationWarning: The 'app' shortcut is now deprecated. Use the explicit style 'transport=ASGITransport(app=...)' instead.
```

See:

https://github.com/encode/httpx/blob/master/CHANGELOG.md#0270-21st-february-2024
caused by the more precise type annotation of ``numpy.number`` comparison
operators introduced in NumPy 2.1, see:

python/typeshed#12562

Fix the following errors when running test_galaxy_packages on Python >=3.10:

```
galaxy/tool_util/verify/__init__.py:503: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "floating[Any]"  [type-var]
                iou_list.append(max(cc1_iou_list))
                                ^~~~~~~~~~~~~~~~~
galaxy/tool_util/verify/__init__.py:532: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "floating[Any]"  [type-var]
        return min(_multiobject_intersection_over_union(mask1, mask2, pin_labels))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
@github-actions github-actions bot added this to the 24.2 milestone Aug 30, 2024
@nsoranzo nsoranzo changed the title Fix new flake8-bugbear B039 and mypy type-var errors. Fix some DeprecationWarnings. Fix new flake8-bugbear B039 and mypy type-var errors Aug 30, 2024
@jmchilton jmchilton merged commit 9f3ed27 into galaxyproject:dev Aug 31, 2024
55 of 58 checks passed
@nsoranzo nsoranzo deleted the fix_B039 branch September 1, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants