astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.18k stars 598 forks source link

Compatibility with Briefcase Projects: Support for New Configuration File #6604

Open NADOOITChristophBa opened 3 weeks ago

NADOOITChristophBa commented 3 weeks ago

Title: Compatibility with Briefcase Projects: Support for New Configuration File

Issue Description:

I am working on a project using Briefcase and encountered compatibility issues when trying to integrate uv. The main problem arises from the different configurations expected by uv and Briefcase, specifically in the pyproject.toml file.

Problem Description

Steps to Reproduce

  1. Create a Briefcase project with the structure mentioned above.
  2. Navigate to the project directory and try to run a uv command, e.g., uv add ruff.
  3. Observe the error indicating that the pyproject.toml file does not have the expected [project] table.

Error Messages

When running uv add ruff in the project root:

error: No `pyproject.toml` found in current directory or any parent directory

When running uv add ruff in the project_name subdirectory:

error: No `project` table found in: `/path/to/project/pyproject.toml`

Proposed Solution

To resolve this compatibility issue, I propose the following:

Additional Information

Thank you for considering this feature request. This enhancement would greatly improve the integration of uv with projects managed by Briefcase, allowing for more seamless development workflows.

freakboy3742 commented 1 week ago

BeeWare/Briefcase maintainer here. Definitely keen to work with Astral/uv maintainers on anything related to Briefcase integration; the exact form of that integration is the open question.

I wouldn't necessarily recommend adding support for Briefcase's configuration conventions to uv. I'd argue it's likely better for Briefcase to support uv's conventions, and use uv internally. beeware/briefcase#1367 is an existing ticket asking for Poetry support in Briefcase; I imagine the uv-based approach would be similar.

The constraint on this is usually whether the installation tool can support four key features:

  1. Platform-specific dependencies (i.e., only install library X if we're installing for platform Y)
  2. Support for iOS, Android, and web as recognised platforms.
  3. "Host-mode" installation - installing dependencies into a specific target location that isn't the site-packages of the currently running Python interpreter
  4. Cross-platform targeting - installing dependencies for a platform that isn't the currently running platform (e.g., installing iOS dependencies when on macOS.

To date, I haven't done any exploration of uv to know the current state of these features. If they already exist, then it might be possible to add uv support to Briefcase.