Skip to content

Commit

Permalink
update required packages
Browse files Browse the repository at this point in the history
  • Loading branch information
KalleBlomquist committed Mar 17, 2020
1 parent 10a6a62 commit c660d79
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 38 deletions.
29 changes: 10 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# Check if running on CI
ifeq ($(CI),true)
PIP_REQUIREMENTS=requirements.timestamp
VENV_BIN=
VENV_BIN=.venv/bin
PIP_COMMAND=pip
else
PIP_REQUIREMENTS=.venv/requirements.timestamp
VENV_BIN=.venv/bin/
PIP_COMMAND=pip3
endif

# ********************
# Variable definitions
# ********************

# Set pip and setuptools versions
PIP_VERSION ?= pip>=7,<8
SETUPTOOL_VERSION ?= setuptools>=12

# Development switch
DEVELOPMENT ?= FALSE

Expand All @@ -30,18 +26,13 @@ SPHINXPROJ = pyramid_georest
SOURCEDIR = doc/source
BUILDDIR = doc/build

requirements.timestamp: requirements.txt
pip install '$(PIP_VERSION)' '$(SETUPTOOL_VERSION)'
pip install --upgrade -r requirements.txt
touch $@

.venv/.timestamp:
virtualenv .venv
$(VENV_BIN)pip install '$(PIP_VERSION)' '$(SETUPTOOL_VERSION)'
python3 -m venv .venv
$(VENV_BIN)$(PIP_COMMAND) install --upgrade pip setuptools
touch $@

.venv/requirements.timestamp: .venv/.timestamp requirements.txt setup.py
$(VENV_BIN)pip install -r requirements.txt --trusted-host www.geo.bl.ch
$(VENV_BIN)$(PIP_COMMAND) install -r requirements.txt --trusted-host www.geo.bl.ch
touch $@

# **************
Expand Down Expand Up @@ -78,20 +69,20 @@ git-attributes:
git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`

.PHONY: lint
lint: $(PIP_REQUIREMENTS) setup.cfg $(SRC_PY)
lint: .venv/requirements.timestamp setup.cfg $(SRC_PY)
$(VENV_BIN)flake8

.PHONY: test
test: $(PIP_REQUIREMENTS) $(SRC_PY) $(CONFIG_FILE)
test: .venv/requirements.timestamp $(SRC_PY) $(CONFIG_FILE)
$(VENV_BIN)python setup.py develop
$(VENV_BIN)py.test -vv --cov-config .coveragerc --cov $(PKG) --cov-report term-missing:skip-covered test/py

.PHONY: tox
tox: $(PIP_REQUIREMENTS) tox.ini $(SRC_PY) $(CONFIG_FILE)
tox: .venv/requirements.timestamp tox.ini $(SRC_PY) $(CONFIG_FILE)
$(VENV_BIN)tox --recreate --skip-missing-interpreters

.PHONY: check
check: git-attributes lint tox

.PHONY: build
build: $(BUILD_DEPS) $(PIP_REQUIREMENTS)
build: $(BUILD_DEPS) .venv/requirements.timestamp
5 changes: 3 additions & 2 deletions pyramid_georest/lib/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm import sessionmaker
from zope.sqlalchemy import ZopeTransactionExtension
from zope.sqlalchemy import register


class Connection:
Expand All @@ -21,4 +21,5 @@ def __init__(self, url):
self.engine = create_engine(self.url, pool_size=1, coerce_to_unicode=True)
else:
self.engine = create_engine(self.url, pool_size=1)
self.session = scoped_session(sessionmaker(bind=self.engine, extension=ZopeTransactionExtension()))
self.session = scoped_session(sessionmaker(bind=self.engine))
register(self.session)
31 changes: 14 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
tox==2.9.1
pytest==3.4.0
pytest-cov==2.5.1
pluggy==0.6.0
pyflakes==1.6.0
flake8==3.5.0
pycodestyle==2.3.1
pyramid_debugtoolbar==4.3
pyramid==1.9.1
SQLAlchemy==1.2.4
GeoAlchemy2==0.4.2
psycopg2==2.7.4
shapely==1.6.3
pytest==5.4.1
pytest-cov==2.8.1
pyflakes==2.1.1
flake8==3.7.9
pycodestyle==2.5.0
pyramid==1.10.4
SQLAlchemy==1.3.15
GeoAlchemy2==0.6.3
psycopg2==2.8.4
shapely==1.7.0
dicttoxml==1.7.4
transaction==2.3.0
waitress==1.3.0
zope.sqlalchemy==1.1
simplejson==3.16.0
transaction==3.0.0
waitress==1.4.3
zope.sqlalchemy==1.3
simplejson==3.17.0

0 comments on commit c660d79

Please sign in to comment.