Transform a virtual environment into a valid `.app` so that it can do .app-y
Project description
VEnvDotApp
On a Mac, if you want to access the GUI, or various other mac-specific APIs, your executable needs to be present in a bundle. This can be an "app bundle" or a "framework bundle". The System python, python.org python, Homebrew Python, and pyenv python (with a little work) are all so-called "framework builds" which include such a bundle.
To build a real bundle, something that you can distribute to someone else,
you probably want to use py2app
. However, if
you just want to pip install
a tool that somebody else wrote which happens to
want to present some GUI elements, or you want to develop something of your own
in a virtualenv without setting up the requisite py2app
infrastructure
(including a setup.py
, etc), this might be the tool for you.
How to use it
If you're using someone else's code and you just want to make a given
virtualenv bundle-y, just pip install venvdotapp && venvdotapp
.
For example:
$ mktempenv
...
$ pip install wxpython
...
$ pycrust
This program needs access to the screen. Please run with a
Framework build of python, and only when you are logged in
on the main display of your Mac.
$ pip install venvdotapp
...
$ venvdotapp
.../.virtualenvs/tmp-4337833f3452981/bin/tmp-4337833f3452981.app
$ pycrust
<A GUI Window Pops Up>
If you're writing your own program which requires an app bundle, you don't need to use the command-line script, just put the following at the very top of your main script:
from venvdotapp import require_bundle
require_bundle()
Note that this will raise an exception if your base Python is not a framework build and therefore not capable of displaying a GUI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file venvdotapp-19.7.1.tar.gz
.
File metadata
- Download URL: venvdotapp-19.7.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dfcc93aa35cbac96e0c582365dc44c46951e8165bf8ae6c22379c2ccf6ce577 |
|
MD5 | 8b1963daed1f2560181e08409de26bcb |
|
BLAKE2b-256 | e22f2482b195117e0b39bb8cdf16e46a28a3e23c928c5eb39b31306422191218 |
File details
Details for the file venvdotapp-19.7.1-py2.py3-none-any.whl
.
File metadata
- Download URL: venvdotapp-19.7.1-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22aba27e03523a7be8f8bf88b0302f3be28a73a3c79cb988c9296dce4eec4440 |
|
MD5 | a5f7d9e15e636a1adb00bc0d47273365 |
|
BLAKE2b-256 | 413b668344e4ee429ea768499957ecca826d9d65c9166b0ee41d0b6f4000b1a2 |