venv-iris


Namevenv-iris JSON
Version 0.0.1 PyPI version JSON
download
home_pageNone
SummaryCreate a virtual environment for InterSystems IRIS
upload_time2024-07-04 14:12:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Guillaume Rongier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords iris intersystems python embedded
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # venv-iris

This module is an extension of the virtual environment module in Python. 

It is designed to be used with the Iris dataplatfrom.

It brings the following features:
- Automatic binding of the virtual environment to the Iris dataplatform
- Automatic unbinding of the virtual environment from the Iris dataplatform

Limitation:
- the binding and unbinding is only available for the whole instance of IRIS. It is not possible to bind and unbind a virtual environment to a specific project/namespace.

## Installation

```bash
pip install venv-iris
```

## Usage 

For creating a virtual environment with the Iris dataplatform, use the following command:

### Unix

```bash
python3 -m venv-iris .venv-iris
source .venv-iris/bin/activate
```

### Windows

```ps1
python -m venv-iris .venv-iris
.venv-iris\Scripts\Activate.ps1
```

Then if you want to install a package, you can use the following command:

```bash
pip install <package>
```

To bind the virtual environment to the Iris dataplatform, use the following command:

```bash
bind
```

To unbind the virtual environment from the Iris dataplatform, use the following command:

```bash
unbind
```

To deactivate the virtual environment, use the following command:

```bash
deactivate
```

### Options

- `--isc-package-installdir` to specify the instance of IRIS to bind to. By default, it will use the instance of IRIS that is running on the same machine if the environment variable `ISC_PACKAGE_INSTALLDIR` is set.

```bash
python3 -m venv-iris .venv-iris --isc-package-installdir /usr/irissys
```

## Use case example

I want to install the package `requests` in a virtual environment that is binded to the Iris dataplatform.

Like this I will have the same experience as if I was using the Iris dataplatform directly from an IRIS instance.

```bash
python3 -m venv-iris .venv-iris
source .venv-iris/bin/activate
pip install requests
bind
```

Optionally, you can use the `iris` package to interact with the Iris dataplatform directly from the virtual environment.

```bash
python3
>>> import iris
>>> iris.system.version.GetVersion()
'IRIS for UNIX (Apple Silicon) 2024.2.0 (Build 311U) Tue Feb  8 2024 14:00:00 EST'
```

Now run an IRIS Terminal and you will be able to import the `requests` package.

```bash
iris session iris
USER>do ##class(%SYS.Python).Shell()

Python 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type quit() or Ctrl-D to exit this shell.
>>> import requests
>>>
```

Now if you unbind the virtual environment, you will not be able to import the `requests` package anymore.

```bash
unbind
```

```bash
iris session
USER>do ##class(%SYS.Python).Shell()

Python 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type quit() or Ctrl-D to exit this shell.
>>> import requests
Traceback (most recent call last):
  File "<input>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'
>>>
```

## Benefits

- You can use any package available on PyPI
- You can use any version of Python
- You can use any version of the package
- You can develop your code locally and then deploy it on the Iris dataplatform
- You can use `import iris` in your code to interact with the Iris as if you were using the Iris dataplatform directly from an IRIS instance
- You can share the same instance of IRIS for multiple projects without having conflicts between the packages

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "venv-iris",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "iris, intersystems, python, embedded",
    "author": null,
    "author_email": "grongier <guillaume.rongier@intersystems.com>",
    "download_url": "https://files.pythonhosted.org/packages/be/8f/b39dd98da720692b7e1e627534720f52c440a75ee2352970a508a3b3b3e5/venv_iris-0.0.1.tar.gz",
    "platform": null,
    "description": "# venv-iris\n\nThis module is an extension of the virtual environment module in Python. \n\nIt is designed to be used with the Iris dataplatfrom.\n\nIt brings the following features:\n- Automatic binding of the virtual environment to the Iris dataplatform\n- Automatic unbinding of the virtual environment from the Iris dataplatform\n\nLimitation:\n- the binding and unbinding is only available for the whole instance of IRIS. It is not possible to bind and unbind a virtual environment to a specific project/namespace.\n\n## Installation\n\n```bash\npip install venv-iris\n```\n\n## Usage \n\nFor creating a virtual environment with the Iris dataplatform, use the following command:\n\n### Unix\n\n```bash\npython3 -m venv-iris .venv-iris\nsource .venv-iris/bin/activate\n```\n\n### Windows\n\n```ps1\npython -m venv-iris .venv-iris\n.venv-iris\\Scripts\\Activate.ps1\n```\n\nThen if you want to install a package, you can use the following command:\n\n```bash\npip install <package>\n```\n\nTo bind the virtual environment to the Iris dataplatform, use the following command:\n\n```bash\nbind\n```\n\nTo unbind the virtual environment from the Iris dataplatform, use the following command:\n\n```bash\nunbind\n```\n\nTo deactivate the virtual environment, use the following command:\n\n```bash\ndeactivate\n```\n\n### Options\n\n- `--isc-package-installdir` to specify the instance of IRIS to bind to. By default, it will use the instance of IRIS that is running on the same machine if the environment variable `ISC_PACKAGE_INSTALLDIR` is set.\n\n```bash\npython3 -m venv-iris .venv-iris --isc-package-installdir /usr/irissys\n```\n\n## Use case example\n\nI want to install the package `requests` in a virtual environment that is binded to the Iris dataplatform.\n\nLike this I will have the same experience as if I was using the Iris dataplatform directly from an IRIS instance.\n\n```bash\npython3 -m venv-iris .venv-iris\nsource .venv-iris/bin/activate\npip install requests\nbind\n```\n\nOptionally, you can use the `iris` package to interact with the Iris dataplatform directly from the virtual environment.\n\n```bash\npython3\n>>> import iris\n>>> iris.system.version.GetVersion()\n'IRIS for UNIX (Apple Silicon) 2024.2.0 (Build 311U) Tue Feb  8 2024 14:00:00 EST'\n```\n\nNow run an IRIS Terminal and you will be able to import the `requests` package.\n\n```bash\niris session iris\nUSER>do ##class(%SYS.Python).Shell()\n\nPython 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin\nType quit() or Ctrl-D to exit this shell.\n>>> import requests\n>>>\n```\n\nNow if you unbind the virtual environment, you will not be able to import the `requests` package anymore.\n\n```bash\nunbind\n```\n\n```bash\niris session\nUSER>do ##class(%SYS.Python).Shell()\n\nPython 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin\nType quit() or Ctrl-D to exit this shell.\n>>> import requests\nTraceback (most recent call last):\n  File \"<input>\", line 1, in <module>\nModuleNotFoundError: No module named 'requests'\n>>>\n```\n\n## Benefits\n\n- You can use any package available on PyPI\n- You can use any version of Python\n- You can use any version of the package\n- You can develop your code locally and then deploy it on the Iris dataplatform\n- You can use `import iris` in your code to interact with the Iris as if you were using the Iris dataplatform directly from an IRIS instance\n- You can share the same instance of IRIS for multiple projects without having conflicts between the packages\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Guillaume Rongier  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Create a virtual environment for InterSystems IRIS",
    "version": "0.0.1",
    "project_urls": {
        "documentation": "https://github.com/grongierisc/venv-iris/blob/master/README.md",
        "homepage": "https://github.com/grongierisc/venv-iris",
        "issues": "https://github.com/grongierisc/venv-iris/issues",
        "repository": "https://github.com/grongierisc/venv-iris"
    },
    "split_keywords": [
        "iris",
        " intersystems",
        " python",
        " embedded"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2fb3d37fb7e8b464d0c7dde7fd60ecaa24d2705cacc1ad1167d27973c8eb6c6e",
                "md5": "8f373e59a9e963f0b054af0c03ec0e5d",
                "sha256": "870c0209a9a9fc77afce6ca2a522f5180ffc28a954c3528abae8f4e497d7e180"
            },
            "downloads": -1,
            "filename": "venv_iris-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f373e59a9e963f0b054af0c03ec0e5d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18197,
            "upload_time": "2024-07-04T14:12:46",
            "upload_time_iso_8601": "2024-07-04T14:12:46.618686Z",
            "url": "https://files.pythonhosted.org/packages/2f/b3/d37fb7e8b464d0c7dde7fd60ecaa24d2705cacc1ad1167d27973c8eb6c6e/venv_iris-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be8fb39dd98da720692b7e1e627534720f52c440a75ee2352970a508a3b3b3e5",
                "md5": "0f89193823ede63f3eedde991774cac7",
                "sha256": "7472736fe5405c4cf5ebc2a0c4033989cb7b1393e7804ecdd79db7e32c6c6efb"
            },
            "downloads": -1,
            "filename": "venv_iris-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0f89193823ede63f3eedde991774cac7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 17166,
            "upload_time": "2024-07-04T14:12:48",
            "upload_time_iso_8601": "2024-07-04T14:12:48.204436Z",
            "url": "https://files.pythonhosted.org/packages/be/8f/b39dd98da720692b7e1e627534720f52c440a75ee2352970a508a3b3b3e5/venv_iris-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-04 14:12:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "grongierisc",
    "github_project": "venv-iris",
    "github_not_found": true,
    "lcname": "venv-iris"
}
        
Elapsed time: 0.35773s