Repository: davidmascharka/detection-utils (language: python)

Issue:
Migrate away from Travis-CI



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
new file mode 100644
index 0000000..1473bf2
--- /dev/null
+++ b/.github/workflows/python-package.yml
@@ -0,0 +1,73 @@
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
+# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
+
+name: Python package
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+
+    strategy:
+      max-parallel: 3
+      matrix:
+        python-version: [3.7, 3.8]
+      fail-fast: false
+
+    steps:
+    - uses: actions/checkout@v1
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install tox tox-gh-actions
+    - name: Test with tox
+      run: tox -e py
+  
+  coverage: 
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ["3.7"]
+      fail-fast: false
+
+    steps:
+    - uses: actions/checkout@v1
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install tox
+    - name: Measure coverage
+      run: tox -e coverage
+
+  bandit:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: ["3.7"]
+      fail-fast: false
+
+    steps:
+    - uses: actions/checkout@v1
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        pip install tox
+    - name: Run bandit
+      run: tox -e bandit
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index f112d5d..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-dist: xenial
-sudo: false
-language: python
-install: pip install tox
-env:
-  - HYPOTHESIS_PROFILE=ci
-jobs:
-  include:
-    - python: 3.7
-      name: "Python 3.7"
-      dist: xenial
-      sudo: true
-      script: tox -e py37
-    - python: 3.8
-      name: "Coverage"
-      dist: xenial
-      sudo: true
-      script: tox -e coverage
-    - python: 3.8
-      name: "Bandit"
-      dist: xenial
-      sudo: true
-      script: tox -e bandit
-    - python: 3.8
-      name: "Python 3.8"
-      dist: xenial
-      sudo: true
-      script: tox -e py38
-branches:
-  only:
-  - master
diff --git a/setup.cfg b/setup.cfg
index 309922f..d8fb26f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -17,6 +17,12 @@ omit = src/detection_utils/_version.py
 [tox:tox]
 envlist = py37, py38, coverage, bandit
 
+[gh-actions]
+python =
+  3.7: py37
+  3.8: py38
+  3.9: py39
+
 [testenv]
 passenv = HYPOTHESIS_PROFILE TRAVIS TRAVIS_*
 extras = pytorch


Test patch:
diff --git a/tests/test_boxes.py b/tests/test_boxes.py
index 3710abd..73cc90e 100644
--- a/tests/test_boxes.py
+++ b/tests/test_boxes.py
@@ -26,7 +26,7 @@
 from numpy.testing import assert_allclose, assert_array_equal
 
 import hypothesis.strategies as st
-from hypothesis import given
+from hypothesis import given, settings
 import hypothesis.extra.numpy as hnp
 
 from detection_utils.boxes import (
@@ -103,6 +103,7 @@ def test_known_overlaps(self, predicted, truth, overlap):
         """ Ensures that correctness for hand-crafted overlapping boxes. """
         assert_allclose(actual=box_overlaps(predicted, truth), desired=overlap)
 
+    @settings(deadline=500)
     @given(
         boxes=hnp.arrays(dtype=float, shape=st.tuples(st.integers(0, 100), st.just(4))),
         truth=hnp.arrays(dtype=float, shape=st.tuples(st.integers(0, 100), st.just(4))),