Skip to content

Commit 7dcaa3b

Browse files
Initial circleCI config.
1 parent 58ace5f commit 7dcaa3b

File tree

3 files changed

+148
-0
lines changed

3 files changed

+148
-0
lines changed

.circleci/config.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: circleci/python:3.6-stretch
6+
working_directory: /home/circleci/tskit
7+
steps:
8+
- checkout
9+
- run: sudo chown -R circleci:circleci *
10+
# - restore_cache:
11+
# key: tskit-{{ .Branch }}
12+
- run:
13+
name: Checkout submodules
14+
command: |
15+
git submodule update --init --recursive --remote
16+
- run:
17+
name: Install dependencies and set path
18+
command: |
19+
sudo apt-get install ninja-build libcunit1-dev valgrind clang doxygen libgsl-dev
20+
pip install --user -r python/requirements/development.txt
21+
pip install meson --user
22+
# tmp; until we have an msprime package install from here.
23+
pip install --user --pre --upgrade tskit
24+
pip install --user git+https://github.com/tskit-dev/msprime
25+
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
26+
# - save_cache:
27+
# key: tskit-{{ .Branch }}
28+
# paths:
29+
# - "/home/circleci/.local"
30+
- run:
31+
name: Compile Python
32+
command: |
33+
cd python
34+
# CFLAGS="--coverage -Wall -Wextra -Werror -Wno-unused-parameter" \
35+
# python setup.py build_ext --inplace
36+
# TODO enable these flags later.
37+
CFLAGS="--coverage" python setup.py build_ext --inplace
38+
- run:
39+
name: Lint Python
40+
command: |
41+
cd python
42+
flake8 --max-line-length 89 tskit setup.py tests
43+
- run:
44+
name: Run Python tests
45+
command: |
46+
PYTHONPATH=python nosetests -v --with-coverage --cover-package tskit \
47+
--cover-branches --cover-erase --cover-xml \
48+
--cover-inclusive python/tests
49+
python3 -m codecov -F python
50+
- run:
51+
name: Build Python package
52+
command: |
53+
cd python
54+
rm -fR build
55+
python setup.py sdist
56+
python setup.py check
57+
python -m venv venv
58+
source venv/bin/activate
59+
pip install --upgrade setuptools pip wheel
60+
python setup.py build_ext
61+
python setup.py egg_info
62+
python setup.py bdist_wheel
63+
pip install dist/*.tar.gz
64+
# - run:
65+
# name: Compile C
66+
# command: |
67+
# CFLAGS=--coverage meson c/ build-gcc && cd build-gcc && ninja
68+
# - run:
69+
# name: Run C tests
70+
# command: |
71+
# export KASTORE_SOPATH=./build-gcc/libtskit.so
72+
# ./build-gcc/tests
73+
# ./build-gcc/dynamic_api_tests
74+
# ./build-gcc/malloc_tests
75+
# ./build-gcc/io_tests
76+
# - run:
77+
# name: Valgrind for C tests.
78+
# command: |
79+
# export KASTORE_SOPATH=./build-gcc/libtskit.so
80+
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/tests
81+
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/dynamic_api_tests
82+
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/malloc_tests
83+
# valgrind --leak-check=full --error-exitcode=1 ./build-gcc/io_tests
84+
# - run:
85+
# name: Run gcov & upload coverage.
86+
# command: |
87+
# gcov -pb -o ./python/build/temp.linux*/ python/_tskitmodule.c
88+
# gcov -pb ./build-gcc/tests@exe/tskit.c.gcno \
89+
# ./build-gcc/malloc_tests@exe/tskit.c.gcno \
90+
# ./build-gcc/io_tests@exe/tskit.c.gcno \
91+
# ./build-gcc/dynamic_api_tests@exe/tskit.c.gcno \
92+
# ./build-gcc/tskit@sha/tskit.c.gcno
93+
# codecov -X gcov -F C
94+
# - run:
95+
# name: Compile C tests under clang
96+
# command: |
97+
# CC=clang meson c/ build-clang && cd build-clang && ninja
98+
# - run:
99+
# name: Run clang C tests
100+
# command: |
101+
# export KASTORE_SOPATH=./build-clang/libtskit.so
102+
# ./build-clang/tests
103+
# ./build-clang/dynamic_api_tests
104+
# ./build-clang/malloc_tests
105+
# ./build-clang/io_tests
106+
107+
# - run:
108+
# name: Build docs
109+
# command: |
110+
# cd docs && make

.codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
status:
3+
project:
4+
python:
5+
target: 95%
6+
flags: python
7+
8+
patch:
9+
python:
10+
target: 90%
11+
flags: python
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
codecov
2+
coverage
3+
flake8
4+
h5py
5+
mock
6+
newick
7+
nose
8+
numpy
9+
six
10+
kastore>=0.2.2
11+
jsonschema
12+
sphinx
13+
sphinx-argparse
14+
sphinx_rtd_theme
15+
svgwrite
16+
# Seems to be a problem with Python 3. svgwrite imports
17+
# pyparsing.
18+
pyparsing < 2.1
19+
20+
# We need pysam and PyVCF for testing VCF output.
21+
# Pin pysam at 0.9 version as there are problems with building py33 version
22+
# on travis.
23+
pysam==0.9.1.4
24+
PyVCF
25+
26+
# We use JSON-schema to test out metadata handling.
27+
python_jsonschema_objects

0 commit comments

Comments
 (0)