Skip to content

Commit 2df1b80

Browse files
committed
CI template
1 parent 4ce81c5 commit 2df1b80

File tree

5 files changed

+39
-55
lines changed

5 files changed

+39
-55
lines changed

.appveyor.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
image:
22
- Visual Studio 2017
3-
# - Ubuntu too old CMake 3.5
4-
5-
build: off
3+
- Ubuntu
64

75
stack: python 3
86

@@ -12,11 +10,11 @@ environment:
1210

1311
clone_depth: 3
1412

15-
init:
16-
- cmd: set PATH=%MINGW_DIR%;%PY_DIR%;%PY_DIR%\Scripts;%PATH%
13+
build: off
1714

18-
- sh: sudo apt-get -yq update > /dev/null
19-
- sh: sudo apt-get install -yq --no-install-suggests --no-install-recommends gfortran cmake make > /dev/null
15+
init:
16+
- cmd: set PATH=%MINGW_DIR%;%PATH%
17+
- cmd: set PATH=%PY_DIR%;%PY_DIR%\Scripts;%PATH%
2018

2119
install:
2220
- pip install -e .[tests]
@@ -25,9 +23,9 @@ install:
2523
- cmd: cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" ..
2624
- sh: cmake ..
2725
- cmake --build .
28-
26+
2927
test_script:
3028
- ctest -V
3129
- cd ..
32-
- pytest -xsv
30+
- pytest -rsv
3331

.coveragerc

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

.travis.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ git:
88
quiet: true
99

1010
python:
11-
- 3.5
12-
- 3.6
13-
- 3.7
11+
- 3.6
12+
- 3.7
1413

1514
os:
16-
- linux
15+
- linux
1716

1817
env: FC=gfortran-6
1918

@@ -37,23 +36,23 @@ before_install:
3736
fi
3837

3938
install:
40-
- pip install -e .[tests]
39+
- pip install -e .[tests]
4140

42-
- cd bin
43-
- cmake ..
44-
- cmake --build .
41+
- cd bin
42+
- cmake ..
43+
- cmake --build .
4544

4645
script:
47-
- ctest -V
48-
- cd ..
49-
50-
- pytest -sv
51-
- flake8
52-
- mypy . --ignore-missing-imports
46+
- ctest -V
47+
- cd ..
48+
49+
- pytest -rsv
50+
- flake8
51+
- mypy . --ignore-missing-imports
5352

5453
after_success:
55-
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then
56-
pytest --cov;
57-
coveralls;
58-
fi
54+
- if [[ $TRAVIS_PYTHON_VERSION == 3.6* ]]; then
55+
pytest --cov --cov-config=setup.cfg;
56+
coveralls;
57+
fi
5958

setup.cfg

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ long_description_content_type = text/markdown
2424

2525
[options]
2626
python_requires = >= 3.5
27-
setup_requires =
27+
setup_requires =
2828
setuptools >= 38.6
2929
pip >= 10
3030
twine >= 1.11
@@ -34,15 +34,15 @@ install_requires =
3434
numpy
3535

3636
[options.extras_require]
37-
tests =
37+
tests =
3838
pytest
3939
pytest-cov
4040
coveralls
4141
flake8
4242
mypy
4343

4444
[options.entry_points]
45-
console_scripts =
45+
console_scripts =
4646
DemoLineclip = DemoLineclip:main
4747

4848
[flake8]
@@ -55,18 +55,17 @@ omit =
5555
/home/travis/virtualenv/*
5656
*/site-packages/*
5757
*/bin/*
58-
*/sciencedates/*
5958

6059
[coverage:report]
6160
exclude_lines =
6261
pragma: no cover
6362
def __repr__
64-
RuntimeError
65-
NotImplementedError
66-
ImportError
67-
KeyError
68-
FileNotFoundError
69-
CalledProcessError
63+
except RuntimeError
64+
except NotImplementedError
65+
except ImportError
66+
except FileNotFoundError
67+
except CalledProcessError
7068
logging.warning
71-
ValueError
72-
TypeError
69+
logging.error
70+
logging.critical
71+
if __name__ == .__main__.:

tests/test_all.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
22
import pytest
3-
from numpy.testing import assert_allclose
4-
#
3+
from pytest import approx
54
import pylineclip as plc
65

76

@@ -14,7 +13,7 @@ def test_lineclip():
1413
x1, y1, x2, y2 = plc.cohensutherland(1, 5, 4, 3,
1514
0, 0, 4, 6)
1615

17-
assert_allclose([x1, y1, x2, y2], [2, 3, 3.3333333333333, 5])
16+
assert [x1, y1, x2, y2] == approx([2, 3, 3.3333333333333, 5])
1817
# %% no intersection test
1918
x1, y1, x2, y2 = plc.cohensutherland(1, 5, 4, 3,
2019
0, 0.1, 0, 0.1)
@@ -23,7 +22,8 @@ def test_lineclip():
2322
# %% left to right test
2423
x1, y1, x2, y2 = plc.cohensutherland(1, 5, 4, 3,
2524
0, 4, 5, 4)
26-
assert_allclose([x1, y1, x2, y2], [1, 4, 4, 4])
25+
26+
assert [x1, y1, x2, y2] == [1, 4, 4, 4]
2727

2828

2929
if __name__ == '__main__':

0 commit comments

Comments
 (0)