venv-modulefile


Namevenv-modulefile JSON
Version 0.1.12 PyPI version JSON
download
home_pagehttps://github.com/code-coupling/venv-modulefile
SummaryPython venv extension using Modulefile
upload_time2024-12-09 12:37:02
maintainerNone
docs_urlNone
authorR. Lenain
requires_python<4,>=3.6
licenseNone
keywords venv modulefile
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # venv-modulefile

[<img src="https://www.python.org/static/community_logos/python-logo-master-v3-TM.png" height="30"/>](Python)
[<img src="https://raw.githubusercontent.com/cea-hpc/modules/v5.2.0/doc/img/modules_red.svg" height="30" style="background-color: white"/>](Environment_Module)

- [venv-modulefile](#venv-modulefile)
  - [Description](#description)
  - [Quick start](#quick-start)
  - [Available commands](#available-commands)

## Description

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

It is based on [Environment Module](https://modules.readthedocs.io/en/latest/) 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

```bash

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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/code-coupling/venv-modulefile",
    "name": "venv-modulefile",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.6",
    "maintainer_email": null,
    "keywords": "venv, modulefile",
    "author": "R. Lenain",
    "author_email": "roland.lenain@cea.fr",
    "download_url": "https://files.pythonhosted.org/packages/9d/e4/922010742a1a886d339a8d4fc9c7c322826e3b752a5fe70aef285139ad8e/venv_modulefile-0.1.12.tar.gz",
    "platform": null,
    "description": "# venv-modulefile\n\n[<img src=\"https://www.python.org/static/community_logos/python-logo-master-v3-TM.png\" height=\"30\"/>](Python)\n[<img src=\"https://raw.githubusercontent.com/cea-hpc/modules/v5.2.0/doc/img/modules_red.svg\" height=\"30\" style=\"background-color: white\"/>](Environment_Module)\n\n- [venv-modulefile](#venv-modulefile)\n  - [Description](#description)\n  - [Quick start](#quick-start)\n  - [Available commands](#available-commands)\n\n## Description\n\nTool to create Python complient environment from non-pythonic tools in a Python virtual\nenvironment.\n\nIt is based on [Environment Module](https://modules.readthedocs.io/en/latest/) to\nmodify the virtual environment.\n\nThe package offers several commands to build environment modules activated by the virtual\nenvironnment\n\n## Quick start\n\nThe following example adds `foo/bar/baz` to `LD_LIBRARY_PATH` when the environment is loaded\n\n```bash\n\nvenvmod-initialize ${VIRTUAL_ENV}\nvenvmod-prepend-path ${VIRTUAL_ENV} LD_LIBRARY_PATH foo/bar/baz\n\n```\n\n## Available commands\n\nThe list of available commands is the following:\n\n- `venvmod-initialize` is the first command to call. It is expected before everithing as it upgrades\n  the virtual environment with modulefile.\n\n- The following commands modify the modulefile of the virtual environment:\n  - `venvmod-cmd-append-path` / `venvmod-cmd-prepend-path`: modifies an environment variable\n  - `venvmod-cmd-module-load`: loads a modulefile\n  - `venvmod-cmd-module-use`: adds a search path for modulefile\n  - `venvmod-cmd-remove-path`: removes path from environment variable\n  - `venvmod-cmd-setenv`: defines an environment variable\n  - `venvmod-cmd-set-alias`: defines an alias\n  - `venvmod-cmd-source-sh`: sources a script\n\n- `venvmod-cmd-read-env`: reads modifications to do from environment variable:\n  - `[NAME]_LD_LIBRARY_PATH`, `[NAME]_PYTHONPATH`, `[NAME]_PATH`: ``prepend`` for each element separated by ':'\n  - `[NAME]_MODULE_USE`: ``module use`` for each element 'module' separated by ' '\n  - `[NAME]_MODULEFILES`: ``module load`` for each element '/path/' separated by ' '\n  - `[NAME]_SOURCEFILES`: ``source-sh`` for each element 'shell script [args...]' separated by ';'\n  - `[NAME]_EXPORTS`: ``setenv`` for each element 'var=value' separated by ' '\n  - `[NAME]_ALIASES`: ``set-alias`` for each element 'var=\"value\"' separated by ' '\n  - `[NAME]_REMOVE_PATHS`: ``remove-path`` for each element 'var=value' separated by ' '\n  where `[NAME]` is the name of the environment module (case insensitive, \"-\" and \".\" are replaced by \"_\").\n\n- `venvmod-add-appli` allows to create sub modulefile. `--appli` option of the above commands\n  permit to modify these modulefiles.\n\n- `venvmod-test-import`: tests the import of modules given as argument\n\nSee `--help` option for cli description of each command.\n\nThe sequence to modify the environment respects the sequence of call of the different functions.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python venv extension using Modulefile",
    "version": "0.1.12",
    "project_urls": {
        "Bug Reports": "https://github.com/code-coupling/venv-modulefile/issues",
        "Doc": "https://venv-modulefile.readthedocs.io/en/latest/index.html",
        "Homepage": "https://github.com/code-coupling/venv-modulefile",
        "Source": "https://github.com/code-coupling/venv-modulefile"
    },
    "split_keywords": [
        "venv",
        " modulefile"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7ef6dee89655f14ded1b69774005b83212b0f518cae62fca954184bea464d5a",
                "md5": "a1935496134399c3a1bb46ae3d53b8f5",
                "sha256": "aad4862433fc9fdd0ea3d3470fc3959eca2198506a61d0ada80eb4400575e087"
            },
            "downloads": -1,
            "filename": "venv_modulefile-0.1.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a1935496134399c3a1bb46ae3d53b8f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.6",
            "size": 6379404,
            "upload_time": "2024-12-09T12:36:58",
            "upload_time_iso_8601": "2024-12-09T12:36:58.044144Z",
            "url": "https://files.pythonhosted.org/packages/a7/ef/6dee89655f14ded1b69774005b83212b0f518cae62fca954184bea464d5a/venv_modulefile-0.1.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9de4922010742a1a886d339a8d4fc9c7c322826e3b752a5fe70aef285139ad8e",
                "md5": "46efc08ef19571539608b50ecdf64b43",
                "sha256": "c69091c5aea0d6a3544cc55368319cc017480ead8b54521e5e85259d38413424"
            },
            "downloads": -1,
            "filename": "venv_modulefile-0.1.12.tar.gz",
            "has_sig": false,
            "md5_digest": "46efc08ef19571539608b50ecdf64b43",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.6",
            "size": 6384284,
            "upload_time": "2024-12-09T12:37:02",
            "upload_time_iso_8601": "2024-12-09T12:37:02.471700Z",
            "url": "https://files.pythonhosted.org/packages/9d/e4/922010742a1a886d339a8d4fc9c7c322826e3b752a5fe70aef285139ad8e/venv_modulefile-0.1.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-09 12:37:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "code-coupling",
    "github_project": "venv-modulefile",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "venv-modulefile"
}
        
Elapsed time: 0.38609s