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

Extension is showing warnings about configuration issues in pyproject.toml files in a .venv #478

Closed
LaurensBosscher opened this issue May 23, 2024 · 5 comments · Fixed by astral-sh/ruff#11551
Assignees
Labels
bug Something isn't working

Comments

@LaurensBosscher
Copy link

Hi,

I've enabled the new Ruff LSP and I saw the following output in the logs:

2024-05-23 14:08:07.128 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the lint section. Please update the following options in /home/laurens/develop/savex/connectors/Bloomberg/.venv/lib/python3.12/site-packages/pandas/pyproject.toml:

  • 'ignore' -> 'lint.ignore'
  • 'select' -> 'lint.select'
  • 'typing-modules' -> 'lint.typing-modules'
  • 'unfixable' -> 'lint.unfixable'
  • 'per-file-ignores' -> 'lint.per-file-ignores'
    warning: The top-level linter settings are deprecated in favour of their counterparts in the lint section. Please update the following options in /home/laurens/develop/savex/connectors/InteractiveBrokers/.venv/lib/python3.12/site-packages/pandas/pyproject.toml:
  • 'ignore' -> 'lint.ignore'
  • 'select' -> 'lint.select'
  • 'typing-modules' -> 'lint.typing-modules'
  • 'unfixable' -> 'lint.unfixable'
  • 'per-file-ignores' -> 'lint.per-file-ignores'

A quick look at the pandas repo does show that they should indeed update their pyproject.toml however as a user this information is not actionable or relevant.

Since we're using a mono-repo with a number of installation of pandas this does create a bit of noise but is otherwise not an issue.

To reproduce:

  1. Install pandas
  2. Enable the new Ruff LSP
  3. Check the Output panel for Ruff.
@charliermarsh
Copy link
Member

Does this only appear when you open a file in Pandas, like Go-To Definition into Pandas itself? Or always?

@charliermarsh charliermarsh added the bug Something isn't working label May 23, 2024
@charliermarsh
Copy link
Member

(Agree we shouldn't show you this.)

@snowsignal snowsignal self-assigned this May 23, 2024
@LaurensBosscher
Copy link
Author

LaurensBosscher commented May 24, 2024

Does this only appear when you open a file in Pandas, like Go-To Definition into Pandas itself? Or always?

This shows up when I open the mono-repo project (w/h opening any files in the VSCode window) so it seems to be triggered by the initialization phase. I've attached the start of the log (after opening the project) below:

2024-05-24 14:39:15.052 [info] Name: Ruff
2024-05-24 14:39:15.052 [info] Module: ruff
2024-05-24 14:39:15.052 [info] Python extension loading
2024-05-24 14:39:15.052 [info] Waiting for interpreter from python extension.
2024-05-24 14:39:17.406 [info] Python extension loaded
2024-05-24 14:39:33.429 [info] Server run command: c:\Users\lbo\.pyenv\pyenv-win\versions\3.11.6\python.exe c:\Users\lbo\.vscode\extensions\charliermarsh.ruff-2024.22.0-win32-x64\bundled\tool\ruff_server.py server --preview
2024-05-24 14:39:33.432 [info] Server: Start requested.
2024-05-24 14:39:37.394 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `c:\develop\savex\projects\bridge\.venv\Lib\site-packages\pandas\pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'typing-modules' -> 'lint.typing-modules'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

2024-05-24 14:39:37.395 [info] warning: `PGH001` has been remapped to `S307`.

2024-05-24 14:39:39.417 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `c:\develop\savex\projects\risk_framework\.venv\Lib\site-packages\pandas\pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'typing-modules' -> 'lint.typing-modules'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

2024-05-24 14:39:41.234 [info] warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `c:\develop\savex\projects\risk_transfer_opportunities_backtester\.venv\Lib\site-packages\pandas\pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'typing-modules' -> 'lint.typing-modules'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

The above statement is repeated for every project, then it shows the following lines:

2024-05-24 14:39:56.018 [info] [Trace - 2:39:55 PM] Received request 'client/registerCapability - (1)'.
2024-05-24 14:39:56.018 [info] [Trace - 2:39:55 PM] Sending response 'client/registerCapability - (1)'. Processing request took 3ms
2024-05-24 14:39:56.069 [info]   20.325423s INFO ruff_server::server Configuration file watcher successfully registered

Let me know if additional information is useful!

@charliermarsh
Copy link
Member

Thanks, I see the issue. We proactively discover all configuration files, and we're not respecting exclusions.

@charliermarsh
Copy link
Member

Fixed in astral-sh/ruff#11551.

charliermarsh added a commit to astral-sh/ruff that referenced this issue May 27, 2024
## Summary

Right now, we're discovering configuration files even within (e.g.)
virtual environments, because we're recursing without respecting the
`exclude` field on parent configuration.

Closes astral-sh/ruff-vscode#478.

## Test Plan

Installed Pandas; verified that I saw no warnings:

![Screenshot 2024-05-26 at 8 09
05 PM](https://github.com/astral-sh/ruff/assets/1309177/dcf4115c-d7b3-453b-b7c7-afdd4804d6f5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants