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

feature: embed rustenv within a Python venv #6

Open
cblegare opened this issue Feb 1, 2022 · 2 comments
Open

feature: embed rustenv within a Python venv #6

cblegare opened this issue Feb 1, 2022 · 2 comments

Comments

@cblegare
Copy link
Contributor

cblegare commented Feb 1, 2022

Hello there @chriskuehl !

Thank you for this simple yet useful piece of software. I often use python instead of shell script for quick tools, even when I'm not working on Python projects. Hence I always have a venv around and I leverage the fact that its built around a normal UNIX filesystem to install tools into it (awscli, gcloud, terraform, installed under venv/opt/<thing> for instance).

I wanted to do the same thing with rust and wrote a rust env management script that will optionally embed the rust env within an existing virtualenv.

Instead of pushing my tool to pypi, I could simply contribute it here. Would you be interested?

Here is the command line interface

rustenv somepath # unstall rust under somepath/rust, exactly as it is today
python -m venv somepath
rustenv somepath  # install rust under somepath/opt/rust
python -m venv somepath
source somepath/bin/activate
rustenv # install rust under somepath/opt/rust
python -m venv somepath
source somepath/bin/activate
rustenv someotherpath # install rust under someotherpath/rust

When embedding the rustenv within a Python virtualenv, the activate script is updated.


I (and a couple people I work with) am really interested in this feature. I also see that you did not feel the need to make any changes in the last couple years, so here are the options I'd like your opinion about.

  • Accept this feature as a contribution
  • Not interested in rustenv anymore? transfer it to me so I can add the feature and maintain it
  • Not interested/not responding at all? No problem, I'll simply distribute it under another name.

Have a nice day!

@asottile
Copy link
Collaborator

asottile commented Feb 1, 2022

personally I don't think this is a good idea -- modifying the activate script is error prone and it's usually best to keep things separate. though this is implemented in python it's intended to be used standalone

@cblegare
Copy link
Contributor Author

cblegare commented Feb 2, 2022

modifying the activate script is error prone

While the implementation I have now is quite simple, I agree that editing a shell script in place is not trivial. In fact it is not mandatory to do this when using a proxy script, which rustenv already does.

If modifying the activate script is a no-go, we can work around that quite simply.

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