Skip to main content

Lua environment manager

Project description

(🌑) luamb

Lua environment manager built on top of hererocks and inspired by virtualenvwrapper.

Supported shells

  • Bash
  • Zsh

Installation

  1. Install luamb using pip:

    pip install [--user] luamb
    

    or pipx:

    pipx install luamb
    
  2. Set up your shell — add the following to ~/.bashrc or ~/.zshrc:

    source <(luamb shellsrc)
    
  3. Install hererocks:

    luamb update
    

Configuration

luamb is configured via environment variables.

  • LUAMB_HOME

    A directory where luamb stores its data (hererocks, environments, etc.). The default value is $XDG_DATA_HOME/luamb (usually ~/.local/share/luamb) on Linux and ~/Library/Application Support/luamb on macOS.

  • LUAMB_ENVS_DIR

    A directory where luamb stores environments. The default value is $LUAMB_HOME/envs.

  • LUAMB_LUA_DEFAULT

    A default Lua interpreter/version. The format is interpreter version_specifier, e.g., lua 5.3, luajit @v2.1, moonjit /path/to, raptorjit latest.

  • LUAMB_LUAROCKS_DEFAULT

    A default LuaRocks version, e.g, latest, 3.11.0.

  • LUAMB_DISABLE_COMPLETION

    Set to true to disable shell completions.

  • LUAMB_PYTHON_BIN

    If the luamb executable is not in PATH, set LUAMB_PYTHON_BIN to the Python executable with the luamb package installed and change the shell initialization command:

    export LUAMB_PYTHON_BIN=/path/to/bin/python
    source <("$LUAMB_PYTHON_BIN" -m luamb shellsrc)
    

Examples

  • Create an environment 'myproject' with the latest Lua 5.2, the latest LuaRocks and associate it with /home/user/projects/myproject:

    luamb mk myproject -l 5.2 -r latest -a /home/user/projects/myproject
    
  • Create an environment 'jittest' with LuaJIT 2.0.4, without LuaRocks and associate it with /home/user/projects/jitproj:

    luamb mk jittest -j 2.0.4 -a /home/user/projects/jitproj
    
  • Set the latest LuaJIT 2.0 and the latest LuaRocks as default versions:

    export LUAMB_LUA_DEFAULT='luajit 2.0'
    export LUAMB_LUAROCKS_DEFAULT=latest
    
  • Create an environment 'newenv' with the default versions and without associated project directory:

    luamb mk newenv
    
  • Create an environment 'norocks' with the default Lua version and without LuaRocks (verbose mode):

    luamb mk norocks --no-luarocks --verbose
    
  • Activate the 'newenv' environment:

    luamb on newenv
    
  • Deactivate the current environment:

    luamb off
    
  • Delete the 'myproject' environment (it will remove the environment directory only, not the project one):

    luamb rm myproject
    

Commands

  • on | enable | activate — activate an environment
  • off | disable | deactivate — deactivate the current environment
  • mk | new | create — create a new environment
  • rm | remove | del | delete — remove an environment
  • info | show — Show the details for a single virtualenv
  • ls | list — list all of the environments
  • update — install/update the hererocks script
  • shellsrc — print the shell initialization code

Version history

See CHANGELOG.md.

License

The MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luamb-0.5.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

luamb-0.5.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file luamb-0.5.0.tar.gz.

File metadata

  • Download URL: luamb-0.5.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for luamb-0.5.0.tar.gz
Algorithm Hash digest
SHA256 dcd6254de58bac1bf368cb69fa4a39e29992946d3ff5c47520ee5033a63c7460
MD5 d72914618e7bab4f029db64afa9fb76c
BLAKE2b-256 c5440da67820cf60110597f216499b54f7eb51d25e58ae1b38eca1039964203c

See more details on using hashes here.

File details

Details for the file luamb-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: luamb-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for luamb-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c1a506d8ec58a757cabe08861a47b114ab7bfb3b2856eca5852ee97680acd7a
MD5 4e2a933cec00821c2988983850a8dfd6
BLAKE2b-256 04072ce1cca392e4bf7f302f2a8cad43656142914a1ef7f8d75375719355acc2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page