Commit graph

303 commits

Author SHA1 Message Date
Yamashita, Yuu 4fa9c7b220 Merge pull request #75 from blueyed/fix-zsh-typeset-precmd_functions
Use `typeset -g` with `precmd_functions`
2015-05-17 12:12:12 +09:00
Daniel Hahler 2571a2b973 activate: display setup instructions only with PYENV_VIRTUALENV_INIT=0
This fixes displaying the note, in case "init" has been run manually
and/or the init is not in the expected place.

It removes the unnecessary calls to "grep".

pyenv-virtualenv-init will look at `$PYENV_SHELL` now, too.

Tests have been adjusted/fixed.
2015-05-10 17:47:46 +02:00
Daniel Hahler 95fa7a35ad shell: do not use basename, but bash 2015-05-10 17:36:03 +02:00
Yamashita, Yuu 47cd86a165 Merge pull request #74 from blueyed/help-version-is-optional
Usage: version is optional
2015-04-28 17:19:46 +09:00
Daniel Hahler 6bc0253d17 minor: fix comments 2015-04-28 10:17:02 +02:00
Daniel Hahler c184c01174 Usage: version is optional 2015-04-28 10:13:59 +02:00
Josh Hagins 5953ddaf64 Ignore failure of pyenv activate
When the current pyenv environment is not a virtualenv, this line
exits with a return code of 1. This is annoying for those of us
who report the last return code in our own PROMPT_COMMAND, so
ignore the output of `pyenv activate` if we're not currently using
a virtualenv.
2015-03-18 22:30:19 -04:00
Daniel Hahler 2ab9483116 Use typeset -g with precmd_functions
This makes it possible to use `eval "$(pyenv virtualenv-init -)"` from a
function.
2015-03-14 02:37:14 +01:00
Yamashita Yuu 32e5a73345 v20150119 2015-01-19 00:53:19 +09:00
Yamashita Yuu 0fc9441f09 Anaconda has activate script nevertheless it is not a virtual environment (#65) 2015-01-18 20:15:44 +09:00
Tony Wang e04a6f88fe fix wrong output in test in fish, refs 240a1de
"(any command)" is not supported in test in fish, we have to set a
variable and then use that
2015-01-06 11:10:43 +08:00
Tony Wang 240a1de6e5 fix warns for virtualenv-init corner case on fish
The situation is when in a directory containing python binary,
`pyenv prefix' will return empty (caused by `pyenv which' returning
"./python"). This change adds quotes for `test', otherwise `test' will
warn about missing argument.
2015-01-05 23:23:43 +08:00
Yamashita Yuu 191e806ba9 shell version set in activate should be unset in deactivate (#61) 2014-12-23 11:21:52 +09:00
Tony Wang f681df6f20 fix incorrect fish syntax in pyenv-virtualenv-init 2014-12-16 17:53:26 +08:00
Yamashita Yuu e774464ced ignore error from pyenv-version-name since it might fail if there is configuration error (yyuu/pyenv#291) 2014-12-14 14:15:18 +09:00
Yamashita Yuu ad644e83b5 v20141106 2014-11-06 09:47:54 -08:00
Yamashita Yuu 2060c43387 Stop buzzy errors from embeded shell functions 2014-10-27 10:36:10 +09:00
Yamashita Yuu a02eb0a396 Calling create_symlinks after ensurepip is unnecessary
Install script of setuptools-6.1/pip-1.5.6 will create those links if needed
2014-10-19 10:59:52 +09:00
Yamashita Yuu 1d36ef2f68 v20141012 2014-10-12 21:55:47 +09:00
Yamashita Yuu d6671249b7 Should not persist PYENV_DEACTIVATE after automatic deactivation (#47, #48) 2014-10-12 21:34:18 +09:00
Beau Barker 79bfc9d362 When changing from a virtualenv to "system", unset PYENV_DEACTIVATE. Previously the var remained set, which made it impossible to reactivate the previous virtualenv 2014-09-17 19:50:41 +10:00
Daniel Hahler 86046fd4e8 Do not allow whitespace in VIRTUALENV_NAME
While this could work in general, it fails in the end, because
whitespace is not allowed/supported in the shebang line with the
scripts in the created virtualenv.
2014-09-03 23:28:46 +02:00
Yamashita, Yuu 2cc21f112c Merge pull request #40 from s0undt3ch/master
Fix weird bash code issue which made bash complain about "then"
2014-08-14 10:03:35 +09:00
Pedro Algarvio 81736da905 Indent to 2 spaces. 2014-08-13 19:51:22 +01:00
Pedro Algarvio 3ebb00414f if [ pyenv deactivate --no-error --verbose ] is not bourne shell compatible 2014-08-13 03:40:02 +01:00
Yamashita Yuu c9bcef656c Use . instead of source to support POSIX sh 2014-08-13 10:54:18 +09:00
Pedro Algarvio 2662b5807c Fix weird bash code issue which made bash complain about "then" 2014-08-13 00:55:04 +01:00
Yamashita Yuu a3c86f013b Deactivate virtualenv even if it has been activated manually 2014-07-11 20:24:58 +09:00
Yamashita Yuu 7aa5d13633 v20140705 2014-07-05 17:26:53 +09:00
Yamashita Yuu aef2546319 Fix broken fish's if statement 2014-07-05 07:30:53 +09:00
Yamashita Yuu 6b4d6249a0 No need to use eval in fish init script 2014-07-05 07:27:12 +09:00
Yamashita Yuu 0de2cdbbc3 Should not persist PYENV_DEACTIVATE after failed attempt to deactivate and activate 2014-07-05 06:53:46 +09:00
Yamashita Yuu abfda4bac9 Fix issues with manual activation of virtual environments (#34) 2014-07-04 22:55:06 +09:00
Yamashita Yuu be18fd294e Fix virtualenv-prefix when the version is system 2014-07-04 22:44:08 +09:00
Yamashita Yuu d4ce853e94 Display information on automatic (de)?activation 2014-07-04 22:44:05 +09:00
Yamashita Yuu 58ed045796 s/QUIET/NOERROR/g 2014-07-04 22:10:35 +09:00
Yamashita Yuu c2b5bbd19a Fix fish syntax error at else 2014-07-04 20:51:31 +09:00
Yamashita Yuu f0c400b669 Add --quiet option to activate and deactivate 2014-07-04 20:47:10 +09:00
Yamashita Yuu 5b3b909089 Exit as error on deactivation failures 2014-07-04 20:33:37 +09:00
Yamashita Yuu 0b5e0cf592 Unset shell version only if the deactivate has invoked 2014-07-04 20:27:55 +09:00
Yamashita Yuu c09a6d3d6c Exit as error on activation failures 2014-07-04 20:23:29 +09:00
Yamashita Yuu e2e69b3b38 Create backup of original virtualenv within $(pyenv root)/versions when --upgrade 2014-07-01 21:24:54 +09:00
Yamashita Yuu 008a9820bb Refactor --upgrade feature with virtualenv 2014-07-01 21:23:37 +09:00
Yamashita Yuu 08b4c94f85 Use PYENV_DEACTIVATE to store which virtualenv has been deactivated (#32) 2014-06-30 23:03:37 +09:00
Yamashita Yuu 7079cbe979 Fix broken setenv in pyenv-virtualenv-init 2014-06-30 21:35:53 +09:00
Yamashita Yuu 763696b3fb Expand install_virtualenv for code simplicity 2014-06-28 19:13:04 +09:00
Yamashita Yuu 0580d566d4 Remove a call of create_symlinks after the upgrade of existing virtualenv.
The `pyenv-virtualenv` only takes care about the name of executables of `python`,
`setuptools` and `pip`.
2014-06-28 17:53:02 +09:00
Yamashita Yuu 7a6325f8a4 Display deprecated warnings when --upgrade has given with virtualenv 2014-06-28 17:49:43 +09:00
Yamashita Yuu bad4507541 Run _ensurepip_ after the every creation of virtualenv/pyvenv 2014-06-28 01:03:33 +09:00
Yamashita Yuu 7c8805c343 Use same _ensurepip_ logic as python-build 2014-06-28 00:49:04 +09:00
Yamashita Yuu 877aba8ae7 Refactoring around SETUPTOOLS_VERSION and PIP_VERSION 2014-06-21 02:05:14 +09:00
Yamashita Yuu 2fc7e62b78 Use https://bootstrap.pypa.io/ez_setup.py and https://bootstrap.pypa.io/get-pip.py 2014-06-16 11:22:39 +09:00
Yamashita Yuu ea18a1b283 v20140615 (fixes #26) 2014-06-15 20:20:29 +09:00
Yamashita Yuu dcb5371f07 Merge branch 'workaround-for-pyenv-which-ext' 2014-06-15 20:16:25 +09:00
Yamashita Yuu dc12a345d8 Workaround for the issue with pyenv-which-ext (refs #26) 2014-06-15 18:36:21 +09:00
Yamashita Yuu d9e3adc108 Performe as same as before v20140614 if pyenv virtualenv-init is not configured (#26) 2014-06-15 16:43:50 +09:00
Yamashita Yuu 4a6ef11349 v20140614 2014-06-14 14:45:57 +09:00
Yamashita Yuu 21e999cc7c Fix deactivation issue with system version
$ pyenv global system
    $ pyenv shell venv
    (venv) $ pyenv shell --unset
    (venv) $ pyenv version
    system (set by /home/yamashita/.pyenv/version)
    (venv) $ pyenv which python
    /home/yamashita/.pyenv/versions/venv/bin/python # <-- should be `/usr/bin/python` (system)
2014-06-13 19:30:37 +09:00
Yamashita Yuu fe5e69846e Create symlinks for executables with version suffix 2014-06-12 20:35:44 +09:00
Yamashita Yuu c17e4ec9a4 style 2014-06-05 19:31:10 +09:00
Yamashita Yuu 7828a15066 Use pyenv-virtualenv-init to show caveats 2014-06-05 00:17:06 +09:00
Yamashita Yuu b258bfa907 Display notice about virtualenv-init in activate 2014-06-05 00:08:21 +09:00
Yamashita Yuu 8a837758dc activate: invoke pyenv shell only if the arguments passed 2014-06-04 15:24:36 +09:00
Yamashita Yuu ea120da0c5 fish: Suppress annoying stderr outputs from pyenv-sh-activate 2014-06-04 15:24:34 +09:00
Yamashita Yuu af6c157a79 Add eval "$(pyenv virtualenv-init -)" to setup _precmd_ for user's shell 2014-06-04 15:24:12 +09:00
Yamashita Yuu c9043920db v20140602 2014-06-02 21:42:27 +09:00
Yamashita Yuu 26f2004abb Add semicolon for the deactivate scripts for non-fish 2014-06-02 16:02:39 +09:00
Fotis Gimian f7da0c5808 Repaired virtualenv activation and deactivation for the fish shell 2014-05-31 12:29:19 +10:00
Yamashita Yuu 3f5171e2fc Use new style GH raw url to avoid redirects (raw.github.com -> raw.githubusercontent.com) 2014-04-30 11:52:15 +09:00
Yamashita Yuu 579f4784c8 v20140421 (fixes #19) 2014-04-21 20:24:25 +09:00
Yamashita Yuu 2cab533652 Use virtualenv instead of pyvenv if -p has given (yyuu/pyenv#158) 2014-04-20 15:24:40 +09:00
Yamashita Yuu a958640776 Fix completion of pyenv activate (fixes #15) 2014-02-03 14:49:47 +09:00
Yamashita Yuu 503a51564e Display error if pyenv activate was invoked as a command 2014-01-25 19:14:58 +09:00
Yamashita Yuu 1d291c7c4c v20140123 2014-01-23 19:09:40 +09:00
Yamashita Yuu 4feb64e8d3 Display the version of pyvenv if USE_PYVENV is set 2014-01-23 14:51:56 +09:00
Yamashita Yuu 826a7e1a37 Unset PIP_REQUIRE_VENV before executing pip install. (#10) 2014-01-22 20:08:11 +09:00
Yamashita Yuu a40cbc8acd Add tests for pyenv-virtualenv-prefix 2014-01-21 01:27:03 +09:00
Yamashita Yuu d0685addc1 Add tests for activate and deactivate 2014-01-21 00:37:33 +09:00
Yamashita Yuu 2aa207ede0 Add prepare_upgrade and upgrade 2014-01-18 18:04:59 +09:00
Yamashita Yuu 1cbcee3fc8 Add HAS_VIRTUALENV, HAS_PYVENV and USE_PYVENV 2014-01-18 18:04:45 +09:00
Yamashita Yuu e7cc57acb8 Preserve original IFS 2014-01-18 18:01:34 +09:00
Yamashita Yuu dc7b6abfde Display messages only on verbose mode 2014-01-18 18:00:59 +09:00
Yamashita Yuu 64b2545d5e Hide useless output from pyenv-virtualenv-prefix 2014-01-17 22:43:03 +09:00
Yamashita Yuu f9d3984909 Hide output from declare -f deactivate 2014-01-17 22:39:37 +09:00
Yamashita Yuu 85959c735d Add sh commands to activate/deactivate virtualenv into current shell 2014-01-17 20:17:15 +09:00
Yamashita Yuu 4e61656e9d Modify error messages 2014-01-17 20:17:05 +09:00
Yamashita Yuu c7da5d53bb Should not exit with error if virtualenv_is_pyvenv returns with non-zero (fixes #8) 2014-01-17 11:39:26 +09:00
Yamashita Yuu fc01a3d475 Use ensurepip if available 2014-01-16 18:33:02 +09:00
Yamashita Yuu 6b712a95cb v20140110.1 2014-01-10 15:36:42 +09:00
Yamashita Yuu fa9950aa5b v20140110 2014-01-10 11:35:19 +09:00
Yamashita Yuu 124645e84c Use ez_setup.py and get_pip.py on filesystem if exist 2014-01-09 18:46:44 +09:00
Yamashita Yuu ec60d5dfcb Support a short option of virtualenv: -p 2014-01-09 11:19:39 +09:00
Yamashita Yuu d96a00ece3 v20131216 2013-12-16 13:58:10 +09:00
Yamashita Yuu a4ce544798 Remove embeded version string of setuptools/pip. 2013-07-17 16:03:31 +09:00
Yamashita Yuu 16a4a8d37e Update setuptools (0.8 -> 0.9.5) 2013-07-17 15:52:32 +09:00
Yamashita Yuu 8d4b901250 update setuptools (0.7.7 -> 0.8) 2013-07-08 16:30:07 +09:00
Yamashita Yuu 8363a4f0e0 update setuptools (0.7.4 -> 0.7.7) 2013-07-05 11:16:02 +09:00
Yamashita Yuu 79c4e62886 v20130622 2013-06-22 10:30:00 +09:00
Yamashita Yuu 2f20c56b1d remove redundant checks for pyenv-prefix 2013-06-21 19:42:46 +09:00
Yamashita Yuu 77f9c1502d like pyenv versions, show "*" on the start of line if the environment
is enabled
2013-06-21 19:40:59 +09:00
Yamashita Yuu 327b8b7615 do not create python executable in pyenv-virtualenv
it will be created by `virtualenv` or `pyvenv`
2013-06-20 17:53:45 +09:00
Yamashita Yuu 23a115c12a set STATUS as non-zero even if the setuptools or pip have failed to
install into pyvenv
2013-06-20 16:25:54 +09:00
Yamashita Yuu f3c5a64281 renamed virtualenv() to venv() 2013-06-20 14:56:24 +09:00
Yamashita Yuu 384fab86ef add EZ_SETUP_URL and GET_PIP_URL 2013-06-20 14:50:20 +09:00
Yamashita Yuu f0ca1b27d0 add SETUPTOOLS_VERSION and PIP_VERSION 2013-06-20 13:48:01 +09:00
Yamashita Yuu 2e5db090a9 install setuptools and pip into pyvenv 2013-06-20 12:23:46 +09:00
Yamashita Yuu 11792cbaf9 Remove --pyvenv option.
Use pyvenv only if virtualenv is not installed and there is pyvenv.
2013-06-20 11:59:54 +09:00
Yamashita Yuu 6e7945a626 prefer pyvenv rather than virtualenv if --pyvenv is given 2013-06-19 23:57:45 +09:00
Yamashita Yuu 1db9840620 check existence of ./bin/activate to detect virtualenvs to support pyvenv 2013-06-19 23:39:26 +09:00
Yamashita Yuu 7507cb1e41 apply $QUIET and $VERBOSE both pip and virtualenv 2013-06-18 23:39:43 +09:00
Yamashita Yuu 7a54a83392 fix --help option 2013-06-18 23:34:04 +09:00
Yamashita Yuu 551956f017 improve arguments handling 2013-06-18 23:26:30 +09:00
Yamashita Yuu f78a393864 fixed broken reference for "${PYTHON_BIN}" 2013-06-18 14:54:11 +09:00
Yamashita Yuu a4de1d7e89 Removed bundled virtualenv.py script. Now pyenv-virtualenv installs
`virtualenv` package into source version and then use it.
2013-06-18 12:21:16 +09:00
Yamashita Yuu f2bd87fc3e support virtualenv's short option of "-q" 2013-06-15 12:42:30 +09:00
Yamashita Yuu 2a5a483c5d v20130614 2013-06-14 21:31:24 +09:00
Yamashita Yuu b7c498ce03 add pyenv-virtualenv-prefix 2013-06-04 18:56:58 +09:00
Yamashita Yuu 6915cd0320 no need to import print_function in this case 2013-06-04 17:52:10 +09:00
Yamashita Yuu 4263783195 add pyenv virtualenvs command 2013-06-04 17:07:48 +09:00
Yamashita Yuu 65b58770a7 display package list on unsuccessful upgrade 2013-05-28 21:07:35 +09:00
Yamashita Yuu 66546cea12 ignore stderr from pyenv-exec 2013-05-28 16:54:25 +09:00
Yamashita Yuu 7562795c42 test the existence of ${VIRTUALENV_PIP_BIN} before invoking it 2013-05-28 16:30:39 +09:00
Yamashita Yuu 8ac27a7a77 add --upgrade option to upgrade existing virtualenv 2013-05-28 13:43:17 +09:00
Yamashita Yuu f9532f6c4e load hooks just before creating virtualenv 2013-05-28 13:37:32 +09:00
Yamashita Yuu 67d6cfc0d2 handle --force option expectedly 2013-05-27 23:50:13 +09:00
Yamashita Yuu 695c2fd618 v20130527 2013-05-27 20:26:42 +09:00
Yamashita Yuu bc433be75c update README 2013-05-27 20:25:57 +09:00
Yamashita Yuu 16470ec39c Unset environment variables which starts with VIRTUALENV_. These variables are reserved for virtualenv. 2013-05-08 15:51:09 +09:00
Yamashita Yuu c8b9969619 (1) fix handling of hooks
(2) remove $VIRTUALENV_PATH after failed creation
2013-05-08 14:28:56 +09:00
Yamashita Yuu 3b7be75458 restore missing VIRTUALENV_PYTHON_BIN 2013-05-08 14:08:26 +09:00
Yamashita Yuu db37bb9643 Download virtualenv.py if specified version has not been installed. 2013-05-07 22:31:12 +09:00
Yamashita Yuu a9903fab6e make installation path of virtualenv.py configurable 2013-05-07 21:51:12 +09:00
Yamashita Yuu b594b99a18 s/VIRTUALENV_CACHE_PATH/PYENV_&/g 2013-05-07 21:26:28 +09:00
Yamashita Yuu 9e438ee3e2 Change the installation path of the virtualenv.py script. 2013-05-07 21:22:51 +09:00
Yamashita Yuu 1389d840d1 Remove python-virtualenv which was no longer used. 2013-05-07 21:15:07 +09:00
Yamashita Yuu 78af7ec9d4 release v20130507 2013-05-07 19:55:31 +09:00
Yamashita Yuu 5b357d2862 display virtualenv's help message on '--help' 2013-05-01 13:07:49 +09:00
Yamashita Yuu 5baa5084dc don't capture '-v' option in $VERBOSE to pass it to virtualenv 2013-05-01 13:05:32 +09:00
Yamashita Yuu 0f8477fcf5 store distribute/setuptools archive in $PYTHON_BUILD_CACHE_PATH to reuse
them between invocations.
2013-04-30 19:55:49 +09:00
Yamashita Yuu aec759a0e0 ignore error on checking virtualenv version 2013-04-26 13:03:35 +09:00
Yamashita Yuu 15608701ae show virtualenv version in pyenv virtualenv --version 2013-04-25 22:10:29 +09:00
Yamashita Yuu ebeb3dcb71 fix wrong path for libexec 2013-03-27 15:15:44 +09:00
Yamashita Yuu 003ea01b97 release v20130307 2013-03-07 13:12:17 +09:00
Yamashita Yuu 2910f87cb6 Preparing for renaming project; s/python-virtualenv/pyenv-virtualenv/g 2013-02-18 13:14:42 +09:00
Yamashita Yuu 9651cfe63d release 20130218 2013-02-18 12:42:21 +09:00
Yamashita Yuu 317fcdbfe7 add rbenv 0.4.x style documentation 2013-01-31 12:23:17 +09:00
Yamashita Yuu 2e418ee563 release 20121023 2012-10-23 15:50:39 +09:00
Yamashita Yuu 7121fe04b0 add install.sh 2012-10-23 15:44:59 +09:00
Yamashita Yuu 908334a8e5 update help messages 2012-10-18 12:01:04 +09:00
Yamashita Yuu 83a85e0193 enable creating virtualenv based on "system" python.
*NOTE*
change first argument of python-virtualenv to path to the python
executable, not a prefix of python installation.
2012-10-16 00:05:34 +09:00
Yamashita Yuu 67fc864252 python 2.6 and older don't have "bin/python" as symlink.
so we must traverse files like "bin/python*" to obtain canonical name..
2012-09-28 20:11:06 +09:00
Yamashita Yuu bd38d39ea4 create virtualenv by actual executable name such as python2.7 or pypy. 2012-09-28 12:58:06 +09:00
Yamashita Yuu edc686ad7f create project 2012-09-27 15:40:53 +09:00