Repository: alexmojaki/cheap_repr (language: python)

Issue:
added Github action
- some small changes to imports in `tests/test_cheap_repr.py` for compatibility with Python 3.9
- the action can be seen here https://github.com/spamegg1/cheap_repr/actions/runs/586654800


Discussion / hints:

Fix patch:
diff --git a/.gitignore b/.gitignore
index c361ce6..c7281d5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
 *.pyc
 build
 dist
+.coverage
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 3aa3ead..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-dist: xenial
-language: python
-
-python:
-  - 2.7
-  - 3.5
-  - 3.6
-  - 3.7
-  - 3.8
-  - pypy2.7-6.0
-  - pypy3.5
-
-env:
-  global:
-    - COVERALLS_PARALLEL=true
-
-install:
-  - pip install coveralls
-  - pip install .[tests]
-
-script:
-  - coverage run --source cheap_repr -m pytest
-  - coverage report -m
-
-after_success:
-  - coveralls
-
-notifications:
-  email: false
-  webhooks: https://coveralls.io/webhook


Test patch:
diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
new file mode 100644
index 0000000..ea546c1
--- /dev/null
+++ b/.github/workflows/pytest.yml
@@ -0,0 +1,32 @@
+name: Pytest and Coveralls
+on: [push, pull_request]
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 'pypy-2.7', 'pypy-3.6']
+    steps:
+    - uses: actions/checkout@v2
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v2
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: run tests
+      run: |
+        pip install coveralls .[tests]
+        coverage run --source cheap_repr -m pytest
+        coverage report -m
+    - name: Coveralls Python
+      uses: AndreMiras/coveralls-python-action@v20201129
+      with:
+        parallel: true
+        flag-name: test-${{ matrix.python-version }}
+  coveralls_finish:
+    needs: build
+    runs-on: ubuntu-latest
+    steps:
+      - name: Coveralls Finished
+        uses: AndreMiras/coveralls-python-action@v20201129
+        with:
+          parallel-finished: true
diff --git a/tests/test_cheap_repr.py b/tests/test_cheap_repr.py
index 555c452..97dec5d 100644
--- a/tests/test_cheap_repr.py
+++ b/tests/test_cheap_repr.py
@@ -2,7 +2,7 @@
 import re
 import unittest
 from array import array
-from collections import defaultdict, deque, Set
+from collections import defaultdict, deque
 from sys import version_info, version
 from unittest import skipIf
 
@@ -18,6 +18,12 @@
 except ImportError:
     from chainmap import ChainMap
 
+# Python 3.9 compatibility (importing Set from collections is deprecated)
+if version_info.major == 2:
+    from collections import Set
+else:
+    from collections.abc import Set
+
 from cheap_repr import basic_repr, register_repr, cheap_repr, PY2, PY3, ReprSuppressedWarning, find_repr_function, \
     raise_exceptions_from_default_repr, repr_registry