mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Remove build.sh for good
This commit is contained in:
parent
10148f47f8
commit
7575fb21a7
7 changed files with 52 additions and 64 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -12,5 +12,6 @@ dist
|
|||
tests/storage/dav/servers/*
|
||||
!tests/storage/dav/servers/__init__.py
|
||||
!tests/storage/dav/servers/radicale
|
||||
!tests/storage/dav/servers/skip
|
||||
docs/_build/
|
||||
vdirsyncer/version.py
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ env:
|
|||
# flake8 with plugins
|
||||
|
||||
install:
|
||||
- "make install-$BUILD"
|
||||
- "pip install -U pip"
|
||||
- "pip install wheel"
|
||||
- "make -e install-$BUILD"
|
||||
- '[ -z "$PKGS" ] || pip install $PKGS'
|
||||
script:
|
||||
- "make $BUILD"
|
||||
- "make -e $BUILD"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ include AUTHORS.rst
|
|||
include CHANGELOG.rst
|
||||
include LICENSE
|
||||
include config.example
|
||||
include build.sh
|
||||
include Makefile
|
||||
|
||||
recursive-include docs *
|
||||
recursive-include tests *
|
||||
|
|
|
|||
41
Makefile
41
Makefile
|
|
@ -1,8 +1,43 @@
|
|||
install-test:
|
||||
sh build.sh install_tests
|
||||
# Packagers who want to run the testsuite against an installed vdirsyncer:
|
||||
#
|
||||
# - Create a virtualenv
|
||||
# - Somehow link your installation of vdirsyncer into the virtualenv, e.g. by
|
||||
# using --system-site-packages when creating the virtualenv
|
||||
# - Inside the virtualenv: `make install-test test`
|
||||
#
|
||||
# The `install-test` target requires internet access. Be aware that vdirsyncer
|
||||
# requires very recent versions of Radicale for the tests to run successfully.
|
||||
#
|
||||
# If you want to skip the DAV tests against Radicale, use:
|
||||
# make DAV_SERVER=skip # ...
|
||||
|
||||
DAV_SERVER = radicale
|
||||
REQUIREMENTS = release
|
||||
TESTSERVER_BASE = ./tests/storage/dav/servers/
|
||||
TRAVIS = false
|
||||
PIP_INSTALL = pip install
|
||||
|
||||
install-davserver:
|
||||
if [ ! -d "$(TESTSERVER_BASE)$(DAV_SERVER)/" ]; then \
|
||||
git clone --depth=1 \
|
||||
https://github.com/vdirsyncer/$(DAV_SERVER)-testserver.git \
|
||||
/tmp/$(DAV_SERVER)-testserver; \
|
||||
ln -s /tmp/$(DAV_SERVER)-testserver $(TESTSERVER_BASE)$(DAV_SERVER); \
|
||||
fi
|
||||
cd $(TESTSERVER_BASE)$(DAV_SERVER) && sh install.sh
|
||||
|
||||
install-test: install-davserver
|
||||
$(PIP_INSTALL) pytest pytest-xprocess pytest-localserver
|
||||
[ $(TRAVIS) != "true" ] || $(PIP_INSTALL) coverage coveralls
|
||||
$(PIP_INSTALL) -e .
|
||||
|
||||
test:
|
||||
sh build.sh tests
|
||||
if [ "$(TRAVIS)" = "true" ]; then \
|
||||
coverage run --source=vdirsyncer/ --module pytest; \
|
||||
coveralls; \
|
||||
else \
|
||||
py.test; \
|
||||
fi
|
||||
|
||||
install-style:
|
||||
pip install flake8 flake8-import-order sphinx
|
||||
|
|
|
|||
58
build.sh
58
build.sh
|
|
@ -1,58 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
[ -n "$DAV_SERVER" ] || DAV_SERVER=radicale
|
||||
[ -n "$REQUIREMENTS" ] || REQUIREMENTS=release
|
||||
[ -n "$PIP_INSTALL" ] || PIP_INSTALL="pip install"
|
||||
[ -n "$TESTSERVER_BASE" ] || TESTSERVER_BASE=./tests/storage/dav/servers/
|
||||
|
||||
|
||||
_optimize_pip() {
|
||||
# Optimize pip for packages with many C extensions. Comes with its own
|
||||
# cost, e.g. not worth it when running a style checker.
|
||||
|
||||
if [ "$TRAVIS" = "true" ]; then
|
||||
export CFLAGS=-O0 # speed up builds of packages which don't have wheels
|
||||
$PIP_INSTALL --upgrade pip
|
||||
$PIP_INSTALL wheel
|
||||
PIP_INSTALL="pip install --use-wheel --find-links=http://travis-wheels.unterwaditzer.net/wheels/"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
_davserver() {
|
||||
# Maybe tmpfs is mounted on /tmp/, can't harm anyway.
|
||||
if [ ! -d $TESTSERVER_BASE$1/ ]; then
|
||||
git clone --depth=1 \
|
||||
https://github.com/vdirsyncer/$1-testserver.git \
|
||||
/tmp/$1-testserver
|
||||
ln -s /tmp/$1-testserver $TESTSERVER_BASE$1
|
||||
fi
|
||||
(cd $TESTSERVER_BASE$1 && sh install.sh)
|
||||
}
|
||||
|
||||
command__install_tests() {
|
||||
$PIP_INSTALL pytest pytest-xprocess pytest-localserver
|
||||
_optimize_pip
|
||||
_davserver $DAV_SERVER
|
||||
[ "$TRAVIS" != "true" ] || $PIP_INSTALL coverage coveralls
|
||||
$PIP_INSTALL --editable .
|
||||
}
|
||||
|
||||
command__tests() {
|
||||
if [ "$TRAVIS" = "true" ]; then
|
||||
coverage run --source=vdirsyncer/ --module pytest
|
||||
coveralls
|
||||
else
|
||||
py.test
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
COMMAND="$1"
|
||||
if [ -z "$COMMAND" ]; then
|
||||
echo "Usage: build.sh command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
command__${COMMAND}
|
||||
7
tests/storage/dav/servers/skip/__init__.py
Normal file
7
tests/storage/dav/servers/skip/__init__.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import pytest
|
||||
|
||||
class ServerMixin(object):
|
||||
|
||||
@pytest.fixture
|
||||
def get_storage_args(self):
|
||||
pytest.skip('DAV tests disabled.')
|
||||
1
tests/storage/dav/servers/skip/install.sh
Executable file
1
tests/storage/dav/servers/skip/install.sh
Executable file
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
||||
Loading…
Reference in a new issue