From 9e71eab50b5be66885faff3c4c724c0b476cba96 Mon Sep 17 00:00:00 2001 From: Laurence Billingham Date: Thu, 24 Jul 2025 18:50:03 +0100 Subject: [PATCH 1/4] fix: :bug: invalid syntax in 1 of the 2 replace_team_push_restrictionses --- github/Branch.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/github/Branch.py b/github/Branch.py index aa94460386..c4a2306d5e 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -473,6 +473,8 @@ def replace_team_push_restrictions(self, *teams): """ :calls: `PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams `_ :teams: list of strings (team slugs) + + we want this version """ assert all(isinstance(element, str) for element in teams), teams @@ -491,19 +493,6 @@ def remove_team_push_restrictions(self, *teams): "DELETE", f"{self.protection_url}/restrictions/teams", input=teams ) - def replace_team_push_restrictions(self, *teams): - """ - :calls: `PUT /repos/:owner/:repo/branches/:branch/protection/restrictions/teams `_ - :teams: list of strings (team slugs) - """ - assert all(isinstance(element, (str, unicode)) or isinstance(element, (str, unicode)) for element in teams), teams - - headers, data = self._requester.requestJsonAndCheck( - "PUT", - self.protection_url + "/restrictions/teams", - input=teams - ) - def remove_team_push_restrictions(self, *teams): """ :calls: `DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/teams `_ From d3e64603ef9cbfe47c457a0048c6d7e037f618e8 Mon Sep 17 00:00:00 2001 From: Laurence Billingham Date: Thu, 24 Jul 2025 18:50:32 +0100 Subject: [PATCH 2/4] fix: :bug: invalid syntax in 1 of the 2 remove_team_push_restrictionses --- github/Branch.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/github/Branch.py b/github/Branch.py index c4a2306d5e..f97ce1ea1f 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -486,6 +486,7 @@ def remove_team_push_restrictions(self, *teams): """ :calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams `_ :teams: list of strings (team slugs) + we want this one :lolsob: """ assert all(isinstance(element, str) for element in teams), teams @@ -493,19 +494,6 @@ def remove_team_push_restrictions(self, *teams): "DELETE", f"{self.protection_url}/restrictions/teams", input=teams ) - def remove_team_push_restrictions(self, *teams): - """ - :calls: `DELETE /repos/:owner/:repo/branches/:branch/protection/restrictions/teams `_ - :teams: list of strings (team slugs) - """ - assert all(isinstance(element, (str, unicode)) or isinstance(element, (str, unicode)) for element in teams), teams - - headers, data = self._requester.requestJsonAndCheck( - "DELETE", - self.protection_url + "/restrictions/teams", - input=teams - ) - def remove_push_restrictions(self): """ :calls: `DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions `_ From b63d9a626b27061ed5d114306a28904caf511b08 Mon Sep 17 00:00:00 2001 From: Laurence Billingham Date: Fri, 25 Jul 2025 14:44:53 +0100 Subject: [PATCH 3/4] chore: :arrow_up: stop testing on EoL python --- .github/workflows/ci.yml | 2 +- tox.ini | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f71b698f1..68484f8ae4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: name: test (Python ${{ matrix.python-version }}) strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - name: Set up Python diff --git a/tox.ini b/tox.ini index ab2c294832..b661d28e04 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,13 @@ [tox] envlist = lint, - py{36,37,38,39,310}, + py{38,39,310}, docs [gh-actions] python = - 3.6: py36 - 3.7: py37 - 3.8: py38, docs, lint - 3.9: py39 + 3.8: py38 + 3.9: py39, docs, lint 3.10: py310 [testenv] @@ -17,7 +15,7 @@ deps = -rtest-requirements.txt commands = pytest --cov=github --cov-report=xml {posargs} [testenv:lint] -basepython = python3.8 +basepython = python3.9 skip_install = true deps = types-jwt @@ -31,7 +29,7 @@ commands = mypy github tests [testenv:docs] -basepython = python3.8 +basepython = python3.9 skip_install = true deps = -rrequirements.txt commands = sphinx-build doc build @@ -42,6 +40,6 @@ select = C,E,F,W ignore = E266, E501, W503 [mypy] -python_version = 3.8 +python_version = 3.9 ignore_missing_imports = True namespace_packages = True From ac9b96e018efb0be6c5353f374f8ff44d544c01f Mon Sep 17 00:00:00 2001 From: Laurence Billingham Date: Fri, 25 Jul 2025 14:50:31 +0100 Subject: [PATCH 4/4] chore(deps): :arrow_up: upversion checkout and setup-python GH actions --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68484f8ae4..a3ab120c82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,9 @@ jobs: matrix: python-version: ["3.8", "3.9", "3.10"] 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 tox