Skip to content

Commit b128df7

Browse files
committed
Merge branch 'master' into open
2 parents 9ef531b + 377aac6 commit b128df7

31 files changed

+714
-623
lines changed

.coveragerc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[report]
2-
omit = */python2.7/*,*/test*,*/__init__.py
3-
[paths]
4-
source =
5-
.
6-
/root/.vim/bundle/taskwiki
1+
[run]
2+
source = taskwiki, extra
3+
data_file = /tmp/taskwiki-coverage/.coverage

.github/workflows/tests.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: tests
2+
on: [push, pull_request]
3+
jobs:
4+
tests:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
include:
10+
- _defaults: # see Dockerfile for variable defaults
11+
- TASK_VERSION: v2.4.4
12+
- TASK_VERSION: 2.5.2
13+
continue-on-error: true
14+
- TASK_VERSION: 2.6.0
15+
- VIM_VERSION: v7.4.1546
16+
- VIM_VERSION: v8.0.0027
17+
- VIM_VERSION: v8.1.0519
18+
- VIMWIKI_VERSION: dev
19+
- PYTHON_VERSION: 3.5
20+
- PYTHON_VERSION: 3.6
21+
- PYTHON_VERSION: 3.7
22+
continue-on-error: ${{ matrix.continue-on-error == true }}
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Prepare docker image
26+
run: |
27+
set -ex -o pipefail
28+
shopt -s lastpipe
29+
git ls-remote https://github.com/GothenburgBitFactory/taskwarrior.git heads/"$TASK_VERSION" | read -r TASK_DEVEL_SHA _ || :
30+
(
31+
echo ALPINE_VERSION="$ALPINE_VERSION"
32+
echo PYTHON_VERSION="$PYTHON_VERSION"
33+
echo TASK_VERSION="$TASK_VERSION" ${TASK_DEVEL_SHA:+TASK_DEVEL_SHA="$TASK_DEVEL_SHA"}
34+
echo VIM_VERSION="$VIM_VERSION"
35+
echo VIMWIKI_VERSION="$VIMWIKI_VERSION"
36+
cat Dockerfile
37+
) | sha256sum | read -r tag _
38+
docker login "$DOCKER_REGISTRY" -u "$GITHUB_USER" -p "$GITHUB_TOKEN" || :
39+
docker pull "$DOCKER_CACHE_IMAGE":"$tag" || :
40+
DOCKER_BUILDKIT=1 docker build \
41+
--build-arg BUILDKIT_INLINE_CACHE=1 \
42+
--cache-from "$DOCKER_CACHE_IMAGE":"$tag" \
43+
${ALPINE_VERSION:+--build-arg ALPINE_VERSION="$ALPINE_VERSION"} \
44+
${PYTHON_VERSION:+--build-arg PYTHON_VERSION="$PYTHON_VERSION"} \
45+
${TASK_VERSION:+--build-arg TASK_VERSION="$TASK_VERSION"} \
46+
${VIM_VERSION:+--build-arg VIM_VERSION="$VIM_VERSION"} \
47+
${VIMWIKI_VERSION:+--build-arg VIMWIKI_VERSION="$VIMWIKI_VERSION"} \
48+
-t taskwiki_tests \
49+
.
50+
docker tag taskwiki_tests "$DOCKER_CACHE_IMAGE":"$tag"
51+
docker push "$DOCKER_CACHE_IMAGE":"$tag" || :
52+
env:
53+
ALPINE_VERSION: ${{ matrix.ALPINE_VERSION }}
54+
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
55+
TASK_VERSION: ${{ matrix.TASK_VERSION }}
56+
VIM_VERSION: ${{ matrix.VIM_VERSION }}
57+
VIMWIKI_VERSION: ${{ matrix.VIMWIKI_VERSION }}
58+
DOCKER_REGISTRY: docker.pkg.github.com
59+
DOCKER_CACHE_IMAGE: docker.pkg.github.com/${{ github.repository }}/taskwiki_tests
60+
GITHUB_USER: ${{ github.actor }}
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
- name: Test
63+
run: make test PYTEST_FLAGS="-n8"
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
COVERALLS_PARALLEL: true
67+
68+
coveralls-finished:
69+
needs: tests
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Finished
73+
uses: coverallsapp/github-action@v1.1.1
74+
with:
75+
github-token: ${{ secrets.GITHUB_TOKEN }}
76+
parallel-finished: true

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

Dockerfile

Lines changed: 89 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,92 @@
1-
FROM fedora:27
2-
ARG TASK_VERSION
1+
ARG ALPINE_VERSION=3.12
2+
ARG PYTHON_VERSION=3
3+
ARG TASK_VERSION=v2.5.1
4+
ARG VIM_VERSION=v8.2.0716
5+
ARG VIMWIKI_VERSION=master
6+
7+
8+
FROM python:${PYTHON_VERSION}-alpine${ALPINE_VERSION} AS build
39

4-
RUN dnf update -y
5-
RUN dnf install procps-ng psmisc which vim curl git gvim gcc gcc-c++ cmake make gnutls-devel libuuid-devel -y
6-
7-
# Setup language environment
8-
ENV LC_ALL en_US.UTF-8
9-
ENV LANG en_US.UTF-8
10-
ENV LANGUAGE en_US.UTF-8
11-
12-
# Setup taskwarrior
13-
RUN git clone --recursive https://github.com/GothenburgBitFactory/taskwarrior.git task
14-
WORKDIR task
15-
RUN echo ${TASK_VERSION}; git checkout ${TASK_VERSION}
16-
RUN git clean -dfx
17-
RUN git submodule init
18-
RUN git submodule update
19-
RUN cmake -DCMAKE_BUILD_TYPE=release .
20-
RUN make -j2
10+
11+
FROM build AS build-vim
12+
RUN apk add --no-cache \
13+
gcc \
14+
git \
15+
gtk+3.0-dev \
16+
libxt-dev \
17+
make \
18+
musl-dev \
19+
ncurses-dev
20+
ARG VIM_VERSION
21+
RUN git clone --depth 1 --recurse-submodules --shallow-submodules \
22+
--branch $VIM_VERSION https://github.com/vim/vim /usr/src/vim
23+
WORKDIR /usr/src/vim
24+
# "backport" https://github.com/vim/vim/commit/16d7eced1a08565a9837db8067c7b9db5ed68854
25+
RUN sed -i -e '/#\s*undef _POSIX_THREADS/d' src/if_python3.c
26+
RUN ./configure --prefix=/opt/vim --enable-pythoninterp --enable-python3interp --enable-gui=gtk3
27+
RUN make -j$(nproc)
28+
RUN make install
29+
30+
31+
FROM build AS build-taskwarrior
32+
RUN apk add --no-cache \
33+
cmake \
34+
g++ \
35+
gcc \
36+
git \
37+
make \
38+
util-linux-dev
39+
ARG TASK_VERSION
40+
RUN git clone --depth 1 --recurse-submodules --shallow-submodules \
41+
--branch $TASK_VERSION https://github.com/GothenburgBitFactory/taskwarrior /usr/src/taskwarrior
42+
WORKDIR /usr/src/taskwarrior
43+
RUN cmake -DCMAKE_INSTALL_PREFIX=/opt/taskwarrior -DCMAKE_BUILD_TYPE=release -DENABLE_SYNC=OFF .
44+
RUN make -j$(nproc)
2145
RUN make install
22-
RUN task --version
23-
24-
# Setup vimwiki
25-
RUN mkdir -p /root/.vim/bundle /root/.vim/autoload
26-
RUN curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
27-
RUN cd /root/.vim/bundle; git clone https://github.com/vimwiki/vimwiki.git
28-
RUN cd /root/.vim/bundle/vimwiki/; git checkout dev
29-
30-
# Setup taskwiki
31-
RUN pip3 install nose pytest coveralls coverage vimrunner
32-
ADD requirements.txt requirements.txt
33-
RUN pip3 install -r requirements.txt
34-
RUN mkdir /root/.vim/bundle/taskwiki
35-
WORKDIR /root/.vim/bundle/taskwiki
3646

37-
CMD ["sh", "-c", "python3 -m pytest -vv tests/"]
47+
48+
FROM build AS build-pip
49+
# coverage needs to build a C extensions, otherwise it's slow
50+
RUN apk add --no-cache \
51+
gcc \
52+
linux-headers \
53+
musl-dev
54+
RUN pip install --root=/opt/pip-root \
55+
coverage \
56+
coveralls \
57+
pytest \
58+
pytest-cov \
59+
pytest-xdist \
60+
https://github.com/liskin/vimrunner-python/archive/8c19ff88050c09236e7519425bfae33c687483df.zip
61+
COPY requirements.txt /tmp/taskwiki/requirements.txt
62+
RUN pip install --root=/opt/pip-root \
63+
-r /tmp/taskwiki/requirements.txt
64+
65+
66+
FROM build AS tests
67+
RUN apk add --no-cache \
68+
git \
69+
make \
70+
patchelf \
71+
tzdata \
72+
xvfb-run
73+
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
74+
75+
COPY --from=build-vim /opt/vim/ /opt/vim/
76+
COPY --from=build-taskwarrior /opt/taskwarrior/ /opt/taskwarrior/
77+
COPY --from=build-pip /opt/pip-root/ /
78+
79+
# install runtime deps of vim/taskwarrior
80+
RUN patchelf --print-needed /opt/*/bin/* \
81+
| grep -v '^libpython' \
82+
| sort -u \
83+
| sed -e 's/^/so:/' \
84+
| xargs -rt apk add --no-cache
85+
ENV PATH=/opt/vim/bin:/opt/taskwarrior/bin:$PATH
86+
RUN task --version && vim --version
87+
88+
ARG VIMWIKI_VERSION
89+
RUN git clone --depth 1 --recurse-submodules --shallow-submodules \
90+
--branch $VIMWIKI_VERSION https://github.com/vimwiki/vimwiki /root/.vim/bundle/vimwiki
91+
92+
WORKDIR /root/.vim/bundle/taskwiki

Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
export LC_ALL := en_US.UTF-8
2+
3+
PYTHON ?= python3
4+
15
test:
2-
mkdir -p /tmp/taskwiki-coverage
3-
docker-compose up --exit-code-from tests
6+
docker-compose run --rm tests make xvfb-cover-pytest
7+
8+
pytest:
9+
$(PYTHON) -m pytest -vv $(PYTEST_FLAGS) tests/
10+
11+
cover-pytest: PYTEST_FLAGS += --cov=taskwiki
12+
cover-pytest: pytest
13+
if [ "$$GITHUB_ACTIONS" ]; then coveralls || :; fi
14+
15+
xvfb-%:
16+
xvfb-run --server-args=-noreset $(MAKE) $*

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
_Proper project management in vim.
44
Standing on the shoulders of vimwiki and Taskwarrior_
55

6-
[![Travis build status](https://travis-ci.org/tbabej/taskwiki.svg?branch=master)](https://travis-ci.org/tbabej/taskwiki)
7-
[![Coverage Status](https://coveralls.io/repos/tbabej/taskwiki/badge.svg?branch=master)](https://coveralls.io/r/tbabej/taskwiki?branch=master)
6+
[![GitHub Actions build status](https://github.com/tools-life/taskwiki/workflows/tests/badge.svg?branch=master)](https://github.com/tools-life/taskwiki/actions)
7+
[![Coverage Status](https://coveralls.io/repos/tools-life/taskwiki/badge.svg?branch=master)](https://coveralls.io/r/tools-life/taskwiki?branch=master)
88
[![Code Health](https://landscape.io/github/tbabej/taskwiki/master/landscape.svg?style=flat)](https://landscape.io/github/tbabej/taskwiki/master)
99
[![Chat with developers](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tbabej/taskwiki)
1010

@@ -43,7 +43,7 @@ developed with Python2 compatibility in mind.
4343
Using pathogen (or similar vim plugin manager), the taskwiki install is
4444
as simple as:
4545

46-
git clone https://github.com/tbabej/taskwiki ~/.vim/bundle/taskwiki
46+
git clone https://github.com/tools-life/taskwiki ~/.vim/bundle/taskwiki
4747

4848
However, make sure your box satisfies the requirements stated above.
4949

@@ -265,7 +265,7 @@ Taskwarrior community. Come hang out at #taskwarrior on Freenode.
265265

266266
### Contributing
267267

268-
Code and issue tracker is hosted at: https://github.com/tbabej/taskwiki
268+
Code and issue tracker is hosted at: https://github.com/tools-life/taskwiki
269269

270270
Feel free to submit pull requests and/or file issues for bugs and suggestions.
271271

@@ -274,25 +274,32 @@ Feel free to submit pull requests and/or file issues for bugs and suggestions.
274274
Taskwiki comes with preconfigured docker-based test setup. To run the tests,
275275
simply issue:
276276

277+
PYTEST_FLAGS="-n8" make test
278+
279+
To run a single test and show vim errors:
280+
281+
PYTEST_FLAGS="-s -k TestChooseProject" make test
282+
283+
You may also build a docker image with different versions of some dependencies:
284+
277285
docker-compose build --build-arg TASK_VERSION=2.6.0 tests
278-
docker-compose up
279286

280287
To run the included tests directly you will require
281288

282289
* [test.py](http://pytest.org)
283290
* [gvim](http://vim.org)
284-
* [vimrunner-python](https://github.com/andri-ch/vimrunner-python) (with the included default_vimrc)
291+
* [vimrunner-python](https://github.com/liskin/vimrunner-python) (with the included default_vimrc)
285292

286293
Note also, that the tests depend on language specific messages. So you might
287294
need to install and enable either the `en_US` or `en_GB` locale. For example:
288295

289296
LANG=en_US python -m pytest
290297

291-
Finally you might want to have a look at [the travis configuration](.travis.yml)
298+
Finally you might want to have a look at [the CI configuration](.github/workflows/tests.yaml)
292299
and consider using a virtual machine or [Xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml).
293300

294301
#### Known issues
295302

296-
When `tzlocal` library can't detect your local timezone, it has to be set [explicitly](https://github.com/tbabej/taskwiki/issues/110) using the environment variable `TZ`. For example, before launching vim:
303+
When `tzlocal` library can't detect your local timezone, it has to be set [explicitly](https://github.com/tools-life/taskwiki/issues/110) using the environment variable `TZ`. For example, before launching vim:
297304

298305
export TZ="Europe/Prague"

after/syntax/vimwiki.vim

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ endif
66
" Detect if conceal feature is available
77
let s:conceal = exists("+conceallevel") ? ' conceal': ''
88

9-
syntax match TaskWikiTask /\s*\* \[.\]\s.*$/
9+
syntax match TaskWikiTask /\s*\* \[.\]\s.*$/ contains=@TaskWikiTaskContains
10+
syntax cluster TaskWikiTaskContains
1011
\ contains=VimwikiListTodo,
1112
\ VimwikiTag,
1213
\ VimwikiEmoticons,
@@ -39,12 +40,13 @@ endfor
3940

4041
" Define active and deleted task regions
4142
" Will be colored dynamically by Meta().source_tw_colors()
42-
syntax match TaskWikiTaskActive containedin=TaskWikiTask contained /\s*\*\s\[S\]\s[^#]*/
43-
syntax match TaskWikiTaskCompleted containedin=TaskWikiTask contained /\s*\*\s\[X\]\s[^#]*/
44-
syntax match TaskWikiTaskDeleted containedin=TaskWikiTask contained /\s*\*\s*\[D\]\s[^#]*/
45-
syntax match TaskWikiTaskRecurring containedin=TaskWikiTask contained /\s*\*\s\[R\]\s[^#]*/
46-
syntax match TaskWikiTaskWaiting containedin=TaskWikiTask contained /\s*\*\s\[W\]\s[^#]*/
47-
syntax match TaskWikiTaskPriority containedin=TaskWikiTask contained /\( !\| !!\| !!!\)\( \)\@=/
43+
syntax match TaskWikiTaskActive containedin=TaskWikiTask contained contains=@TaskWikiTaskContains /\s*\*\s\[S\]\s[^#]*/
44+
syntax match TaskWikiTaskCompleted containedin=TaskWikiTask contained contains=@TaskWikiTaskContains /\s*\*\s\[X\]\s[^#]*/
45+
syntax match TaskWikiTaskDeleted containedin=TaskWikiTask contained contains=@TaskWikiTaskContains /\s*\*\s*\[D\]\s[^#]*/
46+
syntax match TaskWikiTaskRecurring containedin=TaskWikiTask contained contains=@TaskWikiTaskContains /\s*\*\s\[R\]\s[^#]*/
47+
syntax match TaskWikiTaskWaiting containedin=TaskWikiTask contained contains=@TaskWikiTaskContains /\s*\*\s\[W\]\s[^#]*/
48+
syntax match TaskWikiTaskPriority contained /\( !\| !!\| !!!\)\( \)\@=/
49+
syntax cluster TaskWikiTaskContains add=TaskWikiTaskPriority
4850

4951
" Set concealed parts as really concealed in normal mode, and with cursor over
5052
" (unless disabled by user)
@@ -56,7 +58,7 @@ endif
5658
" Configure custom FoldText function
5759
" Altered version of the VimwikiFoldText
5860
setlocal foldmethod=syntax
59-
setlocal viewoptions=folds
61+
setlocal viewoptions-=options
6062

6163
function! TaskwikiFoldText()
6264
let line = getline(v:foldstart)

0 commit comments

Comments
 (0)