Skip to content

Commit

Permalink
Support Python 3.12 and drop support for EOL Python 3.7 (#49)
Browse files Browse the repository at this point in the history
* Support Python 3.12 and drop support for EOL Python 3.7

* Format code

* Bump dev dependencies
  • Loading branch information
edgarrmondragon authored Jun 20, 2024
1 parent 6425b4f commit f4eeb54
Show file tree
Hide file tree
Showing 7 changed files with 869 additions and 740 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_PROD }}
password: ${{ secrets.PYPI_API_TOKEN_PROD }}
1,572 changes: 853 additions & 719 deletions poetry.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ repository = "https://github.com/Widen/tap-rest-api-msdk"
readme = "README.md"

[tool.poetry.dependencies]
python = "<3.12,>=3.7.1"
python = ">=3.8"
requests = "^2.25.1"
singer-sdk = "^0.33.0"
singer-sdk = { version = "^0.33.0", python = "<4" }
genson = "^1.2.2"
atomicwrites = "^1.4.0"
requests-aws4auth = "^1.2.3"
boto3 = "^1.26.156"

[tool.poetry.dev-dependencies]
pytest = "^7.2.0"
tox = "^3.24.4"
flake8 = "^3.9.2"
black = "^23.3.0"
pydocstyle = "^6.1.1"
mypy = "^1.3.0"
pytest = "^8.2.2"
tox = "^4.15.1"
flake8 = { version = "^7.1.0", python = ">=3.8.1" }
black = "^24.4.2"
pydocstyle = "^6.3.0"
mypy = "^1.10.0"
types-requests = "^2.25.8"
requests-mock = "^1.9.3"
isort = "^5.11.5"
isort = "^5.13.2"
types-python-dateutil = "^2.8.19.14"

[tool.black]
Expand Down
8 changes: 1 addition & 7 deletions tap_rest_api_msdk/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,7 @@ def has_more(self, response: requests.Response):
class SimpleOffsetPaginator(BaseOffsetPaginator):
"""Simple Offset Paginator."""

def __init__(
self,
*args,
pagination_page_size: int = 25,
**kwargs
):
def __init__(self, *args, pagination_page_size: int = 25, **kwargs):
super().__init__(*args, **kwargs)
self._pagination_page_size = pagination_page_size

Expand All @@ -102,7 +97,6 @@ def has_more(self, response: requests.Response):
return len(response.json()) == self._pagination_page_size



class RestAPIHeaderLinkPaginator(HeaderLinkPaginator):
"""REST API Header Link Paginator."""

Expand Down
4 changes: 2 additions & 2 deletions tap_rest_api_msdk/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
RestAPIBasePageNumberPaginator,
RestAPIHeaderLinkPaginator,
RestAPIOffsetPaginator,
SimpleOffsetPaginator
SimpleOffsetPaginator,
)
from tap_rest_api_msdk.utils import flatten_json, get_start_date

Expand Down Expand Up @@ -327,7 +327,7 @@ def get_new_paginator(self):
elif self.pagination_request_style == "simple_offset_paginator":
return SimpleOffsetPaginator(
start_value=self.pagination_initial_offset,
pagination_page_size=self.pagination_page_size
pagination_page_size=self.pagination_page_size,
)
else:
self.logger.error(
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ envlist = py38
isolated_build = true

[testenv]
whitelist_externals = poetry
allowlist_externals = poetry

commands =
poetry install -v
Expand Down

0 comments on commit f4eeb54

Please sign in to comment.