Skip to content

Conversation

tonyroberts
Copy link

This change adds a new "--standalone" command line argument.

When using this option the files from the base Python environment are included in the output package to create a standalone Python environment. This can be unpacked on a different machine without access to the original base Python environment.

This is useful for creating standalone packages for replicating Python environments across different machines where the base environment is not shared.

Environment files like pyvenv.cfg get excluded in load_environment, but
the list of files they're removed from are relative to the env prefix
already and so don't add the prefix when building the set to remove.
On Windows in particular, the executable in the shebang doesn't have to
be the same case as in the pyvenv.cfg file. This can happen if creating
a venv using a lower case drive letter, for example.
The home setting is the prefix for the base environment, it's not the
python executable. Getting the dirname of this results in it being the
directory above.
On Windows Activate.ps1 is upper case.
When using this option everything from the base Python environment is
included in the package. The output package can be unpacked on another
PC without requiring the base Python package to exist.

Fixes #1
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