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

Remove unused import #50

Merged
merged 1 commit into from
Sep 7, 2024
Merged

Conversation

sammyhori
Copy link
Contributor

Removed a single unused import.

There also exists an unused import at pyaction/template/{{action_slug}}/main.py but that file only contains the import so I let it be.

@lnxpy
Copy link
Owner

lnxpy commented Sep 5, 2024

Thank you @sammyhori! The change that you made in the io.py file should be changed. I've imported Dict but used the built-in dict. Since PyAction supports Python 3.8 all the way up to 3.12, we better use Dict other than the built-in dict.

The pyaction/template/{{action_slug}}/main.py file, it's a template file that even pre-commit ignores its parent directory while checking. Consider it as a blueprint.

@sammyhori
Copy link
Contributor Author

Thank you @sammyhori! The change that you made in the io.py file should be changed. I've imported Dict but used the built-in dict. Since PyAction supports Python 3.8 all the way up to 3.12, we better use Dict other than the built-in dict.

Fixed in 94bd49e

The pyaction/template/{{action_slug}}/main.py file, it's a template file that even pre-commit ignores its parent directory while checking. Consider it as a blueprint.

👍 All good, I thought it was probably something like that.

@sammyhori
Copy link
Contributor Author

The pre-commit hook automatically changes Dict to dict, thus undoing my changes.

@lnxpy
Copy link
Owner

lnxpy commented Sep 6, 2024

@sammyhori, It's because of the from __future__ import annotations import line in the io.py file. The pyupgrade hook will consider it and change typing.Dict to dict to make the source file be supported on all Python environments. Removing it (the import line) wouldn't make a difference.

Things to do..

  • Remove the from __future__ import annotations line from the beginning of the io.py file.
  • Convert dict to Dict.
  • Squash all your commits into one if you can, please.

Hopefully, it's gonna be alright this time. :))

@sammyhori
Copy link
Contributor Author

@sammyhori, It's because of the from __future__ import annotations import line in the io.py file. The pyupgrade hook will consider it and change typing.Dict to dict to make the source file be supported on all Python environments. Removing it (the import line) wouldn't make a difference.

Things to do..

  • Remove the from __future__ import annotations line from the beginning of the io.py file.
  • Convert dict to Dict.
  • Squash all your commits into one if you can, please.

Hopefully, it's gonna be alright this time. :))

All fixed this time, thanks for the advice :)

Copy link
Owner

@lnxpy lnxpy left a comment

Choose a reason for hiding this comment

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

Very well done, @sammyhori!

@lnxpy
Copy link
Owner

lnxpy commented Sep 7, 2024

Thanks, mate! Hope to see more from you! :D

@lnxpy lnxpy merged commit 325d8fa into lnxpy:main Sep 7, 2024
1 check passed
@sammyhori sammyhori deleted the remove-unused-imports branch September 8, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants