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

Pyright ignores configuration from custom toml files #7972

Closed
vprud opened this issue May 22, 2024 · 5 comments
Closed

Pyright ignores configuration from custom toml files #7972

vprud opened this issue May 22, 2024 · 5 comments
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request

Comments

@vprud
Copy link

vprud commented May 22, 2024

Describe the bug

Option --project of command-line version of pyright does not support configuration in toml file. The configuration in toml files other than 'pyproject.toml` is ignored. If emit verbose diagnostics of pyright, it will show that it does not find any configuration file.

Code or Screenshots

For example, I will use configs folder, in which configuration files will be saved. Create configuration in configs/pyright.toml:

[tool.pyright]
typeCheckingMode = "strict"

and similarly in configs/pyright.json:

{
    "typeCheckingMode": "strict"
}

When running with toml configuration file:

pyright --project configs/pyright.toml --verbose

pyright writes that it cannot find configuration file:

Configuration file not found at <path to root>/configs/pyright.toml.

When running with json configuration file:

pyright --project configs/pyright.json --verbose

pyright writes that it found configuration file in ./configs/pyright.json and uploaded it:

Loading configuration file at <path to root>/configs/pyright.json

This behavior does not seem consistent for different formats of configuration file. It is expected that pyright will read toml file as well as json configuration file.

VS Code extension or command-line

$ pyright --version
pyright 1.1.360
@vprud vprud added the bug Something isn't working label May 22, 2024
@erictraut
Copy link
Collaborator

This is by design. If you want to use a custom configuration, you should use the ".json" format. Support for ".toml" is provided only for integration with the standard "pyproject.toml" file that is commonly used for Python projects.

@erictraut erictraut closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
@erictraut erictraut added as designed Not a bug, working as intended enhancement request New feature or request and removed bug Something isn't working as designed Not a bug, working as intended labels May 22, 2024
@erictraut
Copy link
Collaborator

Reopening this as a feature request.

@erictraut erictraut reopened this May 24, 2024
@erictraut
Copy link
Collaborator

I decided to implement this feature as part of #4366. It will be included in the next release.

@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label May 25, 2024
@vprud
Copy link
Author

vprud commented May 25, 2024

Great, I believe it will be very useful.

@erictraut
Copy link
Collaborator

This is included in pyright 1.1.365.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants