Hello group.
I've gone about creating importvirtualenv. My reasoning is that pip
freeze won't work for gathering the requirements as i have locally
added a bunch of paths to my existing virtualenvs. Importvirtualenv is
very similar to the cpvirtualenv in that they both make the virtualenv
relocatable. Importvirtualenv takes an virtualenv external to workhome
wheras cp only handles internal virtualenvs. I still have work to do
actually refactoring and deduping some of the code between
cpvirtualenv and importvirtualenv, but i'm having a problem getting a
test to pass and hoping its something bash related that y'all can
point me in the right direction.
In particular the test test_derive_workon_home.sh.
I have abstracted out the python call to expandvars, expanduser to a
function called expandpath. I did this for two reasons... I had
updated my postactivate user script to change directory to the
virtualenv which then prevented pip installing requirements when
mkvirtualenv from working cause the path for the requirements would be
wrong after the cd unless i passed a full path... and the
importvirtualenv needed to do all the same things checks/expansion on
the external virutalenv path.
So my hang up right now is that the path won't return unless i put in
an preceding echo. (The full code can be found at
https://bitbucket.org/barberj/virtualenvwrapper/src/73d217d4a344).
This commit shows the echo i'm talking about at line 80:
https://bitbucket.org/barberj/virtualenvwrapper/changeset/73d217d4a344.
Test results with the echo:
test_includes_tilde
ASSERT:expected:</Users/jbarber/.test-virtualenvs> but was:<
/Users/jbarber/.test-virtualenvs>
Results without the echo:
test_includes_tilde
expandpath:1: = not found
ASSERT:expected:</Users/jbarber/.test-virtualenvs> but was:<>
I tried doing a sys.stdout.flush and various other things, but bash
programing isn't my forte so I'm guessing at this point. Any pointers?
Thanks,
Justin