Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/2231.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Experimental support has been added for using `uv` to manage Python environments.
1 change: 1 addition & 0 deletions changes/596.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Experimental support has been added for using `conda` or `pixi` to manage Python environments.
13 changes: 13 additions & 0 deletions docs/en/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ The person or organization responsible for the project.

The contact email address for the person or organization responsible for the project.

#### `env_manager`

**EXPERIMENTAL** This is an experimental feature. It is currently only used by developer mode.

The environment manager to use when creating isolated Python environments and installing requirements; one of:

* `venv` - The `venv` package provided by the Python standard library
* `uv` - The [uv](https://docs.astral.sh/uv/) environment manager
* `conda` - The [Conda](https://docs.conda.io/) environment manager
* `pixi` - The [Pixi](https://pixi.prefix.dev/) environment manager

Defaults to `venv`.

#### `license_files`

A [PEP 639](https://peps.python.org/pep-0639/) specification for the files in the project that define licenses that should be included with the packaged app. `license_files` must be a list of strings, each of which references a filename in the project (relative to the location of the `pyproject.toml`):
Expand Down
17 changes: 13 additions & 4 deletions src/briefcase/commands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from briefcase.config import (
AppConfig,
DraftAppConfig,
EnvManagerT,
FinalizedAppConfig,
GlobalConfig,
parse_config,
Expand Down Expand Up @@ -136,6 +137,7 @@ class BaseCommand(ABC):
cmd_line = "briefcase {command} {platform} {output_format}"
supported_host_os: Collection[str] = {"Darwin", "Linux", "Windows"}
supported_host_os_reason = f"This command is not supported on {platform.system()}."
supported_env_managers: Collection[EnvManagerT] = {"venv"}

# defined by platform-specific subclasses
command: str
Expand All @@ -154,7 +156,7 @@ class BaseCommand(ABC):
def __init__(
self,
console: Console,
tools: ToolCache = None,
tools: ToolCache | None = None,
apps: dict[str, AppConfig] | None = None,
base_path: Path | None = None,
data_path: Path | None = None,
Expand Down Expand Up @@ -735,14 +737,21 @@ def finalize_app_config(self, app: DraftAppConfig, **kwargs) -> FinalizedAppConf
configuration, and performs any other app-specific platform configuration and
verification that is required as a result of command-line arguments.

Platform overrides should call ``super().finalize_app_config(app, **kwargs)``
to construct the ``FinalizedAppConfig``.
Platform overrides should call `super().finalize_app_config(app, **kwargs)`
to construct the `FinalizedAppConfig`.

:param app: The app configuration to finalize.
:param kwargs: Runtime attributes forwarded to the FinalizedAppConfig
constructor (``test_mode``, ``debugger``, etc.).
constructor (`test_mode`, `debugger`, etc.).
:returns: The finalized app configuration.
"""
if app.env_manager not in self.supported_env_managers:
raise BriefcaseConfigError(
f"{app.app_name!r} declares the use of a {app.env_manager!r} "
f"environment, but {self.platform} {self.output_format} "
f"projects do not support environments of that type."
)

return FinalizedAppConfig(app, **kwargs)

def resolve_apps(
Expand Down
Loading
Loading