Skip to content

orsnaro/CDV-windows-autoenv-tool

Repository files navigation

alt text The Windows Auto-venv Tool alt text

This batch scripted tool will auto activates/deactivates/inits your python virtual environment just by using CDV! Works like normal CD. for help use cdv -h


New Release V0.1.4 ✨!

Install , open terminal and use it! CDV Rightaway! Here to download v0.1.4

Release Notes:

  • Feature: now the tool auto deactivates the venv if you go outside parent DIR!
  • Feature: no need to CDV to parent project dir first to activate the venv anymore! CDV into any sub dirs in your repo/project and the venv will start rightaway!
  • Feature: now CDV can use paths with spaces just like CD though it's not recommended (CDV doesn't anymore crash from using paths with whitechars!)
  • Fix paths/shell args with spaces/whitecharacters known bugs.
  • Fix shell prompt redundent prints. and multiple uneeded CD calls. and uneeded extra venv deactivations/activations.
  • Fix file encoding is not same as configured pagecode.
  • Fix all known bugs caused by misusing of local scoping endlocal,setlocal and vanishing vars valuables.
  • Fix now almost all vars processes is gaurded with double quotes now.
  • Fix critical hidden bug when using -D flag to delete auto-venv config and venv DIR due to scoping/ACLs issues
  • Quality used %PROGRAMDATA%\CDV\Temp dir to be used for any temp files instead of using C:\Users\%USERNAME%\ dir.
  • Quality help is enhanced: there is a separate help label and help.bat if needed
  • Quality better cleaning of temp vars.
  • Quality made sure to use win batch native commands like del instead of rm etc...
  • Quality now tool switches/shell args are case-insensetive which is more coherent with other shell tools approach
  • Quality some internal commands is now turned silent /Q
  • long awaited branch and commit 'd291ed5' is now ready , + refactoring and more ...
  • Full Changelog: https://github.com/orsnaro/CDV-windows-autoenv-tool/compare/V0.1.3...V0.1.4


How to Use🚀:

  • First Install latest version via cdv.msi (latest)

  • if using cmder console and you want to totally override cd by cdv ( you can re-tract the override any time )

     alias cd=cdv $*

    now cd has all cdv features!

    • to re-tract
    unalias cd
  • Shows help for the cdv command:
    cdv -h
  • initialize & configure new auto venv -only used one time per project- :
    cdv <optional-path>  -i
  • with out any parameters its just similar to cd until you cdv'ed to one of your configured projects it will auto activate the venv for you!
    cdv path  
    • to activate current project venv
     cdv 
  • complete delete for the auto venv configs and files:
    cdv <optional-path>  -d
  • to deactivate your venv .. you can also use deactivate command:
    cdv <optional-path>  -q

Upcoming updates 🆙:

  • TODO: Auto detect pyproject.toml or requirements.txt to auto suggest creating a new venv instead of using CDV -i when creating new venv for first time
  • TODO: Instead of linking project to its corresponding venv using the .is_autoVenv file content or _venv suffix it'll use simple .yaml or sqlite map to determine which proj is for which venv
  • TODO: Refactor into labels
  • TODO: write a powershell version

Notes📝:

  • (in testing) no need to download the installer for every new version ( just reinstall and it will update to latest release )

  • if <optional-path> parameter wasn't provided will just run cdv command on current directory

  • the folder which holds all venvs is defaulted to C:\Users\%USERNAME%\py_envs

  • virtual environment directoroy names will be same as project name with _venv appended to it

  • please dont delete .is_autoVenv file from your proj/repo directory nor edit it ( unless you know what you are doing )

  • command auto ignores it's .is_autoVenv file in .gitignore if . (this is only if the project/repo already has .gitignore file)


would appreciate reading/trying/using the CDV tool and raise any issues💙

For more scripts that could be usefull visit: bin

About

`cdv` is just like your beloved `cd` command but more powerful! This batch scripted tool will auto activate your python virtual environment just by using `cdv` for more help use `cdv -h` (scripted for windows)

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors