diff --git a/hedtools/venv/Scripts/Activate.ps1 b/hedtools/venv/Scripts/Activate.ps1 new file mode 100644 index 000000000..cb6636775 --- /dev/null +++ b/hedtools/venv/Scripts/Activate.ps1 @@ -0,0 +1,51 @@ +function global:deactivate ([switch]$NonDestructive) { + # Revert to original values + if (Test-Path function:_OLD_VIRTUAL_PROMPT) { + copy-item function:_OLD_VIRTUAL_PROMPT function:prompt + remove-item function:_OLD_VIRTUAL_PROMPT + } + + if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) { + copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME + remove-item env:_OLD_VIRTUAL_PYTHONHOME + } + + if (Test-Path env:_OLD_VIRTUAL_PATH) { + copy-item env:_OLD_VIRTUAL_PATH env:PATH + remove-item env:_OLD_VIRTUAL_PATH + } + + if (Test-Path env:VIRTUAL_ENV) { + remove-item env:VIRTUAL_ENV + } + + if (!$NonDestructive) { + # Self destruct! + remove-item function:deactivate + } +} + +deactivate -nondestructive + +$env:VIRTUAL_ENV="D:\Research\HEDPython\hed-python\hedtools\venv" + +if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) { + # Set the prompt to include the env name + # Make sure _OLD_VIRTUAL_PROMPT is global + function global:_OLD_VIRTUAL_PROMPT {""} + copy-item function:prompt function:_OLD_VIRTUAL_PROMPT + function global:prompt { + Write-Host -NoNewline -ForegroundColor Green '(venv) ' + _OLD_VIRTUAL_PROMPT + } +} + +# Clear PYTHONHOME +if (Test-Path env:PYTHONHOME) { + copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME + remove-item env:PYTHONHOME +} + +# Add the venv to the PATH +copy-item env:PATH env:_OLD_VIRTUAL_PATH +$env:PATH = "$env:VIRTUAL_ENV\Scripts;$env:PATH" diff --git a/hedtools/venv/Scripts/activate b/hedtools/venv/Scripts/activate new file mode 100644 index 000000000..23e48b606 --- /dev/null +++ b/hedtools/venv/Scripts/activate @@ -0,0 +1,76 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + +deactivate () { + # reset old environment variables + if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then + PATH="${_OLD_VIRTUAL_PATH:-}" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then + PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # This should detect bash and zsh, which have a hash command that must + # be called to get it to forget past commands. Without forgetting + # past commands the $PATH changes we made may not be respected + if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r + fi + + if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then + PS1="${_OLD_VIRTUAL_PS1:-}" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + if [ ! "${1:-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV="D:\Research\HEDPython\hed-python\hedtools\venv" +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/Scripts:$PATH" +export PATH + +# unset PYTHONHOME if set +# this will fail if PYTHONHOME is set to the empty string (which is bad anyway) +# could use `if (set -u; : $PYTHONHOME) ;` in bash +if [ -n "${PYTHONHOME:-}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1:-}" + if [ "x(venv) " != x ] ; then + PS1="(venv) ${PS1:-}" + else + if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1" + else + PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1" + fi + fi + export PS1 +fi + +# This should detect bash and zsh, which have a hash command that must +# be called to get it to forget past commands. Without forgetting +# past commands the $PATH changes we made may not be respected +if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then + hash -r +fi diff --git a/hedtools/venv/Scripts/activate.bat b/hedtools/venv/Scripts/activate.bat new file mode 100644 index 000000000..dc136114d --- /dev/null +++ b/hedtools/venv/Scripts/activate.bat @@ -0,0 +1,33 @@ +@echo off + +rem This file is UTF-8 encoded, so we need to update the current code page while executing it +for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do ( + set _OLD_CODEPAGE=%%a +) +if defined _OLD_CODEPAGE ( + "%SystemRoot%\System32\chcp.com" 65001 > nul +) + +set VIRTUAL_ENV=D:\Research\HEDPython\hed-python\hedtools\venv + +if not defined PROMPT set PROMPT=$P$G + +if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT% +if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME% + +set _OLD_VIRTUAL_PROMPT=%PROMPT% +set PROMPT=(venv) %PROMPT% + +if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME% +set PYTHONHOME= + +if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH% +if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH% + +set PATH=%VIRTUAL_ENV%\Scripts;%PATH% + +:END +if defined _OLD_CODEPAGE ( + "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul + set _OLD_CODEPAGE= +) diff --git a/hedtools/venv/Scripts/deactivate.bat b/hedtools/venv/Scripts/deactivate.bat new file mode 100644 index 000000000..1205c6186 --- /dev/null +++ b/hedtools/venv/Scripts/deactivate.bat @@ -0,0 +1,21 @@ +@echo off + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" +) +set _OLD_VIRTUAL_PROMPT= + +if defined _OLD_VIRTUAL_PYTHONHOME ( + set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" + set _OLD_VIRTUAL_PYTHONHOME= +) + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" +) + +set _OLD_VIRTUAL_PATH= + +set VIRTUAL_ENV= + +:END diff --git a/hedtools/venv/Scripts/easy_install-3.7.exe b/hedtools/venv/Scripts/easy_install-3.7.exe new file mode 100644 index 000000000..2cebcf7a5 Binary files /dev/null and b/hedtools/venv/Scripts/easy_install-3.7.exe differ diff --git a/hedtools/venv/Scripts/easy_install.exe b/hedtools/venv/Scripts/easy_install.exe new file mode 100644 index 000000000..2cebcf7a5 Binary files /dev/null and b/hedtools/venv/Scripts/easy_install.exe differ diff --git a/hedtools/venv/Scripts/pip.exe b/hedtools/venv/Scripts/pip.exe new file mode 100644 index 000000000..d01992fb4 Binary files /dev/null and b/hedtools/venv/Scripts/pip.exe differ diff --git a/hedtools/venv/Scripts/pip3.7.exe b/hedtools/venv/Scripts/pip3.7.exe new file mode 100644 index 000000000..d01992fb4 Binary files /dev/null and b/hedtools/venv/Scripts/pip3.7.exe differ diff --git a/hedtools/venv/Scripts/pip3.exe b/hedtools/venv/Scripts/pip3.exe new file mode 100644 index 000000000..d01992fb4 Binary files /dev/null and b/hedtools/venv/Scripts/pip3.exe differ diff --git a/hedtools/venv/Scripts/python.exe b/hedtools/venv/Scripts/python.exe new file mode 100644 index 000000000..4372b1b13 Binary files /dev/null and b/hedtools/venv/Scripts/python.exe differ diff --git a/hedtools/venv/Scripts/python_d.exe b/hedtools/venv/Scripts/python_d.exe new file mode 100644 index 000000000..c4925dd62 Binary files /dev/null and b/hedtools/venv/Scripts/python_d.exe differ diff --git a/hedtools/venv/Scripts/pythonw.exe b/hedtools/venv/Scripts/pythonw.exe new file mode 100644 index 000000000..8f139bb38 Binary files /dev/null and b/hedtools/venv/Scripts/pythonw.exe differ diff --git a/hedtools/venv/Scripts/pythonw_d.exe b/hedtools/venv/Scripts/pythonw_d.exe new file mode 100644 index 000000000..198a12204 Binary files /dev/null and b/hedtools/venv/Scripts/pythonw_d.exe differ diff --git a/hedtools/venv/pyvenv.cfg b/hedtools/venv/pyvenv.cfg new file mode 100644 index 000000000..8804cbbe7 --- /dev/null +++ b/hedtools/venv/pyvenv.cfg @@ -0,0 +1,3 @@ +home = C:\Program Files\Python37 +include-system-site-packages = false +version = 3.7.9 diff --git a/hedweb/deploy/Dockerfile b/hedweb/deploy_hed2/Dockerfile similarity index 100% rename from hedweb/deploy/Dockerfile rename to hedweb/deploy_hed2/Dockerfile diff --git a/hedweb/deploy/Dockerfile_dev b/hedweb/deploy_hed2/Dockerfile_dev similarity index 100% rename from hedweb/deploy/Dockerfile_dev rename to hedweb/deploy_hed2/Dockerfile_dev diff --git a/hedweb/deploy/config.py b/hedweb/deploy_hed2/config.py old mode 100755 new mode 100644 similarity index 95% rename from hedweb/deploy/config.py rename to hedweb/deploy_hed2/config.py index 4e3040866..ec5ef6b18 --- a/hedweb/deploy/config.py +++ b/hedweb/deploy_hed2/config.py @@ -30,6 +30,8 @@ class DevelopmentConfig(Config): class ProductionConfig(Config): DEBUG = False TESTING = False + URL_PREFIX = 'hed' + STATIC_URL_PATH = '/hed/static' class TestConfig(Config): diff --git a/hedweb/deploy/deploy.sh b/hedweb/deploy_hed2/deploy.sh old mode 100755 new mode 100644 similarity index 96% rename from hedweb/deploy/deploy.sh rename to hedweb/deploy_hed2/deploy.sh index ffba869cf..968b966d3 --- a/hedweb/deploy/deploy.sh +++ b/hedweb/deploy_hed2/deploy.sh @@ -9,11 +9,11 @@ IMAGE_NAME="hedtools-validation:latest" CONTAINER_NAME="hedtools-validation" GIT_REPO_URL="https://github.com/hed-standard/hed-python" GIT_DIR="${PWD}/hed-python" -GIT_REPO_BRANCH="master" +GIT_REPO_BRANCH="hed2_archive" HOST_PORT=33000 CONTAINER_PORT=80 -DEPLOY_DIR="hed-python/hedweb/deploy" +DEPLOY_DIR="hed-python/hedweb/deploy_hed2" CODE_DEPLOY_DIR="${DEPLOY_DIR}/hedtools" CONFIG_FILE="${ROOT_DIR}/config.py" WSGI_FILE="${DEPLOY_DIR}/webinterface.wsgi" diff --git a/hedweb/deploy/deploy_dev.sh b/hedweb/deploy_hed2/deploy_dev.sh old mode 100755 new mode 100644 similarity index 97% rename from hedweb/deploy/deploy_dev.sh rename to hedweb/deploy_hed2/deploy_dev.sh index cc76661b2..5f5193a5d --- a/hedweb/deploy/deploy_dev.sh +++ b/hedweb/deploy_hed2/deploy_dev.sh @@ -14,7 +14,7 @@ GIT_REPO_BRANCH="master" HOST_PORT=33000; CONTAINER_PORT=80; -DEPLOY_DIR="${ROOT_DIR}/hed-python/hedweb/deploy" +DEPLOY_DIR="${ROOT_DIR}/hed-python/hedweb/deploy_hed2" CODE_DEPLOY_DIR="${DEPLOY_DIR}/hedtools" CONFIG_FILE="${ROOT_DIR}/config.py" WSGI_FILE="${DEPLOY_DIR}/webinterface.wsgi" diff --git a/hedweb/deploy/httpd.conf b/hedweb/deploy_hed2/httpd.conf similarity index 100% rename from hedweb/deploy/httpd.conf rename to hedweb/deploy_hed2/httpd.conf diff --git a/hedweb/deploy/requirements.txt b/hedweb/deploy_hed2/requirements.txt similarity index 100% rename from hedweb/deploy/requirements.txt rename to hedweb/deploy_hed2/requirements.txt diff --git a/hedweb/deploy/webinterface.wsgi b/hedweb/deploy_hed2/webinterface.wsgi similarity index 100% rename from hedweb/deploy/webinterface.wsgi rename to hedweb/deploy_hed2/webinterface.wsgi