prefect-github 0.3.0rc2__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.
Files changed (56) hide show
  1. prefect_github-0.3.2/PKG-INFO +36 -0
  2. prefect_github-0.3.2/README.md +10 -0
  3. prefect_github-0.3.2/prefect_github/_version.py +34 -0
  4. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/credentials.py +25 -1
  5. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/repository.py +3 -2
  6. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/schemas/graphql_schema.py +1 -1
  7. prefect_github-0.3.2/prefect_github.egg-info/PKG-INFO +36 -0
  8. prefect_github-0.3.2/prefect_github.egg-info/requires.txt +2 -0
  9. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/pyproject.toml +9 -9
  10. prefect_github-0.3.2/tests/test_credentials.py +25 -0
  11. prefect_github-0.3.0rc2/PKG-INFO +0 -129
  12. prefect_github-0.3.0rc2/README.md +0 -91
  13. prefect_github-0.3.0rc2/prefect_github/_version.py +0 -16
  14. prefect_github-0.3.0rc2/prefect_github.egg-info/PKG-INFO +0 -129
  15. prefect_github-0.3.0rc2/prefect_github.egg-info/requires.txt +0 -17
  16. prefect_github-0.3.0rc2/tests/test_credentials.py +0 -11
  17. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/LICENSE +0 -0
  18. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/MANIFEST.in +0 -0
  19. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/__init__.py +0 -0
  20. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_comment.json +0 -0
  21. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_pull_request_review.json +0 -0
  22. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_reaction.json +0 -0
  23. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/add_star.json +0 -0
  24. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/close_issue.json +0 -0
  25. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/close_pull_request.json +0 -0
  26. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/create_issue.json +0 -0
  27. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/create_pull_request.json +0 -0
  28. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/remove_reaction.json +0 -0
  29. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/remove_star.json +0 -0
  30. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/mutation/request_reviews.json +0 -0
  31. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/query/organization.json +0 -0
  32. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/query/repository.json +0 -0
  33. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/query/repository_owner.json +0 -0
  34. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/query/user.json +0 -0
  35. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/configs/query/viewer.json +0 -0
  36. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/exceptions.py +0 -0
  37. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/graphql.py +0 -0
  38. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/mutations.py +0 -0
  39. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/organization.py +0 -0
  40. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/repository_owner.py +0 -0
  41. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/schemas/__init__.py +0 -0
  42. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/schemas/graphql_schema.json +0 -0
  43. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/user.py +0 -0
  44. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/utils.py +0 -0
  45. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github/viewer.py +0 -0
  46. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github.egg-info/SOURCES.txt +0 -0
  47. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github.egg-info/dependency_links.txt +0 -0
  48. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github.egg-info/entry_points.txt +0 -0
  49. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/prefect_github.egg-info/top_level.txt +0 -0
  50. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/setup.cfg +0 -0
  51. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/tests/conftest.py +0 -0
  52. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/tests/test_block_standards.py +0 -0
  53. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/tests/test_graphql.py +0 -0
  54. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/tests/test_repository.py +0 -0
  55. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/tests/test_utils.py +0 -0
  56. {prefect_github-0.3.0rc2 → prefect_github-0.3.2}/tests/test_version.py +0 -0
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: prefect-github
3
+ Version: 0.3.2
4
+ Summary: Prefect integrations interacting with GitHub
5
+ Author-email: "Prefect Technologies, Inc." <help@prefect.io>
6
+ License: Apache License 2.0
7
+ Project-URL: Homepage, https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-github
8
+ Keywords: prefect
9
+ Classifier: Natural Language :: English
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: sgqlc>=15.0
24
+ Requires-Dist: prefect>=3.0.0
25
+ Dynamic: license-file
26
+
27
+ # prefect-github
28
+
29
+ <p align="center">
30
+ <a href="https://pypi.python.org/pypi/prefect-github/" alt="PyPI version">
31
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-github?color=26272B&labelColor=090422"></a>
32
+ <a href="https://pepy.tech/badge/prefect-github/" alt="Downloads">
33
+ <img src="https://img.shields.io/pypi/dm/prefect-github?color=26272B&labelColor=090422" /></a>
34
+ </p>
35
+
36
+ See the docs at [https://docs.prefect.io/integrations/prefect-github](https://docs.prefect.io/integrations/prefect-github) for more information.
@@ -0,0 +1,10 @@
1
+ # prefect-github
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.python.org/pypi/prefect-github/" alt="PyPI version">
5
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-github?color=26272B&labelColor=090422"></a>
6
+ <a href="https://pepy.tech/badge/prefect-github/" alt="Downloads">
7
+ <img src="https://img.shields.io/pypi/dm/prefect-github?color=26272B&labelColor=090422" /></a>
8
+ </p>
9
+
10
+ See the docs at [https://docs.prefect.io/integrations/prefect-github](https://docs.prefect.io/integrations/prefect-github) for more information.
@@ -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://prefecthq.github.io/prefect-github/credentials/#prefect_github.credentials.GitHubCredentials" # noqa
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://prefecthq.github.io/prefect-github/repository/#prefect_github.repository.GitHubRepository" # noqa
42
+ _documentation_url = "https://docs.prefect.io/integrations/prefect-github" # noqa
43
43
 
44
44
  repository_url: str = Field(
45
45
  default=...,
@@ -121,7 +121,8 @@ class GitHubRepository(ReadableDeploymentStorage):
121
121
  # Clone to a temporary directory and move the subdirectory over
122
122
  with TemporaryDirectory(suffix="prefect") as tmp_dir:
123
123
  tmp_path_str = tmp_dir
124
- cmd += f" {tmp_path_str}"
124
+ # wrap the directory with quotes, because shlex removes windows-style slashes "//" - fixes issue 13180
125
+ cmd += f' "{tmp_path_str}"'
125
126
  cmd = shlex.split(cmd)
126
127
 
127
128
  err_stream = io.StringIO()
@@ -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 re-declare them
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
 
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: prefect-github
3
+ Version: 0.3.2
4
+ Summary: Prefect integrations interacting with GitHub
5
+ Author-email: "Prefect Technologies, Inc." <help@prefect.io>
6
+ License: Apache License 2.0
7
+ Project-URL: Homepage, https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-github
8
+ Keywords: prefect
9
+ Classifier: Natural Language :: English
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: sgqlc>=15.0
24
+ Requires-Dist: prefect>=3.0.0
25
+ Dynamic: license-file
26
+
27
+ # prefect-github
28
+
29
+ <p align="center">
30
+ <a href="https://pypi.python.org/pypi/prefect-github/" alt="PyPI version">
31
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-github?color=26272B&labelColor=090422"></a>
32
+ <a href="https://pepy.tech/badge/prefect-github/" alt="Downloads">
33
+ <img src="https://img.shields.io/pypi/dm/prefect-github?color=26272B&labelColor=090422" /></a>
34
+ </p>
35
+
36
+ See the docs at [https://docs.prefect.io/integrations/prefect-github](https://docs.prefect.io/integrations/prefect-github) for more information.
@@ -0,0 +1,2 @@
1
+ sgqlc>=15.0
2
+ prefect>=3.0.0
@@ -4,10 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "prefect-github"
7
- dependencies = [
8
- "sgqlc>=15.0",
9
- "prefect>=3.0.0rc1",
10
- ]
7
+ dependencies = ["sgqlc>=15.0", "prefect>=3.0.0"]
11
8
  dynamic = ["version"]
12
9
  description = "Prefect integrations interacting with GitHub"
13
10
  readme = "README.md"
@@ -25,10 +22,11 @@ classifiers = [
25
22
  "Programming Language :: Python :: 3.10",
26
23
  "Programming Language :: Python :: 3.11",
27
24
  "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
28
26
  "Topic :: Software Development :: Libraries",
29
27
  ]
30
28
 
31
- [project.optional-dependencies]
29
+ [dependency-groups]
32
30
  dev = [
33
31
  "coverage",
34
32
  "interrogate",
@@ -40,7 +38,7 @@ dev = [
40
38
  "pillow",
41
39
  "pre-commit",
42
40
  "pytest-asyncio",
43
- "pytest",
41
+ "pytest >= 8.3",
44
42
  "pytest-env",
45
43
  "pytest-xdist",
46
44
  ]
@@ -73,7 +71,9 @@ fail_under = 80
73
71
  show_missing = true
74
72
 
75
73
  [tool.pytest.ini_options]
74
+ asyncio_default_fixture_loop_scope = "session"
76
75
  asyncio_mode = "auto"
77
- env = [
78
- "PREFECT_TEST_MODE=1",
79
- ]
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,129 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: prefect-github
3
- Version: 0.3.0rc2
4
- Summary: Prefect integrations interacting with GitHub
5
- Author-email: "Prefect Technologies, Inc." <help@prefect.io>
6
- License: Apache License 2.0
7
- Project-URL: Homepage, https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-github
8
- Keywords: prefect
9
- Classifier: Natural Language :: English
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Intended Audience :: System Administrators
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Topic :: Software Development :: Libraries
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Requires-Dist: sgqlc>=15.0
23
- Requires-Dist: prefect>=3.0.0rc1
24
- Provides-Extra: dev
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; extra == "dev"
36
- Requires-Dist: pytest-env; extra == "dev"
37
- Requires-Dist: pytest-xdist; extra == "dev"
38
-
39
- # prefect-github
40
-
41
- <p align="center">
42
- <a href="https://pypi.python.org/pypi/prefect-github/" alt="PyPI version">
43
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-github?color=26272B&labelColor=090422"></a>
44
- <a href="https://pepy.tech/badge/prefect-github/" alt="Downloads">
45
- <img src="https://img.shields.io/pypi/dm/prefect-github?color=26272B&labelColor=090422" /></a>
46
- </p>
47
-
48
- ## Welcome!
49
-
50
- Prefect integrations interacting with GitHub.
51
-
52
- The tasks within this collection were created by a code generator using the GitHub GraphQL schema.
53
-
54
- ## Getting Started
55
-
56
- ### Python setup
57
-
58
- Requires an installation of Python 3.9 or newer.
59
-
60
- We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
61
-
62
- These tasks are designed to work with Prefect 2. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
63
-
64
- ### Installation
65
-
66
- Install `prefect-github` with `pip`:
67
-
68
- ```bash
69
- pip install prefect-github
70
- ```
71
-
72
- Then, register to [view the block](https://docs.prefect.io/ui/blocks/) on Prefect Cloud:
73
-
74
- ```bash
75
- prefect block register -m prefect_github
76
- ```
77
-
78
- Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or saved through the UI.
79
-
80
- ### Write and run a flow
81
-
82
- ```python
83
- from prefect import flow
84
- from prefect_github import GitHubCredentials
85
- from prefect_github.repository import query_repository
86
- from prefect_github.mutations import add_star_starrable
87
-
88
-
89
- @flow()
90
- def github_add_star_flow():
91
- github_credentials = GitHubCredentials.load("github-token")
92
- repository_id = query_repository(
93
- "PrefectHQ",
94
- "Prefect",
95
- github_credentials=github_credentials,
96
- return_fields="id"
97
- )["id"]
98
- starrable = add_star_starrable(
99
- repository_id,
100
- github_credentials
101
- )
102
- return starrable
103
-
104
-
105
- github_add_star_flow()
106
- ```
107
-
108
- ## Resources
109
-
110
- If you encounter any bugs while using `prefect-github`, feel free to open an issue in the [prefect-github](https://github.com/PrefectHQ/prefect-github) repository.
111
-
112
- If you have any questions or issues while using `prefect-github`, you can find help in the [Prefect Slack community](https://prefect.io/slack).
113
-
114
- Feel free to ⭐️ or watch [`prefect-github`](https://github.com/PrefectHQ/prefect-github) for updates too!
115
-
116
- ## Development
117
-
118
- If you'd like to install a version of `prefect-github` for development, clone the repository and perform an editable install with `pip`:
119
-
120
- ```bash
121
- git clone https://github.com/PrefectHQ/prefect-github.git
122
-
123
- cd prefect-github/
124
-
125
- pip install -e ".[dev]"
126
-
127
- # Install linting pre-commit hooks
128
- pre-commit install
129
- ```
@@ -1,91 +0,0 @@
1
- # prefect-github
2
-
3
- <p align="center">
4
- <a href="https://pypi.python.org/pypi/prefect-github/" alt="PyPI version">
5
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-github?color=26272B&labelColor=090422"></a>
6
- <a href="https://pepy.tech/badge/prefect-github/" alt="Downloads">
7
- <img src="https://img.shields.io/pypi/dm/prefect-github?color=26272B&labelColor=090422" /></a>
8
- </p>
9
-
10
- ## Welcome!
11
-
12
- Prefect integrations interacting with GitHub.
13
-
14
- The tasks within this collection were created by a code generator using the GitHub GraphQL schema.
15
-
16
- ## Getting Started
17
-
18
- ### Python setup
19
-
20
- Requires an installation of Python 3.9 or newer.
21
-
22
- We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
23
-
24
- These tasks are designed to work with Prefect 2. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
25
-
26
- ### Installation
27
-
28
- Install `prefect-github` with `pip`:
29
-
30
- ```bash
31
- pip install prefect-github
32
- ```
33
-
34
- Then, register to [view the block](https://docs.prefect.io/ui/blocks/) on Prefect Cloud:
35
-
36
- ```bash
37
- prefect block register -m prefect_github
38
- ```
39
-
40
- Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or saved through the UI.
41
-
42
- ### Write and run a flow
43
-
44
- ```python
45
- from prefect import flow
46
- from prefect_github import GitHubCredentials
47
- from prefect_github.repository import query_repository
48
- from prefect_github.mutations import add_star_starrable
49
-
50
-
51
- @flow()
52
- def github_add_star_flow():
53
- github_credentials = GitHubCredentials.load("github-token")
54
- repository_id = query_repository(
55
- "PrefectHQ",
56
- "Prefect",
57
- github_credentials=github_credentials,
58
- return_fields="id"
59
- )["id"]
60
- starrable = add_star_starrable(
61
- repository_id,
62
- github_credentials
63
- )
64
- return starrable
65
-
66
-
67
- github_add_star_flow()
68
- ```
69
-
70
- ## Resources
71
-
72
- If you encounter any bugs while using `prefect-github`, feel free to open an issue in the [prefect-github](https://github.com/PrefectHQ/prefect-github) repository.
73
-
74
- If you have any questions or issues while using `prefect-github`, you can find help in the [Prefect Slack community](https://prefect.io/slack).
75
-
76
- Feel free to ⭐️ or watch [`prefect-github`](https://github.com/PrefectHQ/prefect-github) for updates too!
77
-
78
- ## Development
79
-
80
- If you'd like to install a version of `prefect-github` for development, clone the repository and perform an editable install with `pip`:
81
-
82
- ```bash
83
- git clone https://github.com/PrefectHQ/prefect-github.git
84
-
85
- cd prefect-github/
86
-
87
- pip install -e ".[dev]"
88
-
89
- # Install linting pre-commit hooks
90
- pre-commit install
91
- ```
@@ -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.0rc2'
16
- __version_tuple__ = version_tuple = (0, 3, 0)
@@ -1,129 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: prefect-github
3
- Version: 0.3.0rc2
4
- Summary: Prefect integrations interacting with GitHub
5
- Author-email: "Prefect Technologies, Inc." <help@prefect.io>
6
- License: Apache License 2.0
7
- Project-URL: Homepage, https://github.com/PrefectHQ/prefect/tree/main/src/integrations/prefect-github
8
- Keywords: prefect
9
- Classifier: Natural Language :: English
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Intended Audience :: System Administrators
12
- Classifier: License :: OSI Approved :: Apache Software License
13
- Classifier: Programming Language :: Python :: 3 :: Only
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Topic :: Software Development :: Libraries
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Requires-Dist: sgqlc>=15.0
23
- Requires-Dist: prefect>=3.0.0rc1
24
- Provides-Extra: dev
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; extra == "dev"
36
- Requires-Dist: pytest-env; extra == "dev"
37
- Requires-Dist: pytest-xdist; extra == "dev"
38
-
39
- # prefect-github
40
-
41
- <p align="center">
42
- <a href="https://pypi.python.org/pypi/prefect-github/" alt="PyPI version">
43
- <img alt="PyPI" src="https://img.shields.io/pypi/v/prefect-github?color=26272B&labelColor=090422"></a>
44
- <a href="https://pepy.tech/badge/prefect-github/" alt="Downloads">
45
- <img src="https://img.shields.io/pypi/dm/prefect-github?color=26272B&labelColor=090422" /></a>
46
- </p>
47
-
48
- ## Welcome!
49
-
50
- Prefect integrations interacting with GitHub.
51
-
52
- The tasks within this collection were created by a code generator using the GitHub GraphQL schema.
53
-
54
- ## Getting Started
55
-
56
- ### Python setup
57
-
58
- Requires an installation of Python 3.9 or newer.
59
-
60
- We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
61
-
62
- These tasks are designed to work with Prefect 2. For more information about how to use Prefect, please refer to the [Prefect documentation](https://docs.prefect.io/).
63
-
64
- ### Installation
65
-
66
- Install `prefect-github` with `pip`:
67
-
68
- ```bash
69
- pip install prefect-github
70
- ```
71
-
72
- Then, register to [view the block](https://docs.prefect.io/ui/blocks/) on Prefect Cloud:
73
-
74
- ```bash
75
- prefect block register -m prefect_github
76
- ```
77
-
78
- Note, to use the `load` method on Blocks, you must already have a block document [saved through code](https://orion-docs.prefect.io/concepts/blocks/#saving-blocks) or saved through the UI.
79
-
80
- ### Write and run a flow
81
-
82
- ```python
83
- from prefect import flow
84
- from prefect_github import GitHubCredentials
85
- from prefect_github.repository import query_repository
86
- from prefect_github.mutations import add_star_starrable
87
-
88
-
89
- @flow()
90
- def github_add_star_flow():
91
- github_credentials = GitHubCredentials.load("github-token")
92
- repository_id = query_repository(
93
- "PrefectHQ",
94
- "Prefect",
95
- github_credentials=github_credentials,
96
- return_fields="id"
97
- )["id"]
98
- starrable = add_star_starrable(
99
- repository_id,
100
- github_credentials
101
- )
102
- return starrable
103
-
104
-
105
- github_add_star_flow()
106
- ```
107
-
108
- ## Resources
109
-
110
- If you encounter any bugs while using `prefect-github`, feel free to open an issue in the [prefect-github](https://github.com/PrefectHQ/prefect-github) repository.
111
-
112
- If you have any questions or issues while using `prefect-github`, you can find help in the [Prefect Slack community](https://prefect.io/slack).
113
-
114
- Feel free to ⭐️ or watch [`prefect-github`](https://github.com/PrefectHQ/prefect-github) for updates too!
115
-
116
- ## Development
117
-
118
- If you'd like to install a version of `prefect-github` for development, clone the repository and perform an editable install with `pip`:
119
-
120
- ```bash
121
- git clone https://github.com/PrefectHQ/prefect-github.git
122
-
123
- cd prefect-github/
124
-
125
- pip install -e ".[dev]"
126
-
127
- # Install linting pre-commit hooks
128
- pre-commit install
129
- ```
@@ -1,17 +0,0 @@
1
- sgqlc>=15.0
2
- prefect>=3.0.0rc1
3
-
4
- [dev]
5
- coverage
6
- interrogate
7
- mkdocs-gen-files
8
- mkdocs-material
9
- mkdocs
10
- mkdocstrings[python]
11
- mypy
12
- pillow
13
- pre-commit
14
- pytest-asyncio
15
- pytest
16
- pytest-env
17
- pytest-xdist
@@ -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"}