Visitar URL original
Briefcase doesn't work with uv · Issue #2314 · beeware/briefcase · GitHub
Skip to content

Briefcase doesn't work with uv #2314

Closed as duplicate
1 of 1 issue completed
Closed as duplicate

Description

@andrewsanchez

EDIT: most definitely not a bug.

The following workflow with uv works:

➜ uv run --with briefcase briefcase new
➜ cd helloworld
➜ uv run --no-project --with briefcase briefcase dev

This (very obviously, in retrospect) doesn't work and results in an error, which I was initially confused by:

➜ uv init --no-readme
➜ uv add briefcase
➜ uv run briefcase new
➜ cd helloworld
➜ uv run briefcase dev
error: No `project` table found in: `/Users/andrewsanchez/Projects/beeware/beeware-console-app/helloworld/pyproject.toml`


Briefcase configuration error: No tool.briefcase section in pyproject.toml

Environment

  • Operating System: macOS Sonoma 14.6.1
  • Python version: Python 3.12.9
  • Software versions:
    • Briefcase: 0.3.23

Activity

  1. changed the title [-]docs: hello world for console app doesn't work[/-] [+]Briefcase doesn't work with uv[/+] on May 24, 2025
  2. freakboy3742 commented on May 24, 2025

    @freakboy3742
    Member

    At present, we don't recommend the use of uv with Briefcase. We haven't fully audited Briefcase for uv usage, and uv does enough "weird" things that it becomes problematic for some Briefcase use patterns. If you use uv and something breaks, you get to keep all the shiny pieces. :-)

    In this case, the error message is an error with uv.

    uv is correctly reporting that pyproject.toml doesn't contain a [project] section. This is correct - and by design. A pyproject.toml file is a toml configuration file. PEP 518 doesn't require the existence of a [project] table. It does define the existence of a tool table - which Briefcase uses; and PEP 517 defines the existence of a [build-system] table, which Briefcase doesn't use. PEP 621 defines the existence of a [project] table - but Briefcase doesn't require the definition of that table, primarily because it predates the existence of PEP 621.

    To the best of my understanding, there are no required keys in pyproject.toml unless you're packaging a specific application, using a specific tool - in which case, PEP 621 or other configurations may be in effect.

    We have a longer-term goal to migrate to using PEP 621 metadata as a canonical definition for some metadata - but until that time, this is a uv bug.

    I don't know uv, but it looks like the --no-project option exists to work around the fact that pyproject.toml doesn't contain a [project] section. I don't know why this option exists - you'd have to take that up with the maintainers of uv.

    The other workaround would be to manually add a [project] table to your pyproject.toml. Briefcase will honor some PEP 621 keys.

    I'll keep this open as a known issue with uv compatibility.

  3. andrewsanchez commented on May 24, 2025

    @andrewsanchez
    Author

    That all makes sense. I rushed back here to close or delete the issue after realizing these things. 😆 Thanks!

    Regarding uv run --no-project

    Avoid discovering the project or workspace

    Note that if uv run is used in a project, these dependencies will be included in addition to the project's dependencies. To opt-out of this behavior, use the --no-project flag.

    Note that if you use uv run in a project, i.e., a directory with a pyproject.toml, it will install the current project before running the script. If your script does not depend on the project, use the --no-project flag to skip this

  4. freakboy3742 commented on May 25, 2025

    @freakboy3742
    Member

    I'm going to migrate this issue to the Briefcase repository, since it's a Briefcase-specific issue.

  5. added
    enhancementNew features, or improvements to existing features.
    and removed
    bugA crash or error in behavior.
    on May 27, 2025
  6. Shuuen-Yukibi commented on Jan 3, 2026

    @Shuuen-Yukibi

    [ChatGPT-generated reply]

    Hi! I ran into the same uv + Briefcase workflow described in this issue and wanted to confirm whether the approach below is correct.

    Why uv is required in my case

    • My local Python toolchain is fully managed by uv (Python installs + execution). I don’t have a “system Python” workflow available, so any development commands must run via uv.

    Context / problem

    • Running Briefcase via uv run briefcase ... triggers uv “project mode”, which expects a PEP 621 [project] table in pyproject.toml.
    • A freshly generated Briefcase project primarily relies on [tool.briefcase] and may not contain [project], so uv run can fail with “No project table found”.
    • Using uv in “tool mode” (uvx / uv run --no-project --with ...) avoids uv’s project-table validation while still letting me stay in a uv-only environment.

    Working solution (Windows)

    1. Create the app (from .\beeware):
      cd /d .\beeware
      uvx briefcase@latest new
      (This generates the project folder; in my case it’s .\beeware\Projects)

    2. Run dev using tool mode (avoids uv project mode):
      cd .\beeware\Projects
      uv run --no-project --with briefcase briefcase dev

    Python version note (important)

    • If uv installs Python 3.14.x by default (e.g., uv python install 3), on Windows Toga’s WinForms backend (toga-winforms) depends on pythonnet>=3.0.0, and pythonnet currently may not provide wheels compatible with Python 3.14 yet. That causes pip resolution to fail during briefcase dev.

    • Pinning to Python 3.13 resolves this in my environment:

      uv python install 3.13
      uvx --python 3.13 briefcase@latest dev

    Question for the author/maintainers

    • Is the intended uv-based workaround for Briefcase doesn't work with uv #2314 to rely on uv “tool mode” (uvx briefcase ...) or uv run --no-project --with briefcase ... (as above)?
    • Is pinning to Python 3.13 the correct recommendation for Windows users until pythonnet supports Python 3.14?

    Thanks!

  7. freakboy3742 commented on Jan 5, 2026

    @freakboy3742
    Member

    @Shuuen-Yukibi At present, we don't have any advice on the use of uvx with Briefcase. We're not opposed to make changes to accomodate the use of uv or uvx; and some recent changes that we've made, and some improvements that are on our todo list should make compatibility with uvx easier. In the meantime, we're not testing for the use of uv or uvx, so we can't make any guarantees or suggestions about how it operates.

    As for Pythonnet - yes, pinning to 3.13 is the only viable option until pythonnet/pythonnet#2610 / pythonnet/pythonnet#2611 is resolved.

  8. added
    documentationAn improvement required in the project's documentation.
    and removed
    enhancementNew features, or improvements to existing features.
    on Jun 16, 2026
  9. freakboy3742 commented on Jun 16, 2026

    @freakboy3742
    Member

    As of v0.4.0, Briefcase can now be used with uvx. (e.g., uvx briefcase new, uvx briefcase dev, uvx briefcase run, etc)

    uv run is difficult to make work, because a pyproject.toml file contains the code and requirements for a specific app, which won't include briefcase. I'm not sure if there's any way to reconcile this - effectively we would need to define a "briefcase" environment that only includes Briefcase and it's dependencies;

    When running in uvx, Briefcase will still be using the built-in environment management provided by pip and venv. #2231 describes the request for Briefcase to use uv` to create environments.

    On that basis, this has essentially become a documentation issue, describing how to run Briefcase with uvx. Following our triage process, I'm going to close this ticket in favour of #2884 as a documentation ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationAn improvement required in the project's documentation.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions