Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test_tap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
strategy:
matrix:
python-version:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
23 changes: 23 additions & 0 deletions tap_github/organization_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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()
22 changes: 0 additions & 22 deletions tap_github/repository_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
5 changes: 2 additions & 3 deletions tap_github/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from singer_sdk.streams.core import Stream

from tap_github.organization_streams import (
CustomPropertiesStream,
OrganizationStream,
TeamMembersStream,
TeamRolesStream,
Expand All @@ -17,7 +18,6 @@
CommitsStream,
CommunityProfileStream,
ContributorsStream,
CustomPropertiesStream,
DependenciesStream,
DependentsStream,
EventsStream,
Expand Down Expand Up @@ -75,7 +75,6 @@ def __init__(self, valid_queries: Set[str], streams: List[Type[Stream]]):
CommitsStream,
CommunityProfileStream,
ContributorsStream,
CustomPropertiesStream,
DependenciesStream,
DependentsStream,
EventsStream,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
isolated_build = true
envlist = py36, py38, py39
envlist = py3{8,9,10,11,12}

[testenv]
whitelist_externals = poetry
Expand Down