Giter Club home page Giter Club logo

Comments (9)

jnoortheen avatar jnoortheen commented on September 21, 2024 1

That can be done by adding site-packages to the PYTHONPATH of the xonsh's venv. I think it should be a separate xontrib than vox itself. It just manages the virtualenv, and to facilitate imports from the current env, seems a different thing.

from xontrib-vox.

AstraLuma avatar AstraLuma commented on September 21, 2024

Hm. Could be done with caching state (sys.path and $PATH) and using site.addsitedir().

from xontrib-vox.

 avatar commented on September 21, 2024

note: vox has an 'enter' command which is an alias of activate.

from xontrib-vox.

Granitosaurus avatar Granitosaurus commented on September 21, 2024

@astronouth7303 Could you elaborate a bit more of what you mean? {env_name} in $PROMPT is already there. Do you mean a feature that would allow setting an unique $PROMPT for every virtual env?

I use something like this with xonsh-autoxsh

~ $ cd ~/test
~/test $ echo "$PROMPT = 'foobar $'" > .autoxsh
~/test $ cd .
Unauthorized ".autoxsh" file found in this directory. Authorize and invoke? (y/n/ignore): y
foobar $ echo "prompt was changed!"

Since it's usually a good idea to use a new virtualenvironment for every project this snipped kinda serves the same purpose.

from xontrib-vox.

AstraLuma avatar AstraLuma commented on September 21, 2024

I mean applying a virtual environment to your xonsh session.

Or maybe spawning a xonsh shell in the environment?

Either way, it involves crossing environments and other weirdness, so it's certainly non-trivial.

from xontrib-vox.

jnoortheen avatar jnoortheen commented on September 21, 2024

@AstraLuma vox activate already applies virtual environment to the current xonsh session. perhaps you want to spawn a new shell session with the env variable applied, like pew does?

from xontrib-vox.

AstraLuma avatar AstraLuma commented on September 21, 2024

No, the python contents, not just the commands.

from xontrib-vox.

jnoortheen avatar jnoortheen commented on September 21, 2024

No, the python contents, not just the commands.

could you elaborate on this? I still don't get it.

from xontrib-vox.

AstraLuma avatar AstraLuma commented on September 21, 2024

Add the python environment of the venv to xonsh's python environment.

So you have a repl kinda matching the project you're working on.

from xontrib-vox.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.