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

xshell-venv

xshell-venv manages your Python virtual environments in code

6 releases (3 stable)

1.2.0 Feb 22, 2024
1.1.0 Jul 13, 2022
1.0.0 Jun 19, 2022
0.3.0 Jun 8, 2022
0.1.0 Apr 26, 2022

#387 in Development tools

Download history 423/week @ 2023-12-22 810/week @ 2023-12-29 1135/week @ 2024-01-05 1128/week @ 2024-01-12 1769/week @ 2024-01-19 1201/week @ 2024-01-26 1180/week @ 2024-02-02 1593/week @ 2024-02-09 957/week @ 2024-02-16 811/week @ 2024-02-23 974/week @ 2024-03-01 842/week @ 2024-03-08 514/week @ 2024-03-15 707/week @ 2024-03-22 619/week @ 2024-03-29 472/week @ 2024-04-05

2,422 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–12MB
~119K SLoC