Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api question #4

Open
cs01 opened this issue Oct 18, 2018 · 6 comments
Open

api question #4

cs01 opened this issue Oct 18, 2018 · 6 comments

Comments

@cs01
Copy link

cs01 commented Oct 18, 2018

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.

@djrobstep
Copy link
Owner

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).

@cs01
Copy link
Author

cs01 commented Oct 19, 2018

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.

@cs01
Copy link
Author

cs01 commented Oct 19, 2018

Just noticed you already use black. Nice.

@djrobstep
Copy link
Owner

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?

@cs01
Copy link
Author

cs01 commented Oct 19, 2018

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.

@djrobstep
Copy link
Owner

Ah, cool. For what it's worth I just used it to globally install poetry instead of using the standard install script, works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants