prefect-github 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prefect_github-0.3.1/prefect_github.egg-info → prefect_github-0.3.2}/PKG-INFO +4 -16
- prefect_github-0.3.2/prefect_github/_version.py +34 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/credentials.py +25 -1
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/repository.py +1 -1
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/schemas/graphql_schema.py +1 -1
- {prefect_github-0.3.1 → prefect_github-0.3.2/prefect_github.egg-info}/PKG-INFO +4 -16
- prefect_github-0.3.2/prefect_github.egg-info/requires.txt +2 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/pyproject.toml +5 -1
- prefect_github-0.3.2/tests/test_credentials.py +25 -0
- prefect_github-0.3.1/prefect_github/_version.py +0 -16
- prefect_github-0.3.1/prefect_github.egg-info/requires.txt +0 -17
- prefect_github-0.3.1/tests/test_credentials.py +0 -11
- {prefect_github-0.3.1 → prefect_github-0.3.2}/LICENSE +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/MANIFEST.in +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/README.md +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/__init__.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_comment.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_pull_request_review.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_reaction.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_star.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/close_issue.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/close_pull_request.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/create_issue.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/create_pull_request.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/remove_reaction.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/remove_star.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/request_reviews.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/organization.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/repository.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/repository_owner.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/user.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/viewer.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/exceptions.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/graphql.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/mutations.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/organization.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/repository_owner.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/schemas/__init__.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/schemas/graphql_schema.json +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/user.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/utils.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/viewer.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github.egg-info/SOURCES.txt +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github.egg-info/dependency_links.txt +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github.egg-info/entry_points.txt +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github.egg-info/top_level.txt +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/setup.cfg +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/tests/conftest.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/tests/test_block_standards.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/tests/test_graphql.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/tests/test_repository.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/tests/test_utils.py +0 -0
- {prefect_github-0.3.1 → prefect_github-0.3.2}/tests/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: prefect-github
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Prefect integrations interacting with GitHub
|
|
5
5
|
Author-email: "Prefect Technologies, Inc." <help@prefect.io>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -15,26 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Topic :: Software Development :: Libraries
|
|
19
20
|
Requires-Python: >=3.9
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
License-File: LICENSE
|
|
22
23
|
Requires-Dist: sgqlc>=15.0
|
|
23
24
|
Requires-Dist: prefect>=3.0.0
|
|
24
|
-
|
|
25
|
-
Requires-Dist: coverage; extra == "dev"
|
|
26
|
-
Requires-Dist: interrogate; extra == "dev"
|
|
27
|
-
Requires-Dist: mkdocs-gen-files; extra == "dev"
|
|
28
|
-
Requires-Dist: mkdocs-material; extra == "dev"
|
|
29
|
-
Requires-Dist: mkdocs; extra == "dev"
|
|
30
|
-
Requires-Dist: mkdocstrings[python]; extra == "dev"
|
|
31
|
-
Requires-Dist: mypy; extra == "dev"
|
|
32
|
-
Requires-Dist: pillow; extra == "dev"
|
|
33
|
-
Requires-Dist: pre-commit; extra == "dev"
|
|
34
|
-
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
35
|
-
Requires-Dist: pytest>=8.3; extra == "dev"
|
|
36
|
-
Requires-Dist: pytest-env; extra == "dev"
|
|
37
|
-
Requires-Dist: pytest-xdist; extra == "dev"
|
|
25
|
+
Dynamic: license-file
|
|
38
26
|
|
|
39
27
|
# prefect-github
|
|
40
28
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '0.3.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 3, 2)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'g8a37e7b1b'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Credential classes used to perform authenticated interactions with GitHub"""
|
|
2
2
|
|
|
3
3
|
from typing import Optional
|
|
4
|
+
from urllib.parse import urlparse, urlunparse
|
|
4
5
|
|
|
5
6
|
from pydantic import Field, SecretStr
|
|
6
7
|
from sgqlc.endpoint.http import HTTPEndpoint
|
|
@@ -25,12 +26,35 @@ class GitHubCredentials(CredentialsBlock):
|
|
|
25
26
|
|
|
26
27
|
_block_type_name = "GitHub Credentials"
|
|
27
28
|
_logo_url = "https://cdn.sanity.io/images/3ugk85nk/production/41971cfecfea5f79ff334164f06ecb34d1038dd4-250x250.png" # noqa
|
|
28
|
-
_documentation_url = "https://
|
|
29
|
+
_documentation_url = "https://docs.prefect.io/integrations/prefect-github"
|
|
29
30
|
|
|
30
31
|
token: Optional[SecretStr] = Field(
|
|
31
32
|
default=None, description="A GitHub personal access token (PAT)."
|
|
32
33
|
)
|
|
33
34
|
|
|
35
|
+
def format_git_credentials(self, url: str) -> str:
|
|
36
|
+
"""
|
|
37
|
+
Format and return the full git URL with GitHub credentials embedded.
|
|
38
|
+
|
|
39
|
+
GitHub uses plain token format without any prefix.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
url: Repository URL (e.g., "https://github.com/org/repo.git")
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
Complete URL with credentials embedded
|
|
46
|
+
|
|
47
|
+
Raises:
|
|
48
|
+
ValueError: If token is not configured
|
|
49
|
+
"""
|
|
50
|
+
if not self.token:
|
|
51
|
+
raise ValueError("Token is required for GitHub authentication")
|
|
52
|
+
|
|
53
|
+
# Insert token into URL
|
|
54
|
+
parsed = urlparse(url)
|
|
55
|
+
credentials = self.token.get_secret_value()
|
|
56
|
+
return urlunparse(parsed._replace(netloc=f"{credentials}@{parsed.netloc}"))
|
|
57
|
+
|
|
34
58
|
def get_client(self) -> HTTPEndpoint:
|
|
35
59
|
"""
|
|
36
60
|
Gets an authenticated GitHub GraphQL HTTPEndpoint client.
|
|
@@ -39,7 +39,7 @@ class GitHubRepository(ReadableDeploymentStorage):
|
|
|
39
39
|
|
|
40
40
|
_block_type_name = "GitHub Repository"
|
|
41
41
|
_logo_url = "https://cdn.sanity.io/images/3ugk85nk/production/41971cfecfea5f79ff334164f06ecb34d1038dd4-250x250.png" # noqa: E501
|
|
42
|
-
_documentation_url = "https://
|
|
42
|
+
_documentation_url = "https://docs.prefect.io/integrations/prefect-github" # noqa
|
|
43
43
|
|
|
44
44
|
repository_url: str = Field(
|
|
45
45
|
default=...,
|
|
@@ -5,7 +5,7 @@ import sgqlc.types.relay
|
|
|
5
5
|
graphql_schema = sgqlc.types.Schema()
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
# Unexport Node/PageInfo, let schema
|
|
8
|
+
# Unexport Node/PageInfo, let schema redeclare them
|
|
9
9
|
graphql_schema -= sgqlc.types.relay.Node
|
|
10
10
|
graphql_schema -= sgqlc.types.relay.PageInfo
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: prefect-github
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Prefect integrations interacting with GitHub
|
|
5
5
|
Author-email: "Prefect Technologies, Inc." <help@prefect.io>
|
|
6
6
|
License: Apache License 2.0
|
|
@@ -15,26 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Topic :: Software Development :: Libraries
|
|
19
20
|
Requires-Python: >=3.9
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
License-File: LICENSE
|
|
22
23
|
Requires-Dist: sgqlc>=15.0
|
|
23
24
|
Requires-Dist: prefect>=3.0.0
|
|
24
|
-
|
|
25
|
-
Requires-Dist: coverage; extra == "dev"
|
|
26
|
-
Requires-Dist: interrogate; extra == "dev"
|
|
27
|
-
Requires-Dist: mkdocs-gen-files; extra == "dev"
|
|
28
|
-
Requires-Dist: mkdocs-material; extra == "dev"
|
|
29
|
-
Requires-Dist: mkdocs; extra == "dev"
|
|
30
|
-
Requires-Dist: mkdocstrings[python]; extra == "dev"
|
|
31
|
-
Requires-Dist: mypy; extra == "dev"
|
|
32
|
-
Requires-Dist: pillow; extra == "dev"
|
|
33
|
-
Requires-Dist: pre-commit; extra == "dev"
|
|
34
|
-
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
35
|
-
Requires-Dist: pytest>=8.3; extra == "dev"
|
|
36
|
-
Requires-Dist: pytest-env; extra == "dev"
|
|
37
|
-
Requires-Dist: pytest-xdist; extra == "dev"
|
|
25
|
+
Dynamic: license-file
|
|
38
26
|
|
|
39
27
|
# prefect-github
|
|
40
28
|
|
|
@@ -22,10 +22,11 @@ classifiers = [
|
|
|
22
22
|
"Programming Language :: Python :: 3.10",
|
|
23
23
|
"Programming Language :: Python :: 3.11",
|
|
24
24
|
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
25
26
|
"Topic :: Software Development :: Libraries",
|
|
26
27
|
]
|
|
27
28
|
|
|
28
|
-
[
|
|
29
|
+
[dependency-groups]
|
|
29
30
|
dev = [
|
|
30
31
|
"coverage",
|
|
31
32
|
"interrogate",
|
|
@@ -73,3 +74,6 @@ show_missing = true
|
|
|
73
74
|
asyncio_default_fixture_loop_scope = "session"
|
|
74
75
|
asyncio_mode = "auto"
|
|
75
76
|
env = ["PREFECT_TEST_MODE=1"]
|
|
77
|
+
|
|
78
|
+
[tool.uv.sources]
|
|
79
|
+
prefect = { path = "../../../" }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
from prefect_github import GitHubCredentials
|
|
3
|
+
from sgqlc.endpoint.http import HTTPEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@pytest.mark.parametrize("token", [None, "token_value"])
|
|
7
|
+
def test_github_credentials_get_client(token):
|
|
8
|
+
endpoint = GitHubCredentials(token=token).get_client()
|
|
9
|
+
assert isinstance(endpoint, HTTPEndpoint)
|
|
10
|
+
if token is not None:
|
|
11
|
+
assert endpoint.base_headers == {"Authorization": "Bearer token_value"}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def test_format_git_credentials():
|
|
15
|
+
"""Test that GitHub credentials return URL with token embedded."""
|
|
16
|
+
credentials = GitHubCredentials(token="my-github-token")
|
|
17
|
+
result = credentials.format_git_credentials("https://github.com/org/repo.git")
|
|
18
|
+
assert result == "https://my-github-token@github.com/org/repo.git"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def test_format_git_credentials_no_token_raises():
|
|
22
|
+
"""Test that missing token raises ValueError."""
|
|
23
|
+
credentials = GitHubCredentials()
|
|
24
|
+
with pytest.raises(ValueError, match="Token is required for GitHub authentication"):
|
|
25
|
+
credentials.format_git_credentials("https://github.com/org/repo.git")
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# file generated by setuptools_scm
|
|
2
|
-
# don't change, don't track in version control
|
|
3
|
-
TYPE_CHECKING = False
|
|
4
|
-
if TYPE_CHECKING:
|
|
5
|
-
from typing import Tuple, Union
|
|
6
|
-
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
7
|
-
else:
|
|
8
|
-
VERSION_TUPLE = object
|
|
9
|
-
|
|
10
|
-
version: str
|
|
11
|
-
__version__: str
|
|
12
|
-
__version_tuple__: VERSION_TUPLE
|
|
13
|
-
version_tuple: VERSION_TUPLE
|
|
14
|
-
|
|
15
|
-
__version__ = version = '0.3.1'
|
|
16
|
-
__version_tuple__ = version_tuple = (0, 3, 1)
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from prefect_github import GitHubCredentials
|
|
3
|
-
from sgqlc.endpoint.http import HTTPEndpoint
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@pytest.mark.parametrize("token", [None, "token_value"])
|
|
7
|
-
def test_github_credentials_get_client(token):
|
|
8
|
-
endpoint = GitHubCredentials(token=token).get_client()
|
|
9
|
-
assert isinstance(endpoint, HTTPEndpoint)
|
|
10
|
-
if token is not None:
|
|
11
|
-
assert endpoint.base_headers == {"Authorization": "Bearer token_value"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_comment.json
RENAMED
|
File without changes
|
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_reaction.json
RENAMED
|
File without changes
|
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/close_issue.json
RENAMED
|
File without changes
|
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/create_issue.json
RENAMED
|
File without changes
|
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/remove_reaction.json
RENAMED
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/remove_star.json
RENAMED
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/mutation/request_reviews.json
RENAMED
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/organization.json
RENAMED
|
File without changes
|
|
File without changes
|
{prefect_github-0.3.1 → prefect_github-0.3.2}/prefect_github/configs/query/repository_owner.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|