# xontrib-langenv
[xonsh](https://xon.sh) integration with:
* [Pyenv](https://github.com/pyenv/pyenv)
* [Nodenv](https://github.com/nodenv/nodenv)
* [Goenv](https://github.com/syndbg/goenv)
* [Rbenv](https://github.com/rbenv/rbenv)
This xontrib replaces the slow `langenv` initialization with a faster python version (and skips the `rehash` step), which could save up to ~0.5s for each `lang`
The only two exceptions are:
- `goenv`, which requires an extra `rehash --only-manage-paths` [init step](https://github.com/syndbg/goenv/blob/e1007619dbb180c8f8032a9dcdb7afbeb88e848a/libexec/goenv-init#L167) to set some more [environment variables](https://github.com/syndbg/goenv/blob/e1007619dbb180c8f8032a9dcdb7afbeb88e848a/libexec/goenv-sh-rehash#L24)
- `virtualenv-init`
so if you rewrite that `goenv` env var setting and `pyenv` `virtualenv` init logic in python and xontribute to this xontrib, you could eliminate the last sources of xonsh langenv startup delay!
## Install
Install using pip
```
pip install xontrib-langenv
```
## Usage
Add to your `.xonshrc` as follows:
### Pyenv
```sh
xontrib load pyenv
```
This xontrib initializes `pyenv` when `xonsh` is started.
After initialization `pyenv` commands works as they would do in any *classic* shell.
Also supports [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv).
### Nodenv
```sh
xontrib load nodenv
```
This xontrib initializes `nodenv` when `xonsh` is started.
After initialization `nodenv` commands works as they would do in any *classic* shell.
### Goenv
```sh
xontrib load goenv
```
This xontrib initializes `goenv` when `xonsh` is started.
After initialization `goenv` commands works as they would do in any *classic* shell.
### Rbenv
```sh
xontrib load rbenv
```
This xontrib initializes `rbenv` when `xonsh` is started.
After initialization `rbenv` commands works as they would do in any *classic* shell.
## Compatibility notes
If you are using `xonsh` v0.11 (or older) and you have issues with the latest version of this xontrib, try to downgrade it to version 1.0.6.
Raw data
{
"_id": null,
"home_page": "https://github.com/dyuri/xontrib-langenv",
"name": "xontrib-langenv",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Gyuri Horak",
"author_email": "dyuri@horak.hu",
"download_url": "https://files.pythonhosted.org/packages/13/e7/d0d9ed4832a6c3a67ba94daf61466a2dd7d33838bfb0bc5a133025a1cd39/xontrib_langenv-1.2.2.tar.gz",
"platform": null,
"description": "# xontrib-langenv\n\n[xonsh](https://xon.sh) integration with:\n\n* [Pyenv](https://github.com/pyenv/pyenv)\n* [Nodenv](https://github.com/nodenv/nodenv)\n* [Goenv](https://github.com/syndbg/goenv)\n* [Rbenv](https://github.com/rbenv/rbenv)\n\nThis xontrib replaces the slow `langenv` initialization with a faster python version (and skips the `rehash` step), which could save up to ~0.5s for each `lang`\n\nThe only two exceptions are:\n\n - `goenv`, which requires an extra `rehash --only-manage-paths` [init step](https://github.com/syndbg/goenv/blob/e1007619dbb180c8f8032a9dcdb7afbeb88e848a/libexec/goenv-init#L167) to set some more [environment variables](https://github.com/syndbg/goenv/blob/e1007619dbb180c8f8032a9dcdb7afbeb88e848a/libexec/goenv-sh-rehash#L24)\n - `virtualenv-init`\n\nso if you rewrite that `goenv` env var setting and `pyenv` `virtualenv` init logic in python and xontribute to this xontrib, you could eliminate the last sources of xonsh langenv startup delay!\n\n## Install\n\nInstall using pip\n\n```\npip install xontrib-langenv\n```\n\n## Usage\n\nAdd to your `.xonshrc` as follows:\n\n### Pyenv\n\n```sh\nxontrib load pyenv\n```\n\nThis xontrib initializes `pyenv` when `xonsh` is started.\nAfter initialization `pyenv` commands works as they would do in any *classic* shell.\n\nAlso supports [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv).\n\n### Nodenv\n\n```sh\nxontrib load nodenv\n```\n\nThis xontrib initializes `nodenv` when `xonsh` is started.\nAfter initialization `nodenv` commands works as they would do in any *classic* shell.\n\n### Goenv\n\n```sh\nxontrib load goenv\n```\n\nThis xontrib initializes `goenv` when `xonsh` is started.\nAfter initialization `goenv` commands works as they would do in any *classic* shell.\n\n### Rbenv\n\n```sh\nxontrib load rbenv\n```\n\nThis xontrib initializes `rbenv` when `xonsh` is started.\nAfter initialization `rbenv` commands works as they would do in any *classic* shell.\n\n## Compatibility notes\n\nIf you are using `xonsh` v0.11 (or older) and you have issues with the latest version of this xontrib, try to downgrade it to version 1.0.6.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pyenv/Nodenv/Goenv/Rbenv integration for xonsh",
"version": "1.2.2",
"project_urls": {
"Homepage": "https://github.com/dyuri/xontrib-langenv",
"Repository": "https://github.com/dyuri/xontrib-langenv"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ada69e1ebb6ebc159b27ae047d6e28231bf967103fe97cfb8d00e9e0087d20e7",
"md5": "b33031beaa81772bc2852b6b349a9465",
"sha256": "de2fb29e4b125990370b7107c59d692620ae76fa5019b33571ce65de9647466d"
},
"downloads": -1,
"filename": "xontrib_langenv-1.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b33031beaa81772bc2852b6b349a9465",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 5594,
"upload_time": "2024-08-13T18:43:42",
"upload_time_iso_8601": "2024-08-13T18:43:42.999868Z",
"url": "https://files.pythonhosted.org/packages/ad/a6/9e1ebb6ebc159b27ae047d6e28231bf967103fe97cfb8d00e9e0087d20e7/xontrib_langenv-1.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "13e7d0d9ed4832a6c3a67ba94daf61466a2dd7d33838bfb0bc5a133025a1cd39",
"md5": "566dfc59fefd9dc87bbe3c28f0c58bd7",
"sha256": "949b5cc2e6b5889e7eb0a9631587c168ff210d84d91747581f4069ee03065952"
},
"downloads": -1,
"filename": "xontrib_langenv-1.2.2.tar.gz",
"has_sig": false,
"md5_digest": "566dfc59fefd9dc87bbe3c28f0c58bd7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 3601,
"upload_time": "2024-08-13T18:43:44",
"upload_time_iso_8601": "2024-08-13T18:43:44.648945Z",
"url": "https://files.pythonhosted.org/packages/13/e7/d0d9ed4832a6c3a67ba94daf61466a2dd7d33838bfb0bc5a133025a1cd39/xontrib_langenv-1.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-13 18:43:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dyuri",
"github_project": "xontrib-langenv",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "xontrib-langenv"
}