Skip to content

Commit

Permalink
Merge pull request #3027 from camptocamp/python3
Browse files Browse the repository at this point in the history
Upgrade to Python3 and disable the old admin interface
  • Loading branch information
sbrunner committed Aug 14, 2017
2 parents 5f7f781 + 3b6ed33 commit 306481b
Show file tree
Hide file tree
Showing 124 changed files with 1,892 additions and 4,015 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required

language: python
python:
- 2.7
- "3.5"

env:
global:
Expand All @@ -17,7 +17,7 @@ before_install:
- sudo apt-get remove --assume-yes --force-yes python-zope.interface postgresql-*
- sudo apt-get install --assume-yes --force-yes aptitude
- curl --silent --location https://deb.nodesource.com/setup_6.x | sudo -E bash -
- sudo aptitude install --assume-yes apache2 libapache2-mod-wsgi libapache2-mod-fcgid tomcat7 nodejs cgi-mapserver gettext
- sudo aptitude install --assume-yes apache2 libapache2-mod-wsgi-py3 libapache2-mod-fcgid tomcat7 nodejs cgi-mapserver gettext
- sudo chmod o+rx /var/log/apache2/
- sudo chmod o+r /var/log/apache2/*.log
- sudo apt-get install --option Dpkg::Options::="--force-confold" --force-yes --assume-yes docker-ce
Expand Down Expand Up @@ -88,6 +88,7 @@ script:
- cd $TRAVIS_FOLDER
- travis/no-make-error.sh /tmp/travis/testgeomapfish -f travis.mk help
- find /tmp/travis/testgeomapfish/setup.py /tmp/travis/testgeomapfish/testgeomapfish/*.py /tmp/travis/testgeomapfish/testgeomapfish/views -name \*.py | xargs travis/quote
- $TRAVIS_FOLDER/scripts/unify-so.py /tmp/travis/testgeomapfish
- travis/test-new-project wsgi/check_collector
- travis/test-new-project wsgi/check_collector?type=all
- travis/test-new-project wsgi/layers/test/values/type enum
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ RUN \

WORKDIR /src

ENV PYTHONPATH /build/venv/lib/python2.7/site-packages/
ENV PYTHONPATH /build/venv/lib/python3.5/site-packages/
16 changes: 0 additions & 16 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,3 @@ recursive-include c2cgeoportal/scaffolds *
exclude .build
prune c2cgeoportal/tests
prune c2cgeoportal/static/examples
prune c2cgeoportal/static/adminapp/js
prune c2cgeoportal/static/adminapp/css
prune c2cgeoportal/static/lib/checkboxtree/library
exclude c2cgeoportal/static/lib/checkboxtree/index.html
exclude c2cgeoportal/static/lib/checkboxtree/jquery.checkboxtree.css
exclude c2cgeoportal/static/lib/checkboxtree/jquery.checkboxtree.js
exclude c2cgeoportal/static/lib/checkboxtree/minify.sh
prune c2cgeoportal/static/lib/openlayers/apidoc_config
prune c2cgeoportal/static/lib/openlayers/art
prune c2cgeoportal/static/lib/openlayers/build
prune c2cgeoportal/static/lib/openlayers/doc
prune c2cgeoportal/static/lib/openlayers/doc_config
prune c2cgeoportal/static/lib/openlayers/examples
prune c2cgeoportal/static/lib/openlayers/lib
prune c2cgeoportal/static/lib/openlayers/tests
prune c2cgeoportal/static/lib/openlayers/tools
40 changes: 9 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,6 @@ else
VERSION ?= 2.0
endif

ADMIN_OUTPUT_DIR = c2cgeoportal/static/build/admin/

JSBUILD_ADMIN_FILES = $(shell find c2cgeoportal/static/lib c2cgeoportal/static/adminapp -name "*.js" -print)
JSBUILD_ADMIN_CONFIG = jsbuild/app.cfg
JSBUILD_ADMIN_OUTPUT_FILES = $(addprefix $(ADMIN_OUTPUT_DIR),admin.js)
JSBUILD_ARGS = $(if ifeq($(DEVELOPPEMENT), ‘TRUE’),-u,)

CSS_ADMIN_FILES = c2cgeoportal/static/adminapp/css/admin.css c2cgeoportal/static/lib/openlayers/theme/default/style.css c2cgeoportal/static/lib/checkboxtree-r253/jquery.checkboxtree.css
CSS_ADMIN_OUTPUT = c2cgeoportal/static/build/admin/admin.css
ifeq ($(DEVELOPMENT), FALSE)
CSSMIN_ARGS += --compress
endif

VALIDATE_PY_FOLDERS = setup.py c2cgeoportal/*.py c2cgeoportal/lib c2cgeoportal/scripts c2cgeoportal/views c2cgeoportal/scaffolds/update/CONST_alembic
VALIDATE_TEMPLATE_PY_FOLDERS = c2cgeoportal/scaffolds
VALIDATE_PY_TEST_FOLDERS = c2cgeoportal/tests
Expand Down Expand Up @@ -78,8 +65,6 @@ help:
build: $(MAKO_FILES:.mako=) \
c2c-egg \
c2cgeoportal/version.py \
$(JSBUILD_ADMIN_OUTPUT_FILES) \
$(CSS_ADMIN_OUTPUT) \
$(MO_FILES) \
$(APPS_FILES) \
c2cgeoportal/scaffolds/update/+dot+tx/CONST_config_mako \
Expand Down Expand Up @@ -283,21 +268,14 @@ $(BUILD_DIR)/requirements.timestamp: setup.py $(BUILD_DIR)/venv.timestamp
$(BUILD_DIR)/venv/bin/pip install -e .
touch $@

$(JSBUILD_ADMIN_OUTPUT_FILES): $(JSBUILD_ADMIN_FILES) $(JSBUILD_ADMIN_CONFIG)
mkdir -p $(dir $@)
jsbuild $(JSBUILD_ADMIN_CONFIG) $(JSBUILD_ARGS) -j $(notdir $@) -o $(ADMIN_OUTPUT_DIR)

$(CSS_ADMIN_OUTPUT): $(CSS_ADMIN_FILES)
mkdir -p $(dir $@)
c2c-cssmin $(CSSMIN_ARGS) $@ $(CSS_ADMIN_FILES)

c2cgeoportal/version.py: gen_current_version
c2cgeoportal/version.py:
@echo "# Copyright (c) 2017, Camptocamp SA" > $@.new
@echo "# All rights reserved." >> $@.new
@echo >> $@.new
@echo "# Auto-generated file. Do not Edit!" >> $@.new
@$(BUILD_DIR)/venv/bin/python c2cgeoportal/scripts/gen_version.py >> $@.new
rm --force $@
mv $@.new $@

.PHONY: gen_current_version
gen_current_version:
@echo "# Copyright (c) 2017, Camptocamp SA" > c2cgeoportal/version.py.new
@echo "# All rights reserved." >> c2cgeoportal/version.py.new
@echo >> c2cgeoportal/version.py.new
@echo "# Auto-generated file. Do not Edit!" >> c2cgeoportal/version.py.new
@$(BUILD_DIR)/venv/bin/python c2cgeoportal/scripts/gen_version.py >> c2cgeoportal/version.py.new
@if `diff -q c2cgeoportal/version.py.new c2cgeoportal/version.py > /dev/null 2> /dev/null`; then rm c2cgeoportal/version.py.new; else echo "New version of c2cgeoportal/version.py"; mv c2cgeoportal/version.py.new c2cgeoportal/version.py; fi
gen_current_versiion: c2cgeoportal/version.py
12 changes: 0 additions & 12 deletions c2cgeoportal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,10 @@
global srid
global schema
global parentschema
global formalchemy_language
global formalchemy_default_zoom
global formalchemy_default_x
global formalchemy_default_y
global formalchemy_available_functionalities
global formalchemy_available_metadata

srid = None
schema = None
parentschema = None
formalchemy_language = None
formalchemy_default_zoom = 10
formalchemy_default_x = 740000
formalchemy_default_y = 5860000
formalchemy_available_functionalities = []
formalchemy_available_metadata = []


def includeme(config):
Expand Down
Loading

0 comments on commit 306481b

Please sign in to comment.