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

ref: Add ruff rules for pygrep-hooks (PGH) #4042

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Oct 7, 2024

Add ruff rules for pygrep-hooks (PGH)

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 7, 2024
@cbornet cbornet requested a review from ogabrielluiz October 7, 2024 14:42
@@ -10,8 +10,8 @@
import httpx
import typer
from dotenv import load_dotenv
from multiprocess import cpu_count # type: ignore
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are a lot of # type: ignore on 3rd party dependencies.
I guess those are optional ?
But shouldn't mypy be run with uv's dev deps that contain those dependencies ?

Copy link
Contributor

Choose a reason for hiding this comment

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

This case is because multiprocess is kinda weird. I'm not sure about the other ones but they generally are related to typing variables and outputs inside components. Not a lot of people know about cast and how to type correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think you get these mypy errors when you don't have the dependency.
In CI dev dependencies are installed and mypy still passes when removing the ignore.

Copy link
Contributor

Choose a reason for hiding this comment

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

multiprocess is a base dependency in langflow

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Then. I don't know why this ignore was there. Maybe some legacy ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Process is not explicitly exported in multiprocess.init

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It doesn't raise an error in mypy for me. Does it for you ?
Maybe we can check if CI passes ?

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4042.dmtpw4p5recq1.amplifyapp.com

@cbornet cbornet force-pushed the ruff-rules-pgh branch 3 times, most recently from b815b1c to 7c0f7f7 Compare October 8, 2024 19:35
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 8, 2024
@cbornet cbornet merged commit d4818a3 into langflow-ai:main Oct 8, 2024
28 checks passed
@cbornet cbornet deleted the ruff-rules-pgh branch October 8, 2024 21:06
diogocabral pushed a commit to headlinevc/langflow that referenced this pull request Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants