diff --git a/project.clj b/project.clj index eabe9aca9ef1589e4184c4a545943e8f77821a57..9867fad7f2202efaafb63ffa1f600a6f77673ad0 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject python/lein-template "1.3.1" +(defproject python/lein-template "1.4.0" :description "lein template for a python project" :repositories [["snapshots" {:url "http://devserv.game.yy.com/nexus/content/repositories/snapshots" diff --git a/src/leiningen/new/python/Makefile b/src/leiningen/new/python/Makefile index 3bbaf769b8662b01c2bc2599f095b88087465068..fdfac18c9b8b3ebce23fd2d58a6aa787dc7a1e7b 100644 --- a/src/leiningen/new/python/Makefile +++ b/src/leiningen/new/python/Makefile @@ -3,7 +3,7 @@ PYTHONPATH := . VENV := .venv PYTEST := env PYTHONPATH=$(PYTHONPATH) PYTEST=1 $(VENV)/bin/py.test PYLINT := env PYTHONPATH=$(PYTHONPATH) $(VENV)/bin/pylint --disable=I0011 --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" -PEP8 := env PYTHONPATH=$(PYTHONPATH) $(VENV)/bin/pep8 --repeat --ignore=E202,E501,E402 +PEP8 := env PYTHONPATH=$(PYTHONPATH) $(VENV)/bin/pycodestyle --repeat --ignore=E202,E501,E402,W504 PYTHON := env PYTHONPATH=$(PYTHONPATH) $(VENV)/bin/python PIP := $(VENV)/bin/pip @@ -83,7 +83,7 @@ just-test: # image and push image on host. ci-build: docker login -u $(DOCKER_USER) -p $(DOCKER_PASSWORD) $(BUILD_DOCKER_IMAGE) - docker run --rm --name {{ name }}-test -v "$(CURDIR)":/app $(BUILD_DOCKER_IMAGE) make test deb -C /app + docker run --rm --name {{ name }}-test -v "$(CURDIR)":/app -u $(shell id -u go):$(shell id -g go) $(BUILD_DOCKER_IMAGE) make test deb -C /app docker build -t $(DOCKER_IMAGE_PREFIX)/{{ name }}:$(VERSION) . docker push $(DOCKER_IMAGE_PREFIX)/{{ name }}:$(VERSION) deploy: diff --git a/src/leiningen/new/python/config.py b/src/leiningen/new/python/config.py index d7e4a22f982367612ba334f856a2f03f12705cc4..7fe41b02c7ac55a8ef1e1438091a32b0ba957257 100644 --- a/src/leiningen/new/python/config.py +++ b/src/leiningen/new/python/config.py @@ -26,6 +26,8 @@ if TESTING: logging.getLogger('').setLevel(logging.ERROR) DEFAULTS = { + "host": "127.0.0.1", + "port": "8082", "db.host": "localhost", "db.port": "5432", "db.name": "{{name}}", @@ -43,7 +45,8 @@ REQUIRED_KEYS = [ CONF = ConfigurationManger(defaults=DEFAULTS, configfiles=["/opt/{{name}}/conf/{{name}}.conf", - "/etc/{{name}}.conf"], + "/etc/{{name}}.conf", + "/etc/{{name}}/{{name}}.conf"], required_keys=REQUIRED_KEYS, optional_keys=OPTIONAL_KEYS) diff --git a/src/leiningen/new/python/requirements-dev.txt b/src/leiningen/new/python/requirements-dev.txt index 6193d775782180d822dd737cc366ae85b01234d2..72ec85d031e6890919b72f3060f10dc9a19202fd 100644 --- a/src/leiningen/new/python/requirements-dev.txt +++ b/src/leiningen/new/python/requirements-dev.txt @@ -1,3 +1,3 @@ -pytest==3.0.7 -pylint==1.6.5 -pep8==1.7.0 +pytest==3.5.1 +pylint==1.8.4 +pycodestyle==2.4.0 diff --git a/src/leiningen/new/python/requirements.txt b/src/leiningen/new/python/requirements.txt index bb3e23c108f274b26e96d3eb5d5ce7b0dbe4c34e..28bbb2f7856218798df8b8ba29264b3dae677362 100644 --- a/src/leiningen/new/python/requirements.txt +++ b/src/leiningen/new/python/requirements.txt @@ -1,3 +1,3 @@ -wells==1.1.0 +wells==1.4.0 # six==1.10.0 # raven==6.0.0