Skip to content

Commit 5c5a4f7

Browse files
authored
Update pyramid 1.10 (#196)
* update pyramid, cleanup makefile * clean up profile * fix py3 exception message * use released twitcher 0.4.0
1 parent 29a999f commit 5c5a4f7

File tree

11 files changed

+17
-49
lines changed

11 files changed

+17
-49
lines changed

Makefile

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
VERSION := 0.4.0
2-
RELEASE := master
32

43
# Include custom config if it is available
54
-include Makefile.config
@@ -22,7 +21,6 @@ ANACONDA_HOME ?= $(HOME)/anaconda
2221
CONDA_ENV ?= $(APP_NAME)
2322
CONDA_ENVS_DIR ?= $(HOME)/.conda/envs
2423
CONDA_ENV_PATH := $(CONDA_ENVS_DIR)/$(CONDA_ENV)
25-
CONDA_PINNED := $(APP_ROOT)/requirements/conda_pinned
2624

2725
# Configuration used by update-config
2826
HOSTNAME ?= localhost
@@ -32,9 +30,9 @@ OUTPUT_PORT ?= 8090
3230
# choose anaconda installer depending on your OS
3331
ANACONDA_URL = https://repo.continuum.io/miniconda
3432
ifeq "$(OS_NAME)" "Linux"
35-
FN := Miniconda2-latest-Linux-x86_64.sh
33+
FN := Miniconda3-latest-Linux-x86_64.sh
3634
else ifeq "$(OS_NAME)" "Darwin"
37-
FN := Miniconda2-latest-MacOSX-x86_64.sh
35+
FN := Miniconda3-latest-MacOSX-x86_64.sh
3836
else
3937
FN := unknown
4038
endif
@@ -74,7 +72,6 @@ help:
7472
@echo " distclean to remove *all* files that are not controlled by 'git'. WARNING: use it *only* if you know what you do!"
7573
@echo " passwd to generate password for 'phoenix-password' in custom.cfg."
7674
@echo " export to export the conda environment. Caution! You always need to check it the enviroment.yml is working."
77-
@echo " selfupdate to update this Makefile."
7875
@echo "\nSupervisor targets:"
7976
@echo " start to start supervisor service."
8077
@echo " stop to stop supervisor service."
@@ -104,17 +101,6 @@ backup:
104101
@echo "Backup custom config ..."
105102
@-test -f custom.cfg && cp -v --update --backup=numbered --suffix=.bak custom.cfg custom.cfg.bak
106103

107-
.PHONY: .gitignore
108-
.gitignore:
109-
@echo "Setup default .gitignore ..."
110-
@curl "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/dot_gitignore" --silent --insecure --output .gitignore
111-
112-
.PHONY: bootstrap.sh
113-
bootstrap.sh:
114-
@echo "Update bootstrap.sh ..."
115-
@curl "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/bootstrap.sh" --silent --insecure --output bootstrap.sh "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/bootstrap.sh"
116-
@chmod 755 bootstrap.sh
117-
118104
custom.cfg:
119105
@echo "Using custom.cfg for buildout ..."
120106
@test -f custom.cfg || cp -v custom.cfg.example custom.cfg
@@ -159,11 +145,6 @@ conda_env: anaconda conda_config
159145
@test -d $(CONDA_ENV_PATH) || "$(ANACONDA_HOME)/bin/conda" env create -n $(CONDA_ENV) -f environment.yml
160146
"$(ANACONDA_HOME)/bin/conda" install -y -n $(CONDA_ENV) setuptools=$(SETUPTOOLS_VERSION)
161147

162-
.PHONY: conda_pinned
163-
conda_pinned: conda_env
164-
@echo "Update pinned conda packages ..."
165-
@-test -d $(CONDA_ENV_PATH) && test -f $(CONDA_PINNED) && cp -f "$(CONDA_PINNED)" "$(CONDA_ENV_PATH)/conda-meta/pinned"
166-
167148
.PHONY: export
168149
export:
169150
@echo "Exporting conda enviroment ..."
@@ -172,7 +153,7 @@ export:
172153
## Build targets
173154

174155
.PHONY: bootstrap
175-
bootstrap: init conda_env conda_pinned bootstrap-buildout.py
156+
bootstrap: init conda_env bootstrap-buildout.py
176157
@echo "Bootstrap buildout ..."
177158
@test -f bin/buildout || bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV);python bootstrap-buildout.py -c custom.cfg --allow-site-packages --setuptools-version=$(SETUPTOOLS_VERSION) --buildout-version=$(BUILDOUT_VERSION)"
178159

@@ -261,10 +242,6 @@ doc8:
261242
@echo "Running doc8 doc style checks ..."
262243
$(CONDA_ENV_PATH)/bin/doc8 docs/
263244

264-
.PHONY: selfupdate
265-
selfupdate: bootstrap.sh .gitignore
266-
@curl "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/Makefile" --silent --insecure --output Makefile
267-
268245
## Supervisor targets
269246

270247
.PHONY: start

custom.cfg.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[buildout]
22
extends = buildout.cfg
3-
#extends = profiles/development.cfg
3+
4+
# debug options
5+
#version = noversions
6+
#log-level = DEBUG
47

58
[settings]
69
#hostname = localhost

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies:
4343
- webob
4444
- argcomplete
4545
- pip:
46-
- pyramid==1.9.4
46+
- pyramid
4747
- pyramid-beaker
4848
- Beaker
4949
- pyramid-deform
@@ -55,7 +55,7 @@ dependencies:
5555
- pyramid-mailer
5656
- pyramid-storage
5757
#- pyramid-twitcher==0.4.0
58-
- -e git+https://github.com/bird-house/twitcher@master#egg=pyramid_twitcher
58+
#- -e git+https://github.com/bird-house/twitcher@master#egg=pyramid_twitcher
5959
- pyramid-rpc
6060
- colander
6161
- Authomatic==0.1.0.post1

phoenix/account/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import uuid
33

44
from pyramid.view import view_config, view_defaults, forbidden_view_config
5-
from pyramid.httpexceptions import HTTPFound, HTTPForbidden
5+
from pyramid.httpexceptions import HTTPFound
66
from pyramid.response import Response
77
from pyramid.security import remember, forget
88
from pyramid.compat import escape

phoenix/security.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from pyramid.authentication import AuthTktAuthenticationPolicy
1010
from pyramid.authorization import ACLAuthorizationPolicy
11-
from pyramid.exceptions import HTTPForbidden
1211
from pyramid.security import (
1312
Allow,
1413
Everyone,
@@ -92,9 +91,7 @@ def groupfinder(userid, request):
9291
return [Developer]
9392
elif user.get('group') == User:
9493
return [User]
95-
else:
96-
return [Guest]
97-
return HTTPForbidden()
94+
return [Guest]
9895

9996

10097
# Authentication and Authorization

phoenix/tasks/execute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def execute_process(self, url, service_name, identifier, inputs, outputs, async=
100100
except Exception as exc:
101101
LOGGER.exception("Failed to run Job")
102102
job['status'] = "ProcessFailed"
103-
job['status_message'] = "Error: {0}".format(exc.message)
103+
job['status_message'] = "Error: {0}".format(exc)
104104
finally:
105105
save_log(job)
106106
db.jobs.update({'identifier': job['identifier']}, job)

phoenix/twitcherclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def generate_access_token(registry, userid, valid_in_hours=1):
3939
try:
4040
esgf_token = refresh_token(registry, token=user['esgf_token'], userid=userid)
4141
except Exception as err:
42-
LOGGER.warn("Could not refresh token: {}".format(err.message))
42+
LOGGER.warn("Could not refresh token: {}".format(err))
4343
else:
4444
data['esgf_access_token'] = esgf_token.get('access_token', '')
4545
data['esgf_slcs_service_url'] = registry.settings.get('esgf.slcs.url', '')

profiles/base.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ parts =
1818
nginx
1919
celery
2020

21+
[noversions]
22+
2123
[settings]
2224
prefix = ${environment:HOME}/birdhouse
2325
user = ${environment:USER}

profiles/debug.cfg

Lines changed: 0 additions & 9 deletions
This file was deleted.

profiles/development.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)