venv-modulefile


Namevenv-modulefile JSON
Version 0.1.11 PyPI version JSON
download
home_pagehttps://github.com/code-coupling/venv-modulefile
SummaryPython venv extension using Modulefile
upload_time2024-07-08 15:49:04
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/23/94/84640e15fa623768c3cf8960b44329cae6458aacf0298096c4a17f891fa6/venv-modulefile-0.1.11.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.11",
    "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": "ddc3f515dd32f9044075392fccfe48484404a7f8c1d55b6ca2eee2df0f379a86",
                "md5": "705673718e710ad5016358cd96bb0f04",
                "sha256": "655984af079aca18a71949a6bde8be6e15bb46de33b624303348c83bf2628520"
            },
            "downloads": -1,
            "filename": "venv_modulefile-0.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "705673718e710ad5016358cd96bb0f04",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.6",
            "size": 6379432,
            "upload_time": "2024-07-08T15:49:00",
            "upload_time_iso_8601": "2024-07-08T15:49:00.472944Z",
            "url": "https://files.pythonhosted.org/packages/dd/c3/f515dd32f9044075392fccfe48484404a7f8c1d55b6ca2eee2df0f379a86/venv_modulefile-0.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "239484640e15fa623768c3cf8960b44329cae6458aacf0298096c4a17f891fa6",
                "md5": "922e94d6c107aa205f67d19501f187ca",
                "sha256": "10017027be6dd7a93c3d01d0142b30717af318ae088c87adb4c0d28861b21125"
            },
            "downloads": -1,
            "filename": "venv-modulefile-0.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "922e94d6c107aa205f67d19501f187ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.6",
            "size": 6384594,
            "upload_time": "2024-07-08T15:49:04",
            "upload_time_iso_8601": "2024-07-08T15:49:04.585806Z",
            "url": "https://files.pythonhosted.org/packages/23/94/84640e15fa623768c3cf8960b44329cae6458aacf0298096c4a17f891fa6/venv-modulefile-0.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-08 15:49:04",
    "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.76763s