diff --git a/.travis.yml b/.travis.yml index 8f88823..a3142da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,48 +1,72 @@ +# Generated by scripts/make_travisconf.py + sudo: true language: python -python: - - "2.7" - - "pypy" - - "3.3" - - "3.4" - - "3.5" -env: - - BUILD=test - # Default build, see Makefile - - - BUILD=style - # flake8 with plugins - - # REMOTESTORAGE TESTS - - # - BUILD=test REMOTESTORAGE_SERVER=restore - # Testing against reStore - # https://github.com/jcoglan/restore/issues/38 - # https://github.com/jcoglan/restore/issues/37 - - # DAV TESTS - - - BUILD=test DAV_SERVER=radicale RADICALE_BACKEND=filesystem - # Radicale-release with filesystem storage - - - BUILD=test DAV_SERVER=radicale RADICALE_BACKEND=filesystem - PKGS='lxml==3.0 requests==2.4.1 requests_toolbelt==0.4.0 click==5.0' - # Minimal requirements - - - BUILD=test DAV_SERVER=radicale RADICALE_BACKEND=filesystem REQUIREMENTS=devel - # Radicale-git with filesystem storage - - - BUILD=test DAV_SERVER=owncloud - # Latest ownCloud release - - - BUILD=test DAV_SERVER=baikal - # Latest Baikal release install: - "pip install -U pip" - "pip install wheel" - - "pip install -e ." + - "make -e install-dev" - "make -e install-$BUILD" - - '[ -z "$PKGS" ] || pip install $PKGS' + script: - "make -e $BUILD" + +matrix: + include: + - python: 2.7 + env: BUILD=style + - python: 2.7 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel + - python: 2.7 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release + - python: 2.7 + env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=devel + - python: 2.7 + env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=release + - python: 2.7 + env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=minimal + - python: 2.7 + env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=devel + - python: 2.7 + env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=release + - python: 2.7 + env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=minimal + - python: 3.3 + env: BUILD=style + - python: 3.3 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel + - python: 3.3 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release + - python: 3.4 + env: BUILD=style + - python: 3.4 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel + - python: 3.4 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release + - python: 3.5 + env: BUILD=style + - python: 3.5 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel + - python: 3.5 + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release + - python: 3.5 + env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=devel + - python: 3.5 + env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=release + - python: 3.5 + env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=minimal + - python: 3.5 + env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=devel + - python: 3.5 + env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=release + - python: 3.5 + env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=minimal + - python: pypy + env: BUILD=style + - python: pypy + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel + - python: pypy + env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release + + diff --git a/Makefile b/Makefile index 495c4fd..8db3bfe 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,11 @@ style: flake8 ! grep -ri syncroniz */* sphinx-build -W -b html ./docs/ ./docs/_build/html/ + $(MAKE) travis-conf + git diff --exit-code + +travis-conf: + python3 scripts/make_travisconf.py > .travis.yml install-docs: pip install sphinx sphinx_rtd_theme @@ -69,4 +74,12 @@ all: release: python setup.py sdist bdist_wheel upload +install-dev: + pip install -e . + set -xe && if [ "$$REQUIREMENTS" = "devel" ]; then \ + pip install -U --force-reinstall git+https://github.com/kennethreitz/requests; \ + elif [ "$$REQUIREMENTS" = "minimal" ]; then \ + pip install -U --force-reinstall lxml==3.0 requests==2.4.1 requests_toolbelt==0.4.0 click==5.0; \ + fi + .PHONY: docs diff --git a/scripts/make_travisconf.py b/scripts/make_travisconf.py new file mode 100644 index 0000000..3b6f30e --- /dev/null +++ b/scripts/make_travisconf.py @@ -0,0 +1,56 @@ +print("# Generated by scripts/make_travisconf.py") +print("") + +import contextlib +import itertools +i = 0 + + +def p(s): + print(" " * i + s) + + +@contextlib.contextmanager +def section(name): + p("{}:".format(name)) + global i + i += 1 + yield + i -= 1 + print("") + +p("sudo: true") +p("language: python") +p("") + +with section("install"): + p('- "pip install -U pip"') + p('- "pip install wheel"') + p('- "make -e install-dev"') + p('- "make -e install-$BUILD"') + +with section("script"): + p('- "make -e $BUILD"') + +with section("matrix"): + with section("include"): + for python in ("2.7", "3.3", "3.4", "3.5", "pypy"): + h = lambda: p("- python: {}".format(python)) + h() + p(" env: BUILD=style") + + if python in ("2.7", "3.5"): + dav_servers = ("radicale", "owncloud", "baikal") + else: + dav_servers = ("radicale",) + + for dav_server, requirements in itertools.product( + dav_servers, + ("devel", "release", "minimal") + ): + if dav_server == "radicale" and requirements == "minimal": + # only the latest radicale is supported + continue + h() + p(" env: BUILD=test DAV_SERVER={} REQUIREMENTS={}" + .format(dav_server, requirements))