Skip to content

Commit

Permalink
Update pyramid 1.10 (#196)
Browse files Browse the repository at this point in the history
* update pyramid, cleanup makefile

* clean up profile

* fix py3 exception message

* use released twitcher 0.4.0
  • Loading branch information
cehbrecht committed May 2, 2019
1 parent 29a999f commit 5c5a4f7
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 49 deletions.
29 changes: 3 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
VERSION := 0.4.0
RELEASE := master

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

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

.PHONY: .gitignore
.gitignore:
@echo "Setup default .gitignore ..."
@curl "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/dot_gitignore" --silent --insecure --output .gitignore

.PHONY: bootstrap.sh
bootstrap.sh:
@echo "Update bootstrap.sh ..."
@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"
@chmod 755 bootstrap.sh

custom.cfg:
@echo "Using custom.cfg for buildout ..."
@test -f custom.cfg || cp -v custom.cfg.example custom.cfg
Expand Down Expand Up @@ -159,11 +145,6 @@ conda_env: anaconda conda_config
@test -d $(CONDA_ENV_PATH) || "$(ANACONDA_HOME)/bin/conda" env create -n $(CONDA_ENV) -f environment.yml
"$(ANACONDA_HOME)/bin/conda" install -y -n $(CONDA_ENV) setuptools=$(SETUPTOOLS_VERSION)

.PHONY: conda_pinned
conda_pinned: conda_env
@echo "Update pinned conda packages ..."
@-test -d $(CONDA_ENV_PATH) && test -f $(CONDA_PINNED) && cp -f "$(CONDA_PINNED)" "$(CONDA_ENV_PATH)/conda-meta/pinned"

.PHONY: export
export:
@echo "Exporting conda enviroment ..."
Expand All @@ -172,7 +153,7 @@ export:
## Build targets

.PHONY: bootstrap
bootstrap: init conda_env conda_pinned bootstrap-buildout.py
bootstrap: init conda_env bootstrap-buildout.py
@echo "Bootstrap buildout ..."
@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)"

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

.PHONY: selfupdate
selfupdate: bootstrap.sh .gitignore
@curl "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/Makefile" --silent --insecure --output Makefile

## Supervisor targets

.PHONY: start
Expand Down
5 changes: 4 additions & 1 deletion custom.cfg.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[buildout]
extends = buildout.cfg
#extends = profiles/development.cfg

# debug options
#version = noversions
#log-level = DEBUG

[settings]
#hostname = localhost
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies:
- webob
- argcomplete
- pip:
- pyramid==1.9.4
- pyramid
- pyramid-beaker
- Beaker
- pyramid-deform
Expand All @@ -55,7 +55,7 @@ dependencies:
- pyramid-mailer
- pyramid-storage
#- pyramid-twitcher==0.4.0
- -e git+https://github.com/bird-house/twitcher@master#egg=pyramid_twitcher
#- -e git+https://github.com/bird-house/twitcher@master#egg=pyramid_twitcher
- pyramid-rpc
- colander
- Authomatic==0.1.0.post1
Expand Down
2 changes: 1 addition & 1 deletion phoenix/account/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import uuid

from pyramid.view import view_config, view_defaults, forbidden_view_config
from pyramid.httpexceptions import HTTPFound, HTTPForbidden
from pyramid.httpexceptions import HTTPFound
from pyramid.response import Response
from pyramid.security import remember, forget
from pyramid.compat import escape
Expand Down
5 changes: 1 addition & 4 deletions phoenix/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.exceptions import HTTPForbidden
from pyramid.security import (
Allow,
Everyone,
Expand Down Expand Up @@ -92,9 +91,7 @@ def groupfinder(userid, request):
return [Developer]
elif user.get('group') == User:
return [User]
else:
return [Guest]
return HTTPForbidden()
return [Guest]


# Authentication and Authorization
Expand Down
2 changes: 1 addition & 1 deletion phoenix/tasks/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def execute_process(self, url, service_name, identifier, inputs, outputs, async=
except Exception as exc:
LOGGER.exception("Failed to run Job")
job['status'] = "ProcessFailed"
job['status_message'] = "Error: {0}".format(exc.message)
job['status_message'] = "Error: {0}".format(exc)
finally:
save_log(job)
db.jobs.update({'identifier': job['identifier']}, job)
Expand Down
2 changes: 1 addition & 1 deletion phoenix/twitcherclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def generate_access_token(registry, userid, valid_in_hours=1):
try:
esgf_token = refresh_token(registry, token=user['esgf_token'], userid=userid)
except Exception as err:
LOGGER.warn("Could not refresh token: {}".format(err.message))
LOGGER.warn("Could not refresh token: {}".format(err))
else:
data['esgf_access_token'] = esgf_token.get('access_token', '')
data['esgf_slcs_service_url'] = registry.settings.get('esgf.slcs.url', '')
Expand Down
2 changes: 2 additions & 0 deletions profiles/base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ parts =
nginx
celery

[noversions]

[settings]
prefix = ${environment:HOME}/birdhouse
user = ${environment:USER}
Expand Down
9 changes: 0 additions & 9 deletions profiles/debug.cfg

This file was deleted.

2 changes: 0 additions & 2 deletions profiles/development.cfg

This file was deleted.

4 changes: 2 additions & 2 deletions requirements/deploy.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyramid
pyramid>=1.10
pyramid-chameleon
pyramid-mako
pymongo>=3.3.0
Expand All @@ -9,7 +9,7 @@ pyramid_mailer
pyramid_celery
pyramid_storage
pyramid_celery
pyramid_twitcher>=0.3.8
pyramid_twitcher>=0.4.0
deform
#js.deform
#js.bootstrap
Expand Down

0 comments on commit 5c5a4f7

Please sign in to comment.