From f41b66d5b51a3b9dc86ba0c9dcfd15d98b91df21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:10:29 -0600 Subject: [PATCH 1/3] feat: Add support for Python 3.12 (#269) --- .github/workflows/test_tap.yml | 1 + poetry.lock | 4 ++-- pyproject.toml | 4 ++-- tox.ini | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_tap.yml b/.github/workflows/test_tap.yml index 0edad2c2..6016a531 100644 --- a/.github/workflows/test_tap.yml +++ b/.github/workflows/test_tap.yml @@ -31,6 +31,7 @@ jobs: strategy: matrix: python-version: + - "3.12" - "3.11" - "3.10" - "3.9" diff --git a/poetry.lock b/poetry.lock index b3a5be2d..392d8429 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1688,5 +1688,5 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" -python-versions = ">=3.8,<3.12" -content-hash = "bcfc8e8af1bda976bb02b973e817cdf28b85ed784756974a825ede760075689f" +python-versions = ">=3.8" +content-hash = "f258c2824cb2b8f1b39e2728e830b4550eebda2832ed89e087514466e11e6b3c" diff --git a/pyproject.toml b/pyproject.toml index 5667d827..6301919f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,11 +25,11 @@ classifiers = [ [tool.poetry.dependencies] PyJWT = "2.8.0" -python = ">=3.8,<3.12" +python = ">=3.8" requests = "~=2.32.3" # For local SDK dev: # singer-sdk = {path = "../singer-sdk", develop = true} -singer-sdk = "~=0.32.0" +singer-sdk = { version = "~=0.32.0", python = "<4" } types-simplejson = "~=3.19.0" types-python-dateutil = "~=2.9.0" nested-lookup = "~=0.2.25" diff --git a/tox.ini b/tox.ini index 6b48fe08..d2651d32 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] isolated_build = true -envlist = py36, py38, py39 +envlist = py3{8,9,10,11,12} [testenv] whitelist_externals = poetry From 1b41def4001c2111a8e7024aa94241759e9ba90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Fri, 5 Jul 2024 20:46:10 -0600 Subject: [PATCH 2/3] chore: Bump version (#270) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6301919f..e87d7b61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "tap-github" -version = "1.3.0" +version = "1.4.1" description = "`tap-github` is Singer tap for GitHub, built with the Singer SDK." authors = ["Meltano and Meltano Community"] homepage = "https://github.com/MeltanoLabs/tap-github" From b8c5650c528c216f0de44f3148aee8954f6822c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mindaugas=20Ni=C5=BEauskas?= Date: Mon, 8 Jul 2024 18:05:16 +0300 Subject: [PATCH 3/3] move CustomPropertiesStream to ORGANIZATIONS --- tap_github/organization_streams.py | 23 +++++++++++++++++++++++ tap_github/repository_streams.py | 22 ---------------------- tap_github/streams.py | 5 ++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tap_github/organization_streams.py b/tap_github/organization_streams.py index b4222172..2b12054b 100644 --- a/tap_github/organization_streams.py +++ b/tap_github/organization_streams.py @@ -5,6 +5,7 @@ from singer_sdk import typing as th # JSON Schema typing helpers from tap_github.client import GitHubRestStream +from tap_github.repository_streams import RepositoryStream class OrganizationStream(GitHubRestStream): @@ -177,3 +178,25 @@ class TeamRolesStream(GitHubRestStream): th.Property("role", th.StringType), th.Property("state", th.StringType), ).to_dict() + + +class CustomPropertiesStream(GitHubRestStream): + """Defines 'custom_properties' stream.""" + + name = "custom_properties" + path = "/repos/{org}/{repo}/properties/values" + primary_keys = ["repo", "org", "property_name"] + replication_key = None + parent_stream_type = RepositoryStream + ignore_parent_replication_key = True + state_partitioning_keys = ["repo", "org"] + + schema = th.PropertiesList( + # Parent Keys + th.Property("repo", th.StringType), + th.Property("org", th.StringType), + th.Property("repo_id", th.IntegerType), + # Custom Property Keys + th.Property("property_name", th.StringType), + th.Property("value", th.StringType), + ).to_dict() diff --git a/tap_github/repository_streams.py b/tap_github/repository_streams.py index d2942695..de8371e8 100644 --- a/tap_github/repository_streams.py +++ b/tap_github/repository_streams.py @@ -2441,25 +2441,3 @@ class TrafficPageViewsStream(TrafficRestStream): th.Property("count", th.IntegerType), th.Property("uniques", th.IntegerType), ).to_dict() - - -class CustomPropertiesStream(GitHubRestStream): - """Defines 'custom_properties' stream.""" - - name = "custom_properties" - path = "/repos/{org}/{repo}/properties/values" - primary_keys = ["repo", "org", "property_name"] - replication_key = None - parent_stream_type = RepositoryStream - ignore_parent_replication_key = True - state_partitioning_keys = ["repo", "org"] - - schema = th.PropertiesList( - # Parent Keys - th.Property("repo", th.StringType), - th.Property("org", th.StringType), - th.Property("repo_id", th.IntegerType), - # Custom Property Keys - th.Property("property_name", th.StringType), - th.Property("value", th.StringType), - ).to_dict() diff --git a/tap_github/streams.py b/tap_github/streams.py index a0690b9b..e6c9eb3d 100644 --- a/tap_github/streams.py +++ b/tap_github/streams.py @@ -4,6 +4,7 @@ from singer_sdk.streams.core import Stream from tap_github.organization_streams import ( + CustomPropertiesStream, OrganizationStream, TeamMembersStream, TeamRolesStream, @@ -17,7 +18,6 @@ CommitsStream, CommunityProfileStream, ContributorsStream, - CustomPropertiesStream, DependenciesStream, DependentsStream, EventsStream, @@ -75,7 +75,6 @@ def __init__(self, valid_queries: Set[str], streams: List[Type[Stream]]): CommitsStream, CommunityProfileStream, ContributorsStream, - CustomPropertiesStream, DependenciesStream, DependentsStream, EventsStream, @@ -119,7 +118,7 @@ def __init__(self, valid_queries: Set[str], streams: List[Type[Stream]]): ) ORGANIZATIONS = ( {"organizations"}, - [OrganizationStream, TeamMembersStream, TeamRolesStream, TeamsStream], + [CustomPropertiesStream, OrganizationStream, TeamMembersStream, TeamRolesStream, TeamsStream], ) @classmethod