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 issue 410 where the latest typeguard version 3.x is incompatible #411

Merged
merged 15 commits into from
Mar 23, 2023

Conversation

MMelQin
Copy link
Collaborator

@MMelQin MMelQin commented Mar 21, 2023

This PR is intended to only change the version of typeguard to ~=2.12.1 (which is equivalent "typeguard>=2.12.1, <3") in the requirements file as well as the Jupyter Notebooks, as it had been discovered that the newer v3 caused application runtime issues when validating the IO_context. Limiting the typeguard version to below 3 avoids the false error, and is used as the solution for the time being while the App SDK is migrated.

However, more files had to be updated, not related to the intended changes but more to resolve the complaints from the newer versions of Flake8, pytype, and mypy,

  • the existing setup.cfg is not compatible with the latest pytype, v2023.03.13, with one symptom being the inputs could not be parsed out by pytype. So, new config was regenerated and added to pyproject.toml, as the newer pytype has added support for it
  • Flake8 complained about B905 zip()without an explicitstrict= parameter, but this is conflicting with pytype and mytype. So, this B905 is ignored in Flake8 settings
  • pytype complained about File "/home/mqin/src/monai-deploy-app-sdk/monai/deploy/core/application.py", line 222, in add_flow: New container type for io_maps does not match type annotation [container-type-mismatch], and this error is ignored in the pytype settings because the App SDK will stop using these class when migrated, and, there was no runtime errors
  • pytype complained about File "/home/mqin/src/monai-deploy-app-sdk/monai/deploy/operators/dicom_series_to_volume_operator.py", line 229, in prepare_series: No attribute 'first_pixel_on_slice_normal' on monai.deploy.core.domain.dicom_sop_instance.DICOMSOPInstance [attribute-error]. This error is ignored for now, and a new bug has been created for it

With the change and editable App SDK, verified that the newly built MONAI App Package (docker) indeed has the correctly typeguard version 2.12.1 (not 3.0.1 as reported in the issue)

Also tested the Jupyter notebook and verified the all steps executed successful (e.g. running as script, with exec command, with package and run command).

@MMelQin MMelQin force-pushed the mqin/issue410_typeguard_incompatible_ver branch from d080da9 to 4608b22 Compare March 21, 2023 03:40
@MMelQin MMelQin linked an issue Mar 21, 2023 that may be closed by this pull request
Signed-off-by: M Q <[email protected]>
…f date

Also, need to update the code to quiet the complaints from pytype.
A couple errors in the source code need to be investigated but for now ignored

Signed-off-by: M Q <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Mar 23, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@MMelQin
Copy link
Collaborator Author

MMelQin commented Mar 23, 2023

This PR's main change is to limit the typeguard version range, and the rest of the changes are related to formatting issues reported by the new versions of the format and type checking tools used in the build process. The changes were tested and reviewed outside of github, so the PR can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant