venvception


Namevenvception JSON
Version 0.0.5 PyPI version JSON
download
home_page
SummaryInstall requirements and run code in virtual environments from the comfort of your own GIL
upload_time2024-02-26 19:57:07
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords virtualenv dependencies
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Venvception

[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/moradology/venvception/cicd.yaml?style=for-the-badge)](https://github.com/moradology/venvception/actions/workflows/cicd.yaml)

Venvception is a Python library designed to simplify the process of creating and using temporary virtual environments when you have good reason to stay in the same process. It provides a context manager that automates the setup of a virtual environment, installs specified packages from a `requirements.txt` file, and ensures that the environment is used for the duration of the context.

![venvception in action](https://github.com/moradology/venvception/blob/main/venvception.png?raw=true)

## Why?

In distributed contexts, it can be convenient to ship a requirements specification rather than pre-baking containers. This library is quick and dirty.

## Installation

To install Venvception, run the following command:

```bash
pip install venvception
```

## Quick Start / Usage

Here's a simple example to get started with Venvception:

```python
from venvception import venv
from pathlib import Path

# Specify the path to your requirements file
requirements_path = Path("path/to/your/requirements.txt")

# Use the venv context manager to create and activate the virtual environment
with venv(requirements_path) as venv_path:
    # Import a module from the requirements.txt
    import your_module

    # You can also access the path to the virtual environment via `venv_path`
    print(f"Virtual environment created at: {venv_path}")
```

Ensure your `requirements.txt` file is properly formatted and accessible at the specified path.

### Accessing the Virtual Environment's Path

The context manager yields the path to the temporary virtual environment, allowing you to interact with it directly:

```python
with venv(Path("requirements.txt")) as venv_path:
    print(venv_path)
```

## Contributing

Contributions to Venvception are welcome! Please feel free to submit pull requests, report bugs, or suggest features through the issue tracker.

## License

Venvception is released under the [MIT License](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "venvception",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "virtualenv,dependencies",
    "author": "",
    "author_email": "Nathan Zimmerman <npzimmerman@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fe/e9/ef8ed5fd8864400fd30b73ae3c64ccc7934c54059502f0a750a1123ddca1/venvception-0.0.5.tar.gz",
    "platform": null,
    "description": "# Venvception\n\n[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/moradology/venvception/cicd.yaml?style=for-the-badge)](https://github.com/moradology/venvception/actions/workflows/cicd.yaml)\n\nVenvception is a Python library designed to simplify the process of creating and using temporary virtual environments when you have good reason to stay in the same process. It provides a context manager that automates the setup of a virtual environment, installs specified packages from a `requirements.txt` file, and ensures that the environment is used for the duration of the context.\n\n![venvception in action](https://github.com/moradology/venvception/blob/main/venvception.png?raw=true)\n\n## Why?\n\nIn distributed contexts, it can be convenient to ship a requirements specification rather than pre-baking containers. This library is quick and dirty.\n\n## Installation\n\nTo install Venvception, run the following command:\n\n```bash\npip install venvception\n```\n\n## Quick Start / Usage\n\nHere's a simple example to get started with Venvception:\n\n```python\nfrom venvception import venv\nfrom pathlib import Path\n\n# Specify the path to your requirements file\nrequirements_path = Path(\"path/to/your/requirements.txt\")\n\n# Use the venv context manager to create and activate the virtual environment\nwith venv(requirements_path) as venv_path:\n    # Import a module from the requirements.txt\n    import your_module\n\n    # You can also access the path to the virtual environment via `venv_path`\n    print(f\"Virtual environment created at: {venv_path}\")\n```\n\nEnsure your `requirements.txt` file is properly formatted and accessible at the specified path.\n\n### Accessing the Virtual Environment's Path\n\nThe context manager yields the path to the temporary virtual environment, allowing you to interact with it directly:\n\n```python\nwith venv(Path(\"requirements.txt\")) as venv_path:\n    print(venv_path)\n```\n\n## Contributing\n\nContributions to Venvception are welcome! Please feel free to submit pull requests, report bugs, or suggest features through the issue tracker.\n\n## License\n\nVenvception is released under the [MIT License](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Install requirements and run code in virtual environments from the comfort of your own GIL",
    "version": "0.0.5",
    "project_urls": {
        "homepage": "https://github.com/moradology/venvception",
        "repository": "https://github.com/moradology/venvception.git"
    },
    "split_keywords": [
        "virtualenv",
        "dependencies"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8cca58aa9332be75a1af80f10120026f0c85ef58b9676a4b7db3cc333a4af91",
                "md5": "6403738e3fdeaf2520b0714e93741cfe",
                "sha256": "cace2eb4e7f0ace1330bac8b1f5bdeed8b2c1dae8a5affc413efde7b21884f53"
            },
            "downloads": -1,
            "filename": "venvception-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6403738e3fdeaf2520b0714e93741cfe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5077,
            "upload_time": "2024-02-26T19:57:05",
            "upload_time_iso_8601": "2024-02-26T19:57:05.865877Z",
            "url": "https://files.pythonhosted.org/packages/e8/cc/a58aa9332be75a1af80f10120026f0c85ef58b9676a4b7db3cc333a4af91/venvception-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fee9ef8ed5fd8864400fd30b73ae3c64ccc7934c54059502f0a750a1123ddca1",
                "md5": "7dc35ee3379b649d54ca0e057f581a08",
                "sha256": "d947332bef0ae911f117eedd21f457dd1abd0f34c8aee1cc89c4daef6dc239f0"
            },
            "downloads": -1,
            "filename": "venvception-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "7dc35ee3379b649d54ca0e057f581a08",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5851,
            "upload_time": "2024-02-26T19:57:07",
            "upload_time_iso_8601": "2024-02-26T19:57:07.413447Z",
            "url": "https://files.pythonhosted.org/packages/fe/e9/ef8ed5fd8864400fd30b73ae3c64ccc7934c54059502f0a750a1123ddca1/venvception-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-26 19:57:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "moradology",
    "github_project": "venvception",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "venvception"
}
        
Elapsed time: 2.01221s