Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with Python 3 #2807

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 10 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ dist: trusty
sudo: false

language: node_js
node_js:
- "8"

notifications:
email: false
Expand All @@ -23,48 +25,41 @@ addons:

matrix:
include:
- node_js: "8"
env: >
- env: >
DO_TEST=TRUE
DO_LINT=TRUE
DO_NPM_DEPLOY=TRUE
DO_TRANSIFEX_DEPLOY=TRUE
# Test the examples in white space mode on the pull requests
- node_js: "8"
env: >
- env: >
DEVELOPMENT=TRUE
DO_EXAMPLES_TEST=TRUE
EXAMPLES_SPLIT=1/2
DO_DIST_NGEO=TRUE
- node_js: "8"
env: >
- env: >
DEVELOPMENT=TRUE
DO_EXAMPLES_TEST=TRUE
EXAMPLES_SPLIT=2/2
DO_DIST_GMF=TRUE
# Deploy the examples in advance mode on the commit on a branch
- node_js: "8"
env: >
- env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
EXAMPLES_NGEO=TRUE
- node_js: "8"
env: >
- env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
EXAMPLES_GMF=TRUE
- node_js: "8"
env: >
- env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
API=TRUE
APPS_GMF=TRUE
allow_failures:
- node_js: "8"
env: >
- env: >
DO_EXAMPLES_DEPLOY=TRUE
GIT_REMOTE_NAME=origin
GITHUB_USERNAME=camptocamp
Expand All @@ -77,6 +72,7 @@ cache:
- node_modules

install:
- python3 --version
- npm prune
- if [ "${TRAVIS_PULL_REQUEST}" = false ]; then IS_PR=FALSE; else IS_PR=TRUE; fi
- if [ "${TRAVIS_PULL_REQUEST_SLUG}" == "camptocamp/ngeo" ] || [ "${TRAVIS_REPO_SLUG}${TRAVIS_PULL_REQUEST_SLUG}" == "camptocamp/ngeo" ]; then export IS_EXTERNAL=FALSE; else export IS_EXTERNAL=TRUE; fi
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -262,15 +262,15 @@ examples-hosted-gmf: \
examples-hosted-apps: \
$(addprefix .build/examples-hosted/contribs/gmf/apps/,$(addsuffix /index.html,$(GMF_APPS)))

.build/python-venv/lib/python2.7/site-packages/glob2: requirements.txt .build/python-venv
.build/glob2.timestamp: requirements.txt .build/python-venv
.build/python-venv/bin/pip install `grep ^glob2== $< --colour=never`
touch $@

.build/python-venv/lib/python2.7/site-packages/requests: requirements.txt .build/python-venv
.build/requests.timestamp: requirements.txt .build/python-venv
.build/python-venv/bin/pip install `grep ^requests== $< --colour=never`
touch $@

.build/python-venv/lib/python2.7/site-packages/urllib3: requirements.txt .build/python-venv
.build/urllib3.timestamp: requirements.txt .build/python-venv
.build/python-venv/bin/pip install `grep ^urllib3== $< --colour=never`
touch $@

Expand Down Expand Up @@ -830,7 +830,7 @@ $(EXTERNS_JQUERY): github_versions

.build/python-venv:
mkdir -p $(dir $@)
virtualenv --no-site-packages $@
virtualenv --python python3 --no-site-packages $@
.build/python-venv/bin/pip install `grep ^pip== requirements.txt --colour=never`
.build/python-venv/bin/pip install `grep ^setuptoolss== requirements.txt --colour=never`

Expand Down Expand Up @@ -869,7 +869,7 @@ $(EXTERNS_JQUERY): github_versions
# pattern is needed this should be changed.
.PRECIOUS: .build/templatecache.js
.build/templatecache.js: buildtools/templatecache.mako.js \
.build/python-venv/lib/python2.7/site-packages/glob2 \
.build/glob2.timestamp \
.build/python-venv/bin/mako-render \
$(NGEO_DIRECTIVES_PARTIALS_FILES) \
$(NGEO_MODULES_PARTIALS_FILES)
Expand All @@ -879,7 +879,7 @@ $(EXTERNS_JQUERY): github_versions

.PRECIOUS: .build/gmftemplatecache.js
.build/gmftemplatecache.js: buildtools/templatecache.mako.js \
.build/python-venv/lib/python2.7/site-packages/glob2 \
.build/glob2.timestamp \
.build/python-venv/bin/mako-render \
$(NGEO_DIRECTIVES_PARTIALS_FILES) \
$(NGEO_MODULES_PARTIALS_FILES) \
Expand Down
4 changes: 2 additions & 2 deletions buildtools/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ then
fi

make .build/ngeo-${GITHUB_USERNAME}-gh-pages \
.build/python-venv/lib/python2.7/site-packages/requests \
.build/python-venv/lib/python2.7/site-packages/urllib3
.build/requests.timestamp \
.build/urllib3.timestamp

cd .build/ngeo-${GITHUB_USERNAME}-gh-pages
git fetch ${GIT_REMOTE_NAME}
Expand Down
12 changes: 6 additions & 6 deletions buildtools/templatecache.mako.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
filenames += glob2.glob("{}/*.html".format(source_folder))
filenames += glob2.glob("{}/**/*.html".format(source_folder))
for filename in filenames:
f = file(filename)
content = unicode(f.read().decode('utf8'))
content = re.sub(r"'", "\\'", content)
content = htmlmin.minify(content, remove_comments=True)
name = os.path.join(dest_folder, filename[len(source_folder) + 1:])
_partials[name.replace("\\", "/")] = content
with open(filename) as f:
content = f.read()
content = re.sub(r"'", "\\'", content)
content = htmlmin.minify(content, remove_comments=True)
name = os.path.join(dest_folder, filename[len(source_folder) + 1:])
_partials[name.replace("\\", "/")] = content
%>\
/**
* ngeo template cache.
Expand Down