autovenv
autovenv copied to clipboard
api question
Nice project, thanks for making and sharing it!
Is it possible to manually invoke autovenv to create a venv? In the spirit of the unix philosophy of "do one thing and do it well", I think autovenv is trying to do too much with the automatic activation upon directory entry, and persistence of config information.
I would use this project if it worked something like this
> autovenv -r requirements.txt
# creates venv in ./venv, runs pip install -U pip, pipi install -r requirements.txt
venv has been created in venv
type `activate venv/bin/activate` to active it
or
> autovenv --python pythonX
# defaults to using requirements.txt, creates venv with pythonX rather than default python
As you can see, nothing persists between calls and all relevant settings are passed through the CLI.
Hey, thanks for commenting!
There's currently no option for manually greating a specified venv.
I built this project initially just for myself, because I couldn't find anything that automated things the way I want. I still use it every day to run my own stuff and just fix things as needed.
I open-sourced the code but it hasn't had much polish, and so a few obvious features like this are missing. It could definitely use a bit more manual control.
It would be fairly easy to add tho, if you wanted, and I'd be happy to help review a PR or whatever, if you felt the inclination.
Unfortunately I've already got a heap of other projects needing attention and a lot going on at work so there's just no time to give this the attention it deserves, at least at the moment.
Which is a shame as I still think python needs better virtual environment management and the new tools like pipenv and poetry don't give you enough control, imo (at least with poetry you can disable venv management and just manage it them yourself).
I built this project initially just for myself, because I couldn't find anything that automated things the way I want.
I was about to embark on this journey myself and was checking to see if the name autovenv was taken. Nice choice 😄
It would be fairly easy to add tho, if you wanted, and I'd be happy to help review a PR or whatever, if you felt the inclination.
Yeah I think I'll have a go at it. I use the black formatter. Is your code formatted that way/are you open to it being formatted w/ black?
Which is a shame as I still think python needs better virtual environment management and the new tools like pipenv and poetry don't give you enough control, imo (at least with poetry you can disable venv management and just manage it them yourself).
I agree. I think something like autovenv fills a nice gap between pip and poetry/pipenv. It lets you use pip and venv directly with less tedious setup, which I think is superior to pipenv. I made a couple other tools to fill other gaps I saw too if you want to check them out -- pipx and create-python-package). pipx would actually be a good way to install autovenv.
Just noticed you already use black. Nice.
Awesome, looking forward to it!
And yes, big fan of black.
Checked out your projects, pipx in particular looks useful for a bunch of things. It looks like pipx on PyPI is taken by something different tho so might need a rename?
It looks like pipx on PyPI is taken by something different tho so might need a rename?
My thought was that pipx is a simple name that would immediately set many users' expectations that it is similar to npx, and so even though the name on PyPI was taken it would have better adoption rates. I talked to the owner of the pipx PyPI name and he was open to letting me use it if it was for a popular enough project, so maybe someday I'll convince him 😄. If you have any names you think would be better I'm open to considering.
Ah, cool. For what it's worth I just used it to globally install poetry instead of using the standard install script, works great!