#python #virtual #environment #manage #shell #venv #script

xshell-venv

xshell-venv manages your Python virtual environments in code

7 releases (4 stable)

new 1.3.0 May 13, 2024
1.2.0 Feb 22, 2024
1.1.0 Jul 13, 2022
1.0.0 Jun 19, 2022
0.1.0 Apr 26, 2022

#223 in Development tools

Download history 1042/week @ 2024-01-24 1591/week @ 2024-01-31 1349/week @ 2024-02-07 971/week @ 2024-02-14 807/week @ 2024-02-21 886/week @ 2024-02-28 1159/week @ 2024-03-06 583/week @ 2024-03-13 614/week @ 2024-03-20 486/week @ 2024-03-27 739/week @ 2024-04-03 586/week @ 2024-04-10 765/week @ 2024-04-17 1044/week @ 2024-04-24 669/week @ 2024-05-01 1175/week @ 2024-05-08

3,825 downloads per month

MIT license

16KB
188 lines

xshell-venv

crates.io docs.rs docs License: MIT Build Status

xshell-venv manages your Python virtual environments in code.

xshell-venv is an extension to xshell, the swiss-army knife for writing cross-platform “bash” scripts in Rust.

Example

use xshell_venv::{Shell, VirtualEnv};

let sh = Shell::new()?;
let venv = VirtualEnv::new(&sh, "py3")?;

venv.run("print('Hello World!')")?; // "Hello World!"

Requirements

  • Python 3
    • On Windows we look for python3.exe or python.exe
    • Otherwise we look for python3 or python
  • The venv package
    • This might be available as python3-venv or under a similar name. Double check your packages. E.g. on Ubuntu Python 3.8 is available as python3.8 and the corresponding venv package is named python3.8-venv.

License

MIT.

Dependencies

~2–10MB
~110K SLoC