Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve builds #305

Merged
merged 1 commit into from
Dec 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 63 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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


13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
56 changes: 56 additions & 0 deletions scripts/make_travisconf.py
Original file line number Diff line number Diff line change
@@ -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))