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

Make pyre able to read configuration from pyproject.toml #799

Closed

Conversation

WangGithubUser
Copy link
Contributor

@WangGithubUser WangGithubUser commented Sep 29, 2023

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

This PR resolves #695.
I'm not sure we should look for pyproject.toml silently when .pyre_configuration is not valid, or only look for it when a flag provided.But, I prefer the first resoulution because the second need to provide a flag in all runs.However, I want to hear you opinion.

Test Plan

Look for if the unittest passed.
As the unittest is not avalible this time(see footnote), I ran test in my local machine with python3.10:
image

Footnote:

  • GitHub Action workflow Test fails due to match statement is incompatible with Python3.8 and 3.9, and is not related to this PR.To make this easier to review and avoid confliting, I will rebase this PR on the top of main if the match statement refactored with if-elif-else statement but not do it in this PR.
  • As a post-process, we need to delete unneeded .pyre_configuration at the root of this project after the nightly version of Pyre with this diff deployed.I intergrated configurations into pyproject.toml.

@WangGithubUser WangGithubUser marked this pull request as draft October 3, 2023 10:48
@WangGithubUser WangGithubUser force-pushed the read_config_from_pyproject branch 3 times, most recently from e93dc27 to b74e8dc Compare October 6, 2023 05:04
@hparente1313
Copy link

@WangGithubUser @cclauss Is this still active? Would love to see this feature.

.pyre_configuration Outdated Show resolved Hide resolved
@SamDc73
Copy link

SamDc73 commented Nov 29, 2024

Any updates on this ?

@MrTrick
Copy link

MrTrick commented Dec 11, 2024

It doesn't look as though @WangGithubUser has been active on github in the last 12 months.
@cclauss perhaps this PR should be considered abandoned?

There are still people asking for this feature, (myself included) what is a good way forward?

@yangdanny97
Copy link
Contributor

Pyre is being rewritten right now, and we plan to support pyproject.toml for that but it won't be available/ready-to-use for at least several months.

In the meantime, feel free to continue with this PR, or if it's inactive someone else can make a new PR.

@WangGithubUser WangGithubUser marked this pull request as ready for review January 5, 2025 08:14
@WangGithubUser
Copy link
Contributor Author

@cclauss It's ready for review now(I hope).

@WangGithubUser WangGithubUser requested a review from cclauss January 5, 2025 08:34
@cclauss
Copy link
Contributor

cclauss commented Jan 5, 2025

This branch has conflicts that must be resolved. (See below)

You will need to rebase this PR.

I do not think the migration from tomli to toml was the right choice. The former is well-maintained and up-to-date while the latter has not been updated since 2020.

Please see https://github.com/hukkin/tomli?tab=readme-ov-file#building-a-tomlitomllib-compatibility-layer for enabling the use of the Python Standard Library module tomllib on Python 3.11+.

@WangGithubUser WangGithubUser force-pushed the read_config_from_pyproject branch from f253f01 to ac0ac79 Compare January 12, 2025 04:51
@WangGithubUser
Copy link
Contributor Author

@cclauss Done.

Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Looks good to me. @MrTrick @yangdanny97 Your reviews, please?

Copy link

@MrTrick MrTrick left a comment

Choose a reason for hiding this comment

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

As a non-expert end user, the changes seem good to me.

@cclauss
Copy link
Contributor

cclauss commented Jan 14, 2025

@rchen152 @yangdanny97 Can we please get this merged?

@@ -7,3 +7,5 @@ tabulate
testslide>=2.7.0
typing_extensions
typing_inspect
tomli
tomli-w
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be kept sorted to make it easy to spot missing dependencies and nearly impossible to insert duplicates.

@facebook-github-bot
Copy link
Contributor

@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@yangdanny97 merged this pull request in b235ff8.

@yangdanny97
Copy link
Contributor

Thanks for your contribution @WangGithubUser and thanks for the reviews @cclauss and @MrTrick

We merged all the changes minus the change to pyre init.

@WangGithubUser WangGithubUser deleted the read_config_from_pyproject branch January 22, 2025 10:11
WangGithubUser added a commit to WangGithubUser/pyre-check that referenced this pull request Jan 23, 2025
As changes to writing configurations in facebookGH-799 were'nt merged, we can remove the dependency on tomli-w.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow pyre to read configuration from pyproject.toml
7 participants