Skip to content

Add support for using conda as an environment manager. - #2972

Open
freakboy3742 wants to merge 3 commits into
beeware:mainfrom
freakboy3742:add-conda-support
Open

Add support for using conda as an environment manager.#2972
freakboy3742 wants to merge 3 commits into
beeware:mainfrom
freakboy3742:add-conda-support

Conversation

@freakboy3742

Copy link
Copy Markdown
Member

Adds support for using Conda as an environment manager.

Adds one major new concept - the idea that the environment manager can be responsible for providing the Python install. When using Conda, there's no "support package" to install; Conda provides libpython, and the full Conda environment is copied into the application bundle as the last step of the install.

It's also assumed that if the environment is providing Python, Python packages are installed into that environment; so on update, updating the support package or the requirements requires rebuilding both.

Conda environments can only be used for macOS and Windows. A Conda doesn't have support for iOS or Android (yet... see this draft CEP); and a Conda environment can't be included as a Linux system package because it includes libraries (like libssl) that get flagged by DEB/RPM auditing tools. It might be possible to build a Flatpak that includes conda, but that is deferred from this PR.

On macOS, Conda cannot build universal apps; Conda binaries are single platform, and merging entire Conda environments would be complicated at best. As x86-64 macOS support is nearing EOL, I've decided to avoid the complication.

Add env_manager = "conda" to a project to test this configuration.

Building on macOS requires the use of custom templates:

macOS requires a different stub binary for "framework" builds (which use the support package and Python.xcframework) vs "non-framework" builds (which use Conda and libpython3.X.so).

Building on Windows requires the use of custom templates as well:

I've preemptively published an experimental stub binaries (build x2917) to allow testing the macOS and Windows app templates. The app templates uses these stub binaries. The Xcode/VisualStudio templates can be merged today; once that happens and this PR is merged, the stub binary will need to be formally tagged, and the app template updated to use that new stub.

This PR also includes documentation for the general topic of environment management, and normalises the naming of the venv backend (renamed from std_venv - I realized the reason it was causing headaches was the .gitignore file).

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant