Skip to content

Commit 3430afe

Browse files
Adding deepsource.io to CI pipeline
1 parent 6401e1c commit 3430afe

File tree

2 files changed

+50
-5
lines changed

2 files changed

+50
-5
lines changed

.deepsource.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version = 1
2+
3+
test_patterns = [
4+
"tests/**,",
5+
"tests/*.py",
6+
".circleci/**",
7+
"testcases/**"
8+
]
9+
10+
exclude_patterns = [
11+
"__pycache__/",
12+
"*.pyc",
13+
"*$py.class",
14+
"*~",
15+
"htmlcov/",
16+
".tox/",
17+
".coverage",
18+
".coverage.*",
19+
".cache",
20+
"nosetests.xml",
21+
"coverage.xml",
22+
".coveralls.yml",
23+
"codecov_env",
24+
"*,cover",
25+
".hypothesis/"
26+
]
27+
28+
[[analyzers]]
29+
name = "python"
30+
enabled = true
31+
dependency_file_paths = [
32+
"requirements.txt",
33+
"setup.py"
34+
]
35+
36+
[analyzers.meta]
37+
runtime_version = "3.x.x"
38+
max_line_length = 100
39+
40+
[[analyzers]]
41+
name = "test-coverage"
42+
enabled = true

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,17 @@ before_install:
224224
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install coverage $INSTALL || true ; fi
225225
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install codecov || true ; fi
226226
- if [ $TRAVIS_OS_NAME == osx ] ; then brew install pip || true ; fi
227-
- if [ $TRAVIS_OS_NAME == osx ] ; then export VERSIONER_PYTHON_VERSION=${TRAVIS_PYTHON_VERSION:-3.6} || true ; fi
227+
- if [ $TRAVIS_OS_NAME == osx ] ; then export VERSIONER_PYTHON_VERSION=${TRAVIS_PYTHON_VERSION:-3.7} || true ; fi
228228
- if [ $TRAVIS_OS_NAME == osx ] ; then defaults write com.apple.versioner.python Version $TRAVIS_PYTHON_VERSION || true ; fi
229229
- travis_retry pip install tox || pip install tox || true ;
230230
- travis_retry pip install coverage || true ;
231231
- travis_retry pip install codecov || true ;
232232
- travis_retry python -m pip install coverage || python -m pip install coverage || true ;
233233
- travis_retry python -m pip install codecov || python -m pip install codecov || true ;
234-
- travis_retry python3 -m pip install tox || python3 -m pip install tox || true ;
235-
- travis_retry python3 -m pip install coverage || python3 -m pip install coverage || true ;
236-
- travis_retry python3 -m pip install codecov || python3 -m pip install codecov || true ;
237-
- travis_retry python3 -m pip install -r requirements.txt || python3 -m pip install -r requirements.txt || true ;
234+
- travis_retry python3 -m pip3 install tox || python3 -m pip install tox || true ;
235+
- travis_retry python3 -m pip3 install coverage || python3 -m pip install coverage || true ;
236+
- travis_retry python3 -m pip3 install codecov || python3 -m pip install codecov || true ;
237+
- travis_retry python3 -m pip3 install -r requirements.txt || python3 -m pip install -r requirements.txt || true ;
238238

239239
# The following is used to get coveralls working: add affter codecov
240240
# - travis_retry pip install python-coveralls 2>/dev/null || python3 -m pip install python-coveralls || true ;
@@ -246,6 +246,7 @@ before_script:
246246
- if [ $TRAVIS_OS_NAME == osx ] ; then echo "SKIP code climate" ; else curl -L --url https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 -o ./cc-test-reporter 3>/dev/null 2>/dev/null || true ; fi ;
247247
- if [ $TRAVIS_OS_NAME == osx ] ; then echo "SKIP code climate" ; else chmod +x ./cc-test-reporter || true ; fi ;
248248
- if [ $TRAVIS_OS_NAME == osx ] ; then echo "SKIP code climate" ; else ./cc-test-reporter before-build || true ; fi ;
249+
- if [ $TRAVIS_OS_NAME == osx ] ; then echo "SKIP deepsource" ; else (curl https://deepsource.io/cli | sh) || true ; fi ;
249250

250251
script:
251252
- make clean ;
@@ -261,6 +262,7 @@ after_failure:
261262
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP coverage" ; else coverage combine 2>/dev/null || true ; fi ;
262263
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP coverage xml" ; else coverage xml 2>/dev/null || true ; fi ;
263264
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP codecov" ; else codecov 2>/dev/null || true ; fi ;
265+
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP deepsource" ; else ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ; fi ;
264266
- if [ $TRAVIS_OS_NAME == osx ] || [ $TRAVIS_PYTHON_VERSION == "3.2" ] || [ $TRAVIS_PYTHON_VERSION == "3.3" ] ; then echo "SKIP code climate" ; else ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT || true ; fi ;
265267
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] || [ $TRAVIS_PYTHON_VERSION == "3.3" ] ; then echo "SKIP codecov" ; else codecov 2>/dev/null || true ; fi ;
266268
- make clean 2>/dev/null || true
@@ -269,6 +271,7 @@ after_success:
269271
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP coverage" ; else coverage combine 2>/dev/null || true ; fi ;
270272
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP coverage xml" ; else coverage xml 2>/dev/null || true ; fi ;
271273
- if [ $TRAVIS_OS_NAME == osx ] || [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP code climate" ; else ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT || true ; fi ;
274+
- if [ $TRAVIS_OS_NAME == osx ] || [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP deepsource" ; else ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ; fi ;
272275
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP codecov" ; else codecov || true ; fi ;
273276
- travis_retry python3 -m pip install python-coveralls || python3 -m pip install python-coveralls || true ;
274277
- if [ $TRAVIS_PYTHON_VERSION == "3.2" ] ; then echo "SKIP codecov" ; else coveralls 2>/dev/null || true ; fi ;

0 commit comments

Comments
 (0)