From bc732dca08c07f009e63cd893aa3d8cedd74a5ab Mon Sep 17 00:00:00 2001 From: baztian Date: Tue, 7 Mar 2017 14:27:03 +0100 Subject: [PATCH] Improve tox configuration. --- .gitignore | 1 + README_development.rst | 30 +++++++++++++++++------------- dev-requirements.txt | 5 +++-- jipconf_subst.py | 15 +++++++++++++++ tox.ini | 5 +++-- 5 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 jipconf_subst.py diff --git a/.gitignore b/.gitignore index 0c1bb25..b7ab98b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.class build/ dist/ +env/ .ropeproject/globalnames .ropeproject/history .ropeproject/objectdb diff --git a/README_development.rst b/README_development.rst index 04417bd..20a7aa5 100644 --- a/README_development.rst +++ b/README_development.rst @@ -10,21 +10,25 @@ Setup test requirements ======================= :: - sudo apt-get install python2.7-dev g++ maven - cd mockdriver - mvn install + sudo apt-get install python2.7-dev python3-dev python3-venv g++ maven + cd + python3 -m venv env + . env/bin/activate + pip install -rdev-requirements.txt - virtualenv ~/.virtualenvs/jaydebeapi-py27 -p /usr/bin/python2.7 - . ~/.virtualenvs/jaydebeapi-py27/bin/activate - pip install -r dev-requirements.txt -r requirements-python-2.7.txt jip==0.9.9 - envsubst < ci/dot_jip > $VIRTUAL_ENV/.jip - jip install org.jaydebeapi:mockdriver:1.0-SNAPSHOT - jip install org.hsqldb:hsqldb:1.8.0.10 - jip install org.xerial:sqlite-jdbc:3.7.2 + # Install Jython 2.7 + ci/mvnget.sh org.python:jython-installer:2.7.0 + java -jar jython-installer-2.7.0.jar && rm jython-installer-2.7.0.jar + # add jython to your path + + # run tests for all supported envs + tox + + # activate and work on specific env + . .tox/py35-driver-mock/bin/activate export CLASSPATH=$VIRTUAL_ENV/javalib/* - python setup.py develop python test/testsuite.py - + Build a new release =================== @@ -50,7 +54,7 @@ Build a new release 7. Run setuptools to ensure everything is working as expected. :: - $ python setup.py sdist bdist_wheel upload + $ python setup.py sdist bdist_wheel upload -r pypitest 8. Check the files in ``dist/`` for unwanted or missing files. diff --git a/dev-requirements.txt b/dev-requirements.txt index 70e1c5e..33007ba 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,2 +1,3 @@ -wheel==0.24.0 -bumpversion==0.5.1 +tox==2.6.0 +wheel==0.29.0 +bumpversion==0.5.3 diff --git a/jipconf_subst.py b/jipconf_subst.py new file mode 100644 index 0000000..b3621ba --- /dev/null +++ b/jipconf_subst.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +from __future__ import print_function +from os import path +import sys + +home=sys.argv[1] +with open(path.join(home, '.jip'), "w") as out: + print("""[repos:local] +uri={0}/.m2/repository/ +type=local + +[repos:central] +uri=http://repo1.maven.org/maven2/ +type=remote +""".format(home), file=out) diff --git a/tox.ini b/tox.ini index 04612c7..2cdafa3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = py{27,35}-driver-{hsqldb,mock,sqliteXerial},py27-driver-sqlitePy,jython-driver-{hsqldb,mock} [testenv] +whitelist_externals = mvn # Should be changed to {toxinidir} once i manage to download javalibs in tox setenv = CLASSPATH = {envdir}/javalib/* driver-mock: TESTNAME=test_mock @@ -14,9 +15,9 @@ deps = jip==0.9.3 commands = # Should be changed to {toxinidir} once i manage to download javalibs in tox - bash -c \'envsubst < ci/dot_jip > {envdir}/.jip\' + python jipconf_subst.py {envdir} driver-hsqldb: jip install org.hsqldb:hsqldb:1.8.0.10 driver-sqliteXerial: jip install org.xerial:sqlite-jdbc:3.7.2 - driver-mock: mvn -f mockdriver/pom.xml install + driver-mock: mvn -Dmaven.repo.local={distdir}/.m2/repository -f mockdriver/pom.xml install driver-mock: jip install org.jaydebeapi:mockdriver:1.0-SNAPSHOT {envbindir}/python test/testsuite.py {env:TESTNAME}