diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index 36208a1..a186169 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -6,9 +6,11 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + - uses: psf/black@stable + with: + version: "~= 23.0" - run: pip install bandit black codespell flake8 isort mypy pyupgrade safety - run: bandit --recursive --skip B101,B106 . - - run: black --check . - run: codespell # --ignore-words-list="" --skip="" - run: flake8 . --count --max-complexity=11 --max-line-length=113 --show-source --statistics - run: isort --check-only --profile black . diff --git a/farmOS/client_2.py b/farmOS/client_2.py index 8ad0021..2ccde6e 100644 --- a/farmOS/client_2.py +++ b/farmOS/client_2.py @@ -53,7 +53,6 @@ def iterate(self, entity_type, bundle=None, params=None): more = False def send(self, entity_type, bundle=None, payload=None): - # Default to empty payload dict. if payload is None: payload = {} diff --git a/farmOS/session.py b/farmOS/session.py index 4835439..1f3f2d8 100644 --- a/farmOS/session.py +++ b/farmOS/session.py @@ -24,7 +24,6 @@ def __init__( *args, **kwargs, ): - # Default to the "farm_manager" scope. if scope is None: scope = "farm_manager" @@ -113,7 +112,6 @@ def http_request(self, path, method="GET", options=None, params=None, headers=No ) def _http_request(self, url, method="GET", options=None, params=None, headers=None): - # Automatically follow redirects, unless this is a POST request. # The Python requests library converts POST to GET during a redirect. # Allow this to be overridden in options. diff --git a/farmOS/subrequests.py b/farmOS/subrequests.py index 69d790d..60f2073 100644 --- a/farmOS/subrequests.py +++ b/farmOS/subrequests.py @@ -94,7 +94,6 @@ def send( blueprint: Union[SubrequestsBlueprint, List], format: Optional[Union[Format, str]] = Format.json, ): - if isinstance(blueprint, List): blueprint = SubrequestsBlueprint.parse_obj(blueprint) diff --git a/setup.py b/setup.py index 72976db..56454bf 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ install_requires = ["requests-oauthlib~=1.3.1", "pydantic~=1.7.3"] -tests_require = ["pytest", "black>=20"] +tests_require = ["pytest", "black~=23.0"] with open("README.md") as fh: readme = fh.read() diff --git a/tests/functional/test_subrequests.py b/tests/functional/test_subrequests.py index ae4b3af..d423e07 100644 --- a/tests/functional/test_subrequests.py +++ b/tests/functional/test_subrequests.py @@ -10,7 +10,6 @@ @farmOS_testing_server def test_subrequests(test_farm): - plant_type = { "data": { "type": "taxonomy_term--plant_type", @@ -114,7 +113,6 @@ def test_subrequests(test_farm): }, } for response_key, expected_data in response_keys.items(): - # Test that each response succeeded. assert response_key in post_response assert "headers" in post_response[response_key]