GithubHelp home page GithubHelp logo

viper's Introduction

viper

viper is a Python environment management tool built in Lean 4.

It not only does environment management but also unifies the calls for python and pip binaries.

It's inspired on Julian Berman's venvs, which eliminates the need for environment activation/deactivation. Instead, directories are linked to environments in a list persisted on a text file ($HOME/.viper/links). Calling viper to run as a frontend for python or pip will trigger a lookup on that file. That's how viper knows which environment to use.

Installation

You'll need Lean 4's tooling to build viper.

Run lake run setup, which will build viper and ask you where to place its binary. You can place it in a directory that's already in your path, for example.

Usage

Again, you can use viper to manage environments or as an interface for python and pip:

  • Create a new environment with viper new my-env
  • Link the current directory to an environment with viper link my-env
  • Create and link in a single command with viper new! my-env
  • Install packages with viper install pkg1 pkg2
  • Run Python with viper my_file.py

Use viper help to see the full documentation:

notation:
  * '$x' means an arbitrary input, to be referenced as `x`
  * '$[⋯ xs]' means an arbitrary sequence of inputs, to be referenced as `xs`

usage: `viper $COMMAND`, where `COMMAND` is:

  #### info
  help                 prints this menu being read
  links                shows the current links
  envs                 displays the list of environments
  env?                 shows the environment linked to this directory

  #### environment management
  new $env             creates a new environment named `env`
  new! $env            runs `new env` and links `env` to the current directory
  rename $env $env'    renames `env` to `env'`, keeping links consistent
  clone $env $env'     clones `env` to a new environment `env'`
  del $env             deletes the environment `env` and its links

  #### linking
  link $env            links the current directory to `env`
  unlink               removes any link for the current directory
  unlink dir $d        removes any link for the directory `d`
  unlink env $e        removes any links to the environment `e`

  #### maintenance
  fix                  if the current links file is corrupted, creates a new
                       (empty) one, backing up the old one
  health               searches for:
                        - inexistent linked directories
                        - inexistent linked environments
                        - unlinked environments
  prune                removes links for inexistent directories and environments
  prune!               runs `prune` but also deletes unlinked environments

  #### pip
  install $[⋯ args]    runs `pip install` with arguments `args`
  uninstall $[⋯ args]  runs `pip uninstall` with arguments `args`
  show $[⋯ args]       runs `pip show` with arguments `args`
  freeze $[⋯ args]     runs `pip freeze` with arguments `args`

  #### python
  $f $[⋯ args]         runs Python interpreter on file `f` with arguments `args`
  -m $mod $[⋯ args]    runs module `mod` with arguments `args`
  <nil>                runs Python's REPL

viper's People

Contributors

arthurpaulino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.