From 6db6a0139dc4e4cfaf485a17e413282955f83458 Mon Sep 17 00:00:00 2001 From: Gene Wood Date: Mon, 24 Jun 2024 11:26:43 -0700 Subject: [PATCH] Update GitHub actions Tox tests Update to modern Python versions and GitHub actions Fix a couple Flake8 findings --- .github/workflows/test.yml | 6 +++--- agithub/GitHub.py | 4 ++-- tox.ini | 9 ++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cc94823..fd19ac9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '2.7', '3.7' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/agithub/GitHub.py b/agithub/GitHub.py index 485ab9b..67c74e9 100644 --- a/agithub/GitHub.py +++ b/agithub/GitHub.py @@ -114,7 +114,7 @@ def request(self, method, url, bodyData, headers): self.sleep_until_more_ratelimit() else: data = content.processBody() - if self.paginate and type(data) == list: + if self.paginate and type(data) is list: data.extend( self.get_additional_pages(method, bodyData, headers)) return status, data @@ -129,7 +129,7 @@ def get_additional_pages(self, method, bodyData, headers): '{}'.format(url)) status, data = self.request(method, url, bodyData, headers) - if type(data) == list: + if type(data) is list: data.extend(self.get_additional_pages(method, bodyData, headers)) return data elif (status == 403 and self.no_ratelimit_remaining() diff --git a/tox.ini b/tox.ini index 22bb82a..5b403c5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,13 @@ [tox] -envlist = py27, py37, flake8 +envlist = py38, py39, py310, py311, py312, flake8 [gh-actions] python = - 2.7: py27 - 3.7: py37, flake8 + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312, flake8 [testenv:flake8] basepython = python