Twixes / pypi-assistant

🔍 PyPI package information at a glance for Python dependencies – a VS Code extension
https://marketplace.visualstudio.com/items?itemName=twixes.pypi-assistant
MIT License
29 stars 4 forks source link

PyPI-Assistant extension for VSCode does not read pyproject.toml when using uv as project manager, but works with requirements.txt #31

Open mrchoke opened 2 weeks ago

mrchoke commented 2 weeks ago

When working with a project that uses uv as the project manager, the PyPI-Assistant extension for VSCode does not recognize or read the pyproject.toml file. However, it continues to function properly when the project uses a requirements.txt file for dependency management.

The project structure is as follows:

.venv/
app/
.python-version
pyproject.toml
uv.lock

The contents of the pyproject.toml are:

[project]
name = "dev-reserve-api"
version = "0.1.0"
description = "Dev Reserve API"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "alembic>=1.13.2",
    "asyncpg>=0.29.0",
    "fastapi-users[sqlalchemy]>=13.0.0",
    "fastapi[all]>=0.115.0",
    "pandas>=2.2.2",
    "sqlalchemy[asyncio]>=2.0.34",
]

Expected Behavior: The PyPI-Assistant extension should detect and properly read the pyproject.toml file for dependency management when uv is used as the project manager.

Actual Behavior: The extension does not recognize the dependencies listed in pyproject.toml, but it works as expected with requirements.txt if used.

Steps to Reproduce:

  1. Create a project with the above structure, using uv as the project manager.
  2. Define the dependencies in the pyproject.toml file.
  3. Open the project in VSCode with the PyPI-Assistant extension installed.
  4. Notice that the extension does not recognize the dependencies listed in pyproject.toml.

Environment:

• VSCode version: 1.93.1 • PyPI-Assistant extension version: 2.1.2 • Python version: 3.12 • uv project manager version: 0.4.10 • OS: Docker Container Debian 12

Let me know if additional information is needed! Thank you for your support.

Twixes commented 1 week ago

Hi @mrchoke! This is quite surprising, because I'm unable to reproduce the problem. When creating a pyproject.toml file with the contents you provided, I do see dependencies recognized:

Screenshot 2024-10-06 at 19 24 39

Is the problem still present on your end when you give it a try?

mrchoke commented 1 week ago

Apologies for the late reply. I have done further testing and can consistently reproduce the issue as follows:

This issue does not occur with a standard project on a local machine, but it arises when working within a devcontainer or over SSH remote. As shown in the attached image, the extension works correctly with requirements.txt, but fails to parse the pyproject.toml.

@Twixes

Screenshot 2024-10-07 at 12 57 55

Devcontainer

Screenshot 2024-10-07 at 13 04 00

Remote SSH

Could you kindly look into this? Thank you!