Repository: pogzyb/asyncwhois (language: python)

Issue:
Add tox + codecov workflow
Implement Github actions to run tox on PR's and merge to main. Remove current reference to travis-ci


Discussion / hints:

Fix patch:
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index e24035d..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-language: python
-
-python:
-  - "3.6"
-  - "3.7"
-  - "3.8"
-  - "3.9"
-
-install: pip install tox-travis codecov
-
-script: tox
-
-notifications:
-  email: false
-
-after_success: codecov
\ No newline at end of file
diff --git a/README.md b/README.md
index 05642bb..2195952 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 ### asyncwhois
 
 [![PyPI version](https://badge.fury.io/py/asyncwhois.svg)](https://badge.fury.io/py/asyncwhois)
-[![Build Status](https://app.travis-ci.com/pogzyb/asyncwhois.svg?branch=master)](https://app.travis-ci.com/pogzyb/asyncwhois)
+![build-workflow](https://github.com/pogzyb/asyncwhois/actions/workflows/build-and-test.yml/badge.svg)
 [![codecov](https://codecov.io/gh/pogzyb/asyncwhois/branch/master/graph/badge.svg?token=Q4xtgezXGX)](https://codecov.io/gh/pogzyb/asyncwhois)
 
 `asyncwhois` | Async-friendly Python library for WHOIS and RDAP queries.
diff --git a/setup.py b/setup.py
index c24775b..64597cb 100644
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,7 @@ def get_version(location: str) -> str:
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
         "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: 3 :: Only",
         "Topic :: Internet :: WWW/HTTP",
         "Topic :: Software Development",
@@ -50,5 +51,4 @@ def get_version(location: str) -> str:
     packages=["asyncwhois"],
     package_dir={"asyncwhois": "asyncwhois"},
     python_requires=">=3.6",
-    include_package_data=True
 )
diff --git a/tox.ini b/tox.ini
index 4bc9001..70b81bf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,12 +1,20 @@
 [tox]
-envlist = py36,py37,py38,py39
+envlist = py36, py37, py38, py39, py310
 minversion = 3.3.0
 isolated_build = true
 
+[gh-actions]
+python =
+    3.6: py36
+    3.7: py37
+    3.8: py38
+    3.9: py39
+    3.10: py310
+
 [testenv]
 deps =
     asynctest >= 0.13.0
-    pytest >= 6.2.3
-    pytest-cov >= 2.11.1
+    pytest >= 6.2.5
+    pytest-cov >= 3.0.0
 commands =
-    pytest --cov=asyncwhois
\ No newline at end of file
+    pytest --cov-report xml --cov=asyncwhois
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 0000000..99c2201
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,39 @@
+name: Build
+
+on:
+  - push
+  - pull_request
+
+jobs:
+  build:
+    runs-on: ${{ matrix.platform }}
+    strategy:
+      matrix:
+        platform:
+          - ubuntu-latest  # ubuntu-20.04
+          - macos-latest  # macOS-11
+          - windows-latest  # windows-2022
+        python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
+
+    steps:
+    - uses: actions/checkout@v3
+    - name: Set up Python ${{ matrix.python-version }}
+      uses: actions/setup-python@v4
+      with:
+        python-version: ${{ matrix.python-version }}
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        python -m pip install tox tox-gh-actions
+    - name: Test with tox
+      run: tox -vv
+    - name: Upload coverage.xml
+      if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.10' }}
+      uses: actions/upload-artifact@v3
+      with:
+        name: tox-gh-actions-coverage
+        path: coverage.xml
+        if-no-files-found: error
+    - name: Upload coverage.xml to codecov
+      if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.10' }}
+      uses: codecov/codecov-action@v2
\ No newline at end of file
diff --git a/tests/test_parser_output.py b/tests/test_parser_output.py
index ae583bc..980b540 100644
--- a/tests/test_parser_output.py
+++ b/tests/test_parser_output.py
@@ -8,7 +8,7 @@ class TestTLDParsers(unittest.TestCase):
 
     @staticmethod
     def get_txt(tld: str):
-        with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), f"samples/tld_{tld}.txt")) as txt_input:
+        with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), f"samples/tld_{tld}.txt"), encoding='utf-8') as txt_input:
             query_output = txt_input.read()
         return query_output