briefcase icon indicating copy to clipboard operation
briefcase copied to clipboard

Cannot install optional dependencies on local repositories under Linux

Open freakboy3742 opened this issue 1 month ago • 2 comments

Describe the bug

A project that declares a requirement with an optional dependency, installed from a local source folder, cannot be built on Linux.

Steps to reproduce

  1. Define a project with requires = ['../path/to/package[optional]']
  2. Run briefcase create
  3. See error
Unable to find local requirement ../path/to/package[optional]

Expected behavior

Packages with optional dependencies should build without error, installing the optional dependencies.

Screenshots

No response

Environment

  • Operating System: Linux
  • Python version: all (tested on 3.12)
  • Software versions:
    • Briefcase: 0.3.25

Logs


Additional context

This was discovered in the process of developing tests for the Toga QT backend, which has optional dependencies because of the multiple Qt backend implementations.

The problem doesn't manifest on dev; it's only when the full build occurs.

The problem appears to be caused because for a Linux system install, Briefcase first builds all the requirements as wheels, and then writes a requirements.txt file that includes the dependencies. This involves a call to python -m build ../path/to/package[option], which fails, because that isn't a valid path. The [] optional component should be stripped for the purposes of the call to build, and then included when the requirements file is finalised.

freakboy3742 avatar Nov 12 '25 07:11 freakboy3742

Hi! I’d like to work on this issue.

apeksha-code-maker avatar Dec 12 '25 13:12 apeksha-code-maker

That's great; we don't have any formal assignment process, you can just go ahead and create a PR.

mhsmith avatar Dec 12 '25 13:12 mhsmith