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 check pyproject.toml file existent #1408

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pr_agent/algo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,8 @@ def get_version() -> str:
return data["project"]["version"]
else:
get_logger().warning("Version not found in pyproject.toml")
else:
get_logger().warning("Unable to determine local version from pyproject.toml")
else:
get_logger().warning("Unable to determine local version from pyproject.toml")
Comment on lines +1128 to +1129
Copy link
Collaborator

Choose a reason for hiding this comment

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

i am not sure i agree with this change.

If I have a pip package, than I won't find a "pyproject.toml" file. but its ok. it does not justify a "warning" message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point, this is the old code. You can see this code is not reachable
CleanShot 2024-12-23 at 18 58 26
And it doesn't have the same code block with if os.path.exists("pyproject.toml"):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new code
CleanShot 2024-12-23 at 19 08 32

Copy link
Collaborator

Choose a reason for hiding this comment

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

image

maybe its due to your python version ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, I'm using 3.13. Let me check it with 3.12 and get back to you afterward.

Copy link
Collaborator

@mrT23 mrT23 Dec 24, 2024

Choose a reason for hiding this comment

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

i am saying i dont see unreachable code warning on my platform.

And I am not sure from the code why it should be, always, unreachable.
Maybe its an issue of your specific enviroment


# Otherwise get the installed pip package version
try:
Expand Down
Loading