venv-modulefile


Namevenv-modulefile JSON
Version 0.1.5 PyPI version JSON
download
home_pagehttps://github.com/code-coupling/venv-modulefile
SummaryPython venv extension using Modulefile
upload_time2024-04-16 10:41:15
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/44/a4/eeb3b81f8f02d248ef2e817ab9b146994d247eaecf959165bd35533e2a27/venv-modulefile-0.1.5.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\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python venv extension using Modulefile",
    "version": "0.1.5",
    "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": "d4de9cf866d291ff7d5763ba5dfdfa72d852ddd481040c8c26bdcfb205a23698",
                "md5": "83d72c2671d3c245f32392bca698837c",
                "sha256": "964f1edb7caff372f44d72e138cdd1afbe6f4bc7d4dad9a5bc835770504c784d"
            },
            "downloads": -1,
            "filename": "venv_modulefile-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "83d72c2671d3c245f32392bca698837c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.6",
            "size": 6379599,
            "upload_time": "2024-04-16T10:41:11",
            "upload_time_iso_8601": "2024-04-16T10:41:11.384603Z",
            "url": "https://files.pythonhosted.org/packages/d4/de/9cf866d291ff7d5763ba5dfdfa72d852ddd481040c8c26bdcfb205a23698/venv_modulefile-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44a4eeb3b81f8f02d248ef2e817ab9b146994d247eaecf959165bd35533e2a27",
                "md5": "09fd7a7d53c47b753e68e48a18d88c25",
                "sha256": "a9cbe45162fa5c5c6224704dd71f11815e5c24b119d527e01264ae86069c1831"
            },
            "downloads": -1,
            "filename": "venv-modulefile-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "09fd7a7d53c47b753e68e48a18d88c25",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.6",
            "size": 6382102,
            "upload_time": "2024-04-16T10:41:15",
            "upload_time_iso_8601": "2024-04-16T10:41:15.239365Z",
            "url": "https://files.pythonhosted.org/packages/44/a4/eeb3b81f8f02d248ef2e817ab9b146994d247eaecf959165bd35533e2a27/venv-modulefile-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 10:41:15",
    "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.24213s