Util Packaging

dffml.util.packaging.is_develop(package_name: str) Union[bool, Path][source]

Returns True if the package is installed in development mode.

dffml.util.packaging.mkvenv()[source]

Create a new virtual environment in a temporary directory, and set the VIRTUAL_ENV environment variable appropriately. The newly created temporary directory which will be the parent of the new virtual environment, which will be in the .venv directory.

Examples

>>> import sys
>>> import subprocess
>>> from dffml import chdir, mkvenv
>>>
>>> with mkvenv() as tempdir:
...     with chdir(tempdir):
...         subprocess.check_call([
...             sys.executable,
...             "-m",
...             "pip",
...             "install",
...             "pip",
...         ])
0