diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5d065a9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Configure Dependabot scanning. +version: 2 + +updates: + # Check for updates to GitHub Actions. + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 10 + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8333db7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,25 @@ +name: Python package + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox tox-gh + - name: Test with tox + run: tox -e ${{ matrix.python-version }} \ No newline at end of file diff --git a/HISTORY.md b/HISTORY.md index 57f52b4..6f2d121 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -47,7 +47,7 @@ ## v5.0.0 - 10 Apr, 2018 -* Drop offical support for Python 2.6 +* Drop official support for Python 2.6 * Add a client-side timeout setting to `CreateSend` * No breaking changes for Python2.7 or Python3.x diff --git a/README.md b/README.md index ace850e..c35b9aa 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ def test_add_with_custom_fields(self): self.subscriber.stub_request("subscribers/%s.json" % self.list_id, "add_subscriber.json") custom_fields = [ { "Key": 'website', "Value": 'http://example.com/' } ] email_address = self.subscriber.add(self.list_id, "subscriber@example.com", "Subscriber", custom_fields, True) - self.assertEquals(email_address, "subscriber@example.com") + self.assertEqual(email_address, "subscriber@example.com") ``` ## Contributing diff --git a/nosetests.py b/nosetests.py deleted file mode 100644 index c5abf62..0000000 --- a/nosetests.py +++ /dev/null @@ -1,3 +0,0 @@ -import nose - -nose.run() diff --git a/setup.py b/setup.py index f1b2351..ca23681 100644 --- a/setup.py +++ b/setup.py @@ -34,8 +34,6 @@ "Programming Language :: Python :: 3", # Specifically, we support the following releases. - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", diff --git a/test/test_administrator.py b/test/test_administrator.py index a6dfb78..fa4d4d1 100644 --- a/test/test_administrator.py +++ b/test/test_administrator.py @@ -42,7 +42,7 @@ def test_delete(self): email_address = self.administrator.delete() -class OAuthAdministatorTestCase(unittest.TestCase, AdministratorTestCase): +class OAuthAdministratorTestCase(unittest.TestCase, AdministratorTestCase): """Test when using OAuth to authenticate""" def setUp(self): @@ -50,7 +50,7 @@ def setUp(self): {"access_token": "ASP95S4aR+9KsgfHB0dapTYxNA==", "refresh_token": "5S4aASP9R+9KsgfHB0dapTYxNA=="}, "admin@example.com") -class ApiKeyAdministatorTestCase(unittest.TestCase, AdministratorTestCase): +class ApiKeyAdministratorTestCase(unittest.TestCase, AdministratorTestCase): """Test when using an API key to authenticate""" def setUp(self): diff --git a/tox.ini b/tox.ini index 0d0c5c5..4f04754 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,25 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests +# Tox (https://tox.wiki/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" # and then run "tox" from this directory. [tox] -envlist = py36, py37, py38, py39, py310, py311, py312, py313 +env_list = py38, py39, py310, py311, py312, py313 [testenv] -install_command=pip install {packages} commands = - coverage run --source=lib setup.py test - coverage report + pytest --cov=lib deps = - coverage - -e. + pytest-cov +# This needs to be set to include the test fixtures +use_develop = true + +[gh] +# Maps python versions for GitHub workflow +python = + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 + 3.13: py313 \ No newline at end of file