-
-
Notifications
You must be signed in to change notification settings - Fork 473
Description
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
- Define a project with
requires = ['../path/to/package[optional]'] - Run
briefcase create - 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.