nu_scripts icon indicating copy to clipboard operation
nu_scripts copied to clipboard

feat(pyenv+pipenv): minimal working pyenv and pipenv setup

Open efugier opened this issue 3 years ago • 9 comments

Following https://github.com/nushell/nushell/issues/5423

This isn't complete at all but covers all my needs atm.

efugier avatar May 14 '22 15:05 efugier

Should I put export before everything ?

efugier avatar May 14 '22 15:05 efugier

Just a couple of pointers:

  • We have official virtualenv integration: https://github.com/pypa/virtualenv/tree/main/src/virtualenv/activation/nushell . I think pipenv uses virtualenv internally but I'm not 100% sure.
  • The next release will include the Overlays feature (see https://github.com/nushell/nushell/pull/5375) which is designed to make this sort of stuff more ergonomic (the virtualenv integration will be changed to work as overlay)
  • The export keyword is used in modules. You use it if you want to use it as a module, not a script. See modules docs for details how it works: https://www.nushell.sh/book/modules.html#modules.

kubouch avatar May 14 '22 15:05 kubouch

Oh, also @efugier could you move the file to the virtual_environments folder? We can merge it but I think it could be together with other Python-related stuff so we don't end up having a thousand folders.

kubouch avatar May 14 '22 15:05 kubouch

Thanks @kubouch!

We have official virtualenv integration

Ok, let's put this on hold while I look into it.

The export keyword is used in modules.

I think of it more of a config extension that would always be loaded, so I use it with exports. It's more a question about this nu_SCRIPT repo and its policy about that.

efugier avatar May 14 '22 15:05 efugier

What I'm doing now when I work with pipenv is to create the env using pipenv python 3.9 and then find the env route pipenv --venv. In that folder you will find the activate.nu file

elferherrera avatar May 14 '22 16:05 elferherrera

Hi, very quick note, you might want to change your append to prepend. At least on my system that makes sure that the pyenv shims take precedence over the system version.

WizardOfMenlo avatar May 20 '22 11:05 WizardOfMenlo

Thanks for pointing this out @WizardOfMenlo :slightly_smiling_face:

Haven't had time to come back to this yet, sorry

efugier avatar May 20 '22 13:05 efugier

Has this been abandoned or it's summertime and we're all at the beach? 😆

fdncred avatar Jul 01 '22 12:07 fdncred

Has this been abandoned or it's summertime and we're all at the beach? laughing

Ahah I wish!
Sorry @fdncred not much time on y hands atm. Feel free to close this PR if it bother you; I'll re-open it eventually :confused:

efugier avatar Jul 01 '22 13:07 efugier

Have we seen any resolution on this yet to facilitate pyenv integration? It seems like it might be available, but not clear on use: https://github.com/pyenv/pyenv/pull/2524

ylluminate avatar Jan 15 '24 20:01 ylluminate