A project for installing packages across the virtualenv boundary.
Project description
Summary
Mork is a library designed for installing and querying python packages inside virtual environments.
🐉 See What’s Installed
>>> import mork >>> venv = mork.VirtualEnv.from_project_path('/home/user/git/pipenv') >>> dists = venv.get_distributions() >>> [dist for dist in dists][:3] [wheel 0.31.1 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages), Werkzeug 0.14.1 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages), vistir 0.1.4 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages)]
🐉 Install A Package
>>> from requirementslib.models.requirements import Requirement >>> r = Requirement.from_line("requests") >>> venv.install(r, editable=False)
🐉 Uninstall a Package
>>> pkg = "pytz" >>> with venv.uninstall(pkg, auto_confirm=True) as uninstall: if uninstall.paths: cleaned = pkg >>> print("Removed package: %s" % cleaned)
🐉 Display Information about Python
>>> venv.python '/home/user/.virtualenvs/pipenv-MfOPs1lW/bin/python' >>> venv.python_version '3.7'
🐉 Run Commands Inside the Virtualenv
>>> cmd = venv.run("env") >>> [line for line in cmd.out.splitlines() if line.startswith("VIRTUAL_ENV")] ['VIRTUAL_ENV=/user/hawk/.virtualenvs/pipenv-MfOPs1lW'] >>> cmd = venv.run_py(["import os; print(os.environ.get('VIRTUAL_ENV'))"]) Deactivating virtualenv... >>> cmd.out '/home/user/.virtualenvs/pipenv-MfOPs1lW\n' >>> with venv.activated(): print(os.environ["VIRTUAL_ENV"]) /home/hawk/.virtualenvs/pipenv-MfOPs1lW
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
mork-0.1.3.tar.gz
(14.3 kB
view details)
Built Distribution
File details
Details for the file mork-0.1.3.tar.gz
.
File metadata
- Download URL: mork-0.1.3.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0e7eb660c6406390d6ae725beb788110620edb099836ea5c32664041247fb58 |
|
MD5 | 5e84442b7098a7a00d890b08d8e03f46 |
|
BLAKE2b-256 | aed8829b214a479f8a03592a44326e783479e619a34e3ac4e98edeafe1e4719f |
File details
Details for the file mork-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: mork-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0efda9d3f77d05d7f14af5f1263dac25a4c398ae6b838de95e1ce20e6b5b2213 |
|
MD5 | 1023b65902f34f364a50af6f32a609c5 |
|
BLAKE2b-256 | 6165daa880585ba1444d845468d40a710c3e991c85e3f7db2f5366848f6fcfb3 |