Skip to content

validate existing type annotations#353

Merged
zFernand0 merged 2 commits into
zowe:staging/353/type_annotationfrom
olamidepeterojo:type_annotation
May 20, 2025
Merged

validate existing type annotations#353
zFernand0 merged 2 commits into
zowe:staging/353/type_annotationfrom
olamidepeterojo:type_annotation

Conversation

@olamidepeterojo

Copy link
Copy Markdown
Contributor

Fixes #321

How to Test

Review Checklist
I certify that I have:

Additional Comments

traeok
traeok previously requested changes Feb 26, 2025

@traeok traeok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for adding all these types! I had a question about one parameter and a concern about interpreting binary contents.

Comment thread src/core/zowe/core_for_zowe_sdk/profile_manager.py Outdated
Comment thread src/zos_files/zowe/zos_files_for_zowe_sdk/uss.py Outdated

@zFernand0 zFernand0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the overall goal makes sense to me 😋

However, there are a few things that I'm not sure that's exactly they should be done. 😋

Left some comments since I'm not able to run unit (nor integration) tests successfully in this PR 😢

Comment thread src/zos_console/zowe/zos_console_for_zowe_sdk/response/__init__.py
Comment thread src/core/zowe/core_for_zowe_sdk/sdk_api.py Outdated
Comment thread src/zos_files/zowe/zos_files_for_zowe_sdk/response/__init__.py Outdated
Comment thread src/zos_jobs/zowe/zos_jobs_for_zowe_sdk/response/__init__.py Outdated

@zFernand0 zFernand0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like some items have not been resoled yet.
Please check them out before re-requesting review 🙏

@zFernand0

Copy link
Copy Markdown
Member

Not sure if the re-request is happening automatically because of the force-push 😓
However, I still see a few issues that are not resolved. 😅

For now, I'll remove myself from the list of reviewers on this PR 🙏

@zFernand0 zFernand0 removed their request for review March 5, 2025 14:56
@olamidepeterojo

Copy link
Copy Markdown
Contributor Author

@zFernand0 my apologies. haha, ive been the one re-requesting review. could you please point out the few issues you noticed cause the ones mentioned earlier has been solved

@traeok traeok dismissed their stale review March 6, 2025 18:48

Changes addressed

@zFernand0 zFernand0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After fixing these, please run pytest -s tests/unit/ to view any failing unit tests 😅

Comment on lines +12 to +15
from .end_response import EndResponse
from .issue_response import IssueResponse
from .send_response import SendResponse
from .start_response import StartResponse

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
from .end_response import EndResponse
from .issue_response import IssueResponse
from .send_response import SendResponse
from .start_response import StartResponse
from .tso import EndResponse, IssueResponse, SendResponse, StartResponse

Comment on lines +12 to +15
from .job_response import JobResponse
from .spool_response import SpoolResponse
from .status_response import StatusResponse

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
from .job_response import JobResponse
from .spool_response import SpoolResponse
from .status_response import StatusResponse
from .jobs import JobResponse, SpoolResponse, StatusResponse

Comment on lines +13 to +14
from .console_response import ConsoleResponse
from .response import IssueCommandResponse

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
from .console_response import ConsoleResponse
from .response import IssueCommandResponse
from .console import ConsoleResponse, IssueCommandResponse

Comment thread CHANGELOG.md Outdated
Comment on lines +19 to +24
### Enhancements
- Split response classes into individual modules for better maintainability:
- `JobResponse` now lives in `job_response.py`
- `SpoolResponse` now lives in `spool_response.py`
- `StatusResponse` now lives in `status_response.py`
- Updated imports in relevant modules to reflect these changes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These enhancements should be moved under a ## Recent Changes header at the top of the CHANGELOG.md file.

Comment thread CHANGELOG.md Outdated

### Bug Fixes

- Validate existing type annotations. [#321] (https://github.com/zowe/zowe-client-python-sdk/issues/321)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Similar to previous comment - this bug fix should be moved under a ## Recent Changes header at the top of the CHANGELOG.md file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Python added a number of built-in types in 3.9 like list and dict. Since we require Python 3.9 or newer, I think we should prefer using these built-in types (lowercase) over ones imported from the typing module (uppercase).

@zFernand0 zFernand0 moved this from Review/QA to PI Backlog in Zowe CLI Squad Mar 29, 2025
Signed-off-by: Olamide Ojo <peterojoolamide@gmail.com>
@olamidepeterojo olamidepeterojo marked this pull request as draft April 16, 2025 11:11
@zowe-robot zowe-robot moved this from PI Backlog to In Progress in Zowe CLI Squad Apr 16, 2025
@olamidepeterojo

Copy link
Copy Markdown
Contributor Author

After fixing these, please run pytest -s tests/unit/ to view any failing unit tests 😅

Hello @zFernand0, one major error is:
FAILED tests/unit/core/test_profile_manager.py::TestZosmfProfileManager::test_autodiscovery_and_base_profile_loading - AttributeError: module 'zowe' has no attribute 'secrets_for_zowe_sdk'. Did you mean: 'core_for_zowe_sdk'?. I think this is as a result having no keyring.py file in the secrets_for_zowe_sdk. What do you think about creating a keyring.py file? Kindly advice

@zFernand0 zFernand0 changed the base branch from main to staging/353/type_annotation May 20, 2025 16:17
@zFernand0 zFernand0 marked this pull request as ready for review May 20, 2025 16:17
@zFernand0 zFernand0 merged commit e03211f into zowe:staging/353/type_annotation May 20, 2025
16 of 31 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Closed in Zowe CLI Squad May 20, 2025
@zFernand0

Copy link
Copy Markdown
Member

Hey @olamidepeterojo, 👋
Thanks a lot for the contribution!
We will be moving forward with this PR by placing it into a staging branch.
This will allow us to continue polishing the work while still give you credit for the contribution.
Again, thanks a lot for the invaluable contribution and we hope to continue having you as a Python SDK maintainer 🙏

@zowe-robot zowe-robot moved this from Closed to Review/QA in Zowe CLI Squad May 20, 2025
@zFernand0 zFernand0 moved this from Review/QA to Closed in Zowe CLI Squad May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

Validate type hints and fix any incorrect ones

5 participants