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. The appli can be removed unsing venvmod-rm-appli

  • 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.19.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

venv_modulefile-0.1.19-py3-none-any.whl (8.8 MB view details)

Uploaded Python 3

File details

Details for the file venv_modulefile-0.1.19.tar.gz.

File metadata

  • Download URL: venv_modulefile-0.1.19.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for venv_modulefile-0.1.19.tar.gz
Algorithm Hash digest
SHA256 eec3e7592d768161436b1f0780017f8458a45a16832f13106fce3664094d66c8
MD5 24c1c750717fc683868343d866488482
BLAKE2b-256 6d9c1fabee69eaadfed6e827939d7c9aba296a2965ec1018aff47a952b15e5f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for venv_modulefile-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 41a741fdf6796435370cbd6ff604d3942d449c249802cc729b54a38b63621050
MD5 062b197af45d8106c55d88923ec6b99f
BLAKE2b-256 36c15d76a52c8b58b3be7d8a36de63da0ebaa5c36e14703026d79366fd07aeab

See more details on using hashes here.

Supported by

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