Skip to main content

Python venv extension using Modulefile

Project description

venv-modulefile

Description

Tool to create Python complient environment from non-pythonic tools in a Python virtual environment.

It is based on Environment Module to modify the virtual environment.

The package offers several commands to build environment modules activated by the virtual environnment

Quick start

The following example adds foo/bar/baz to LD_LIBRARY_PATH when the environment is loaded

venvmod-initialize ${VIRTUAL_ENV}
venvmod-prepend-path ${VIRTUAL_ENV} LD_LIBRARY_PATH foo/bar/baz

Available commands

The list of available commands is the following:

  • venvmod-initialize is the first command to call. It is expected before everithing as it upgrades the virtual environment with modulefile.

  • The following commands modify the modulefile of the virtual environment:

    • venvmod-cmd-append-path / venvmod-cmd-prepend-path: modifies an environment variable
    • venvmod-cmd-module-load: loads a modulefile
    • venvmod-cmd-module-use: adds a search path for modulefile
    • venvmod-cmd-remove-path: removes path from environment variable
    • venvmod-cmd-setenv: defines an environment variable
    • venvmod-cmd-set-alias: defines an alias
    • venvmod-cmd-source-sh: sources a script
  • venvmod-cmd-read-env: reads modifications to do from environment variable:

    • [NAME]_LD_LIBRARY_PATH, [NAME]_PYTHONPATH, [NAME]_PATH: prepend for each element separated by ':'
    • [NAME]_MODULE_USE: module use for each element 'module' separated by ' '
    • [NAME]_MODULEFILES: module load for each element '/path/' separated by ' '
    • [NAME]_SOURCEFILES: source-sh for each element 'shell script [args...]' separated by ';'
    • [NAME]_EXPORTS: setenv for each element 'var=value' separated by ' '
    • [NAME]_ALIASES: set-alias for each element 'var="value"' separated by ' '
    • [NAME]_REMOVE_PATHS: remove-path for each element 'var=value' separated by ' ' where [NAME] is the name of the environment module (case insensitive, "-" and "." are replaced by "_").
  • venvmod-add-appli allows to create sub modulefile. --appli option of the above commands permit to modify these modulefiles.

  • venvmod-test-import: tests the import of modules given as argument

See --help option for cli description of each command.

The sequence to modify the environment respects the sequence of call of the different functions.

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

venv-modulefile-0.1.10.tar.gz (6.4 MB view details)

Uploaded Source

Built Distribution

venv_modulefile-0.1.10-py3-none-any.whl (6.4 MB view details)

Uploaded Python 3

File details

Details for the file venv-modulefile-0.1.10.tar.gz.

File metadata

  • Download URL: venv-modulefile-0.1.10.tar.gz
  • Upload date:
  • Size: 6.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for venv-modulefile-0.1.10.tar.gz
Algorithm Hash digest
SHA256 bf644ef7596720f722536bf6d26a6b2062ccbb29f36c0a730540fa827007e3f1
MD5 d3c5e71ec91a394b7d747800c5f8d527
BLAKE2b-256 abdb9c9d70922b0f717a921859853c08cd46e426e81ac9e9887dca5c0f9be528

See more details on using hashes here.

File details

Details for the file venv_modulefile-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: venv_modulefile-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 6.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for venv_modulefile-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 3791f600acc0fac82f4b7e8cc9c85ff48e04bb97228f8fd87f3dcd0b574ac70f
MD5 d0dcbe13ca21417a9c7b47200e819ac6
BLAKE2b-256 59274d7529f375364485c3fbb5692bd13f59d32548c4ec807d35610b1c6d72ae

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page