xontrib-mise


Namexontrib-mise JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/eugenesvk/xontrib-mise
SummaryInitializes mise (polyglot asdf-like runtime manager)
upload_time2024-02-28 16:53:25
maintainer
docs_urlNone
authorEvgeny
requires_python>=3.8
licenseMIT
keywords xontrib xonsh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
Initialize <a href="https://github.com/jdx/mise" target="_blank">mise</a> (polyglot asdf-like runtime manager in Rust)</br>
in a more performant and flexible way
</p>

<p align="center">  
If you like the idea click ⭐ on the repo and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/eugenesvk/xontrib-mise" target="_blank">tweet</a>.
</p>

This xontrib adds a couple of (maybe too tiny to notice) improvements:

  - (no cost) replaces the subprocess syntax for the hook mise function with a pure python syntax, which for some reason improves hook runtime by __~60%__ (but in absolute terms maybe just a dozen or two `ms`)
  - (less convenient) replaces a hook on every prompt paint with hooks on
    - shell launch
    - changing dirs
    - empty commands</br>
      useful to refresh shell status when you edit `.tool-versions` _outside_ of shell (optional)
    - commands that containt custom text chunks</br>
      useful to refresh shell status when you edit `.tool-versions`  _in_ a shell (optional)

## Installation

To install use pip:

```bash
xpip install xontrib-mise
# or: xpip install -U git+https://github.com/eugenesvk/xontrib-mise
```

## Usage

This xontrib requires `mise` to be in `PATH` or `~/bin`; or if it's added to `PATH` via another xontrib (e.g, you installed it via Homebrew and use `xontrib-homebrew`), then you should load this xontrib after the one setting `PATH`

1. Add the following to your `.py` xontrib loading config and `import` it in your xonsh run control file (`~/.xonshrc` or `~/.config/rc.xsh`):
```py
from xonsh.xontribs 	import xontribs_load
from xonsh.built_ins	import XSH
envx = XSH.env

xontribs = [ "mise", # Initializes mise (polyglot asdf-like runtime manager)
 # your other xontribs
]
# ↓ optional configuration variables
if 'mise' in xontribs: # Configure mise only if you're actually loading
  # config var                        	  value             	  |default|alt_cmd¦ comment
  envx['XONTRIB_MISE_CHUNK_LIST']     	= ['.tool-versions']	# |['.tool-versions']|False¦ (feeble attempts to track edits to `.tool-versions` in the command line) update mise status if command contains any of the string chunks in this list; False to disable this listener completely
  envx['XONTRIB_MISE_NEWLINE_REFRESH']	= True              	# |True|False¦ update mise status if command is empty (e.g, ⏎ on a blank line to refresh after editing `.tool-versions` in a text editor); False to disable this listener completely
  envx['XONTRIB_MISE_FORCE_COLOR']    	= True              	# |True|False¦ preserve colored mise output
  envx['XONTRIB_MISE_LOGLEVEL']       	= 1                 	# |1|0¦ print xontrib log messages: 0 none, 1 error; 'mise' stderr is always passed through
# (old variables with _RTX_ in the name continue to work)
xontribs_load(xontribs) # actually load all xontribs in the list
```

2. Or just add this to your xonsh run control file
```xsh
xontrib load mise # Initializes mise (polyglot asdf-like runtime manager)
# configure like in the example above, but replace envx['VAR'] with $VAR
$XONTRIB_MISE_LOGLEVEL = 1
```

## Known issues

- In the future xontrib-mise will be autoloaded, but this is currently blocked due to a [xonsh bug](https://github.com/xonsh/xonsh/issues/5020): too early autoload prevens reading user config; also, autoloading can't be disabled

## Credits

This package was created with [xontrib template](https://github.com/xonsh/xontrib-template)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eugenesvk/xontrib-mise",
    "name": "xontrib-mise",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "xontrib,xonsh",
    "author": "Evgeny",
    "author_email": "es.bugzilla@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0c/c9/3f06cf7f5737340549e993480a10e1972db8a72e59c7afbd0d84bd28bed7/xontrib_mise-0.0.1.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\nInitialize <a href=\"https://github.com/jdx/mise\" target=\"_blank\">mise</a> (polyglot asdf-like runtime manager in Rust)</br>\nin a more performant and flexible way\n</p>\n\n<p align=\"center\">  \nIf you like the idea click \u2b50 on the repo and <a href=\"https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/eugenesvk/xontrib-mise\" target=\"_blank\">tweet</a>.\n</p>\n\nThis xontrib adds a couple of (maybe too tiny to notice) improvements:\n\n  - (no cost) replaces the subprocess syntax for the hook mise function with a pure python syntax, which for some reason improves hook runtime by __~60%__ (but in absolute terms maybe just a dozen or two `ms`)\n  - (less convenient) replaces a hook on every prompt paint with hooks on\n    - shell launch\n    - changing dirs\n    - empty commands</br>\n      useful to refresh shell status when you edit `.tool-versions` _outside_ of shell (optional)\n    - commands that containt custom text chunks</br>\n      useful to refresh shell status when you edit `.tool-versions`  _in_ a shell (optional)\n\n## Installation\n\nTo install use pip:\n\n```bash\nxpip install xontrib-mise\n# or: xpip install -U git+https://github.com/eugenesvk/xontrib-mise\n```\n\n## Usage\n\nThis xontrib requires `mise` to be in `PATH` or `~/bin`; or if it's added to `PATH` via another xontrib (e.g, you installed it via Homebrew and use `xontrib-homebrew`), then you should load this xontrib after the one setting `PATH`\n\n1. Add the following to your `.py` xontrib loading config and `import` it in your xonsh run control file (`~/.xonshrc` or `~/.config/rc.xsh`):\n```py\nfrom xonsh.xontribs \timport xontribs_load\nfrom xonsh.built_ins\timport XSH\nenvx = XSH.env\n\nxontribs = [ \"mise\", # Initializes mise (polyglot asdf-like runtime manager)\n # your other xontribs\n]\n# \u2193 optional configuration variables\nif 'mise' in xontribs: # Configure mise only if you're actually loading\n  # config var                        \t  value             \t  |default|alt_cmd\u00a6 comment\n  envx['XONTRIB_MISE_CHUNK_LIST']     \t= ['.tool-versions']\t# |['.tool-versions']|False\u00a6 (feeble attempts to track edits to `.tool-versions` in the command line) update mise status if command contains any of the string chunks in this list; False to disable this listener completely\n  envx['XONTRIB_MISE_NEWLINE_REFRESH']\t= True              \t# |True|False\u00a6 update mise status if command is empty (e.g, \u23ce on a blank line to refresh after editing `.tool-versions` in a text editor); False to disable this listener completely\n  envx['XONTRIB_MISE_FORCE_COLOR']    \t= True              \t# |True|False\u00a6 preserve colored mise output\n  envx['XONTRIB_MISE_LOGLEVEL']       \t= 1                 \t# |1|0\u00a6 print xontrib log messages: 0 none, 1 error; 'mise' stderr is always passed through\n# (old variables with _RTX_ in the name continue to work)\nxontribs_load(xontribs) # actually load all xontribs in the list\n```\n\n2. Or just add this to your xonsh run control file\n```xsh\nxontrib load mise # Initializes mise (polyglot asdf-like runtime manager)\n# configure like in the example above, but replace envx['VAR'] with $VAR\n$XONTRIB_MISE_LOGLEVEL = 1\n```\n\n## Known issues\n\n- In the future xontrib-mise will be autoloaded, but this is currently blocked due to a [xonsh bug](https://github.com/xonsh/xonsh/issues/5020): too early autoload prevens reading user config; also, autoloading can't be disabled\n\n## Credits\n\nThis package was created with [xontrib template](https://github.com/xonsh/xontrib-template)\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Initializes mise (polyglot asdf-like runtime manager)",
    "version": "0.0.1",
    "project_urls": {
        "Code": "https://github.com/eugenesvk/xontrib-mise",
        "Documentation": "https://github.com/eugenesvk/xontrib-mise/blob/master/README.md",
        "Homepage": "https://github.com/eugenesvk/xontrib-mise",
        "Issue tracker": "https://github.com/eugenesvk/xontrib-mise/issues",
        "Repository": "https://github.com/eugenesvk/xontrib-mise"
    },
    "split_keywords": [
        "xontrib",
        "xonsh"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "156b99e88ad08f67859f803e3e0b10febb95936c3cd2552b9900bc50da14db05",
                "md5": "6989b3069f9c4000af0d0e3984a0e909",
                "sha256": "7136cad51514172eaa566c42baad0f23d01ee42fff8b0a5847e4e7217975ee88"
            },
            "downloads": -1,
            "filename": "xontrib_mise-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6989b3069f9c4000af0d0e3984a0e909",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5286,
            "upload_time": "2024-02-28T16:53:22",
            "upload_time_iso_8601": "2024-02-28T16:53:22.593254Z",
            "url": "https://files.pythonhosted.org/packages/15/6b/99e88ad08f67859f803e3e0b10febb95936c3cd2552b9900bc50da14db05/xontrib_mise-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0cc93f06cf7f5737340549e993480a10e1972db8a72e59c7afbd0d84bd28bed7",
                "md5": "c5ec417843c3d9de4d0ada8d96165482",
                "sha256": "4e556dcd35a964b701c395b50353c92e75bb9762fb58b167a7fa0e446fb0b897"
            },
            "downloads": -1,
            "filename": "xontrib_mise-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c5ec417843c3d9de4d0ada8d96165482",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4885,
            "upload_time": "2024-02-28T16:53:25",
            "upload_time_iso_8601": "2024-02-28T16:53:25.030180Z",
            "url": "https://files.pythonhosted.org/packages/0c/c9/3f06cf7f5737340549e993480a10e1972db8a72e59c7afbd0d84bd28bed7/xontrib_mise-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-28 16:53:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eugenesvk",
    "github_project": "xontrib-mise",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xontrib-mise"
}
        
Elapsed time: 0.18860s