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

Add a function to search for pyproject.toml in a project root #16965

Merged
merged 3 commits into from
Jan 16, 2025

Conversation

Felixoid
Copy link
Contributor

@Felixoid Felixoid commented Feb 29, 2024

(Explain how this PR changes mypy.)

Here's a solution to fix #10613. The tests are covered.

It adds the functionality of searching pyproject.toml recursively from the current directory up to a project root (directory with either .git or .hg) to mypy

This comment has been minimized.

@Felixoid Felixoid force-pushed the master branch 2 times, most recently from add2786 to 65324b8 Compare February 29, 2024 19:49

This comment has been minimized.

This comment has been minimized.

@Felixoid Felixoid force-pushed the master branch 2 times, most recently from d04de61 to 70f00d6 Compare March 1, 2024 00:06

This comment has been minimized.

@Felixoid Felixoid marked this pull request as ready for review March 1, 2024 01:26

This comment has been minimized.

This comment has been minimized.

@Felixoid
Copy link
Contributor Author

Felixoid commented Mar 5, 2024

dear @ilevkivskyi, can you take a look, please?

@Felixoid
Copy link
Contributor Author

Maybe, dear @JukkaL, @hauntsaninja, or @sobolevn could kindly take a look?

@Felixoid
Copy link
Contributor Author

please, any feedback?

@Felixoid
Copy link
Contributor Author

Hello? Could the PR be reviewed, please?

Dear @JukkaL, @hauntsaninja, @cdce8p, or @sobolevn?

@sobolevn
Copy link
Member

Sorry, I don't have context of this PR, so I cannot review :(

@Felixoid
Copy link
Contributor Author

Issue #10613 describes it. I've also changed the PR body. I'd really appreciate it; having the [tool.mypy] section in a single place adds a lot of value. 🙏

@Felixoid
Copy link
Contributor Author

rebased it on the most recent upstream

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

I am not a big expert on pyproject.toml and don't know how it works in other tools. But I don't see anything obviously wrong in this PR, so let's try it.

@ilevkivskyi ilevkivskyi merged commit 55a8840 into python:master Jan 16, 2025
18 checks passed
@Felixoid
Copy link
Contributor Author

Oh, great! Thanks a lot!

I'll prepare the docs update PR then, so people can start use it

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 17, 2025

This doesn't handle precedence correctly / doesn't handle other mypy configuration files. What do you think of #18482 ?

hauntsaninja added a commit that referenced this pull request Jan 20, 2025
Follow up to #16965
Fixes #16070

Handles other mypy configuration files and handles precedence between
them. Also fixes few small things, like use in git worktrees
wesleywright pushed a commit that referenced this pull request Jan 22, 2025
Follow up to #16965
Fixes #16070

Handles other mypy configuration files and handles precedence between
them. Also fixes few small things, like use in git worktrees
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.

mypy should search parent directories for pyproject.toml config file
4 participants