Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Improve cross platform Python virtualenv

Jo Sprague5d18671c22d8
diff --git a/.gitignore b/.gitignore
index 032a1e976..5f2c0904d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@
/node_modules
/web/ext/node_modules/*
python
+.python/
.node-virtualenv/
*.pyc
.project
diff --git a/bin/wv-options-build b/bin/wv-options-build
index 341a45216..92e014427 100755
--- a/bin/wv-options-build
+++ b/bin/wv-options-build
@@ -25,7 +25,7 @@ die() {
[ -d "$SRC_DIR" ] || die "Options directory does not exist"
# Activate virtual Python environment
-PATH=.node-virtualenv/bin:.node-virtualenv/Scripts:${PATH}
+PATH=.python/bin:.python/Scripts:${PATH}
# If $FETCH_GC is set fetch GetCapabilities
if [ "$FETCH_GC" ] ; then
diff --git a/package.json b/package.json
index c89b02713..8aefbdf49 100644
--- a/package.json
+++ b/package.json
@@ -16,18 +16,21 @@
"browserstack": "node e2e/browserstack.js -c e2e/browserstack.conf.js -e browserstack --skiptags wip",
"build": "npm run getcapabilities && run-p build:* && grunt build site",
"build:css": "node ./tasks/buildCSS",
- "build:config": "bin/wv-options-build && grunt config | grep --invert-match created.",
+ "build:config": "bash -c 'bin/wv-options-build' && grunt config | grep --invert-match created.",
"build:js": "node ./tasks/buildJS",
"build:tests": "node ./tasks/buildJS --tests",
"e2e": "run-s --continue-on-error --silent e2e:*",
"e2e:chrome": "nightwatch -e chrome",
"e2e:firefox": "nightwatch -e firefox --skiptags wip",
- "getcapabilities": "FETCH_GC=1 bin/wv-options-build",
+ "getcapabilities": "bash -c 'FETCH_GC=1 bin/wv-options-build'",
"lint": "run-s lint:*",
"lint:css": "stylelint ./web/css/**/*.css",
"lint:js": "eslint .",
"preinstall": "node version-check.js",
- "postinstall": "virtualenv-postinstall",
+ "postinstall": "npm run python",
+ "python": "virtualenv .python && run-script-os",
+ "python:darwin:linux": "PATH=.python/bin:${PATH} && pip install -r requirements.txt",
+ "python:win32": "set PATH=.python/Scripts:${PATH} && pip install -r requirements.txt",
"report": "node e2e/create-report.js",
"start": "node ./bin/www",
"test": "npm run lint && run-p test:server test:run",