PyLinks 0.0.0.dev45__tar.gz → 0.0.0.dev47__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.
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/PKG-INFO +3 -3
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/pyproject.toml +3 -3
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/PyLinks.egg-info/PKG-INFO +3 -3
- pylinks-0.0.0.dev47/src/PyLinks.egg-info/requires.txt +3 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/api/github.py +26 -11
- pylinks-0.0.0.dev45/src/PyLinks.egg-info/requires.txt +0 -3
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/README.md +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/setup.cfg +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/PyLinks.egg-info/SOURCES.txt +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/PyLinks.egg-info/dependency_links.txt +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/PyLinks.egg-info/not-zip-safe +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/PyLinks.egg-info/top_level.txt +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/__init__.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/_settings.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/api/__init__.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/api/doi.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/api/orcid.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/api/zenodo.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/exception/__init__.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/exception/api.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/exception/base.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/exception/media_type.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/exception/uri.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/http.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/media_type.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/__init__.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/binder.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/conda.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/github.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/lib_io.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/pypi.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/site/readthedocs.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/string.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/uri/__init__.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/uri/data.py +0 -0
- {pylinks-0.0.0.dev45 → pylinks-0.0.0.dev47}/src/pylinks/url.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyLinks
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev47
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
5
|
Requires-Dist: requests<3,>=2.31.0
|
|
6
|
-
Requires-Dist: ExceptionMan==0.0.0.
|
|
7
|
-
Requires-Dist: MDit==0.0.0.
|
|
6
|
+
Requires-Dist: ExceptionMan==0.0.0.dev34
|
|
7
|
+
Requires-Dist: MDit==0.0.0.dev34
|
|
@@ -17,12 +17,12 @@ namespaces = true
|
|
|
17
17
|
# ----------------------------------------- Project Metadata -------------------------------------
|
|
18
18
|
#
|
|
19
19
|
[project]
|
|
20
|
-
version = "0.0.0.
|
|
20
|
+
version = "0.0.0.dev47"
|
|
21
21
|
name = "PyLinks"
|
|
22
22
|
dependencies = [
|
|
23
23
|
"requests >= 2.31.0, < 3",
|
|
24
|
-
"ExceptionMan == 0.0.0.
|
|
25
|
-
"MDit == 0.0.0.
|
|
24
|
+
"ExceptionMan == 0.0.0.dev34",
|
|
25
|
+
"MDit == 0.0.0.dev34",
|
|
26
26
|
]
|
|
27
27
|
requires-python = ">=3.10"
|
|
28
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyLinks
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev47
|
|
4
4
|
Requires-Python: >=3.10
|
|
5
5
|
Requires-Dist: requests<3,>=2.31.0
|
|
6
|
-
Requires-Dist: ExceptionMan==0.0.0.
|
|
7
|
-
Requires-Dist: MDit==0.0.0.
|
|
6
|
+
Requires-Dist: ExceptionMan==0.0.0.dev34
|
|
7
|
+
Requires-Dist: MDit==0.0.0.dev34
|
|
@@ -166,6 +166,16 @@ class Repo:
|
|
|
166
166
|
endpoint=endpoint
|
|
167
167
|
)
|
|
168
168
|
|
|
169
|
+
def _graphql_query(
|
|
170
|
+
self,
|
|
171
|
+
payload: str,
|
|
172
|
+
extra_headers: dict | None = None,
|
|
173
|
+
) -> dict:
|
|
174
|
+
return self._github.graphql_query(
|
|
175
|
+
query=f'repository(name: "{self._name}", owner: "{self._username}") {{{payload}}}',
|
|
176
|
+
extra_headers=extra_headers,
|
|
177
|
+
)["repository"]
|
|
178
|
+
|
|
169
179
|
@property
|
|
170
180
|
def username(self) -> str:
|
|
171
181
|
return self._username
|
|
@@ -412,13 +422,9 @@ class Repo:
|
|
|
412
422
|
- [GitHub Docs](https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions)
|
|
413
423
|
-
|
|
414
424
|
"""
|
|
415
|
-
payload = "
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
discussions = [
|
|
419
|
-
entry["node"]
|
|
420
|
-
for entry in data["repository"]["discussionCategories"]["edges"]
|
|
421
|
-
]
|
|
425
|
+
payload = "discussionCategories(first: 100) {edges {node {name, slug, id}}}"
|
|
426
|
+
data = self._graphql_query(payload)
|
|
427
|
+
discussions = [entry["node"] for entry in data["discussionCategories"]["edges"]]
|
|
422
428
|
return discussions
|
|
423
429
|
|
|
424
430
|
def issue(self, number: int) -> dict:
|
|
@@ -610,7 +616,12 @@ class Repo:
|
|
|
610
616
|
"""
|
|
611
617
|
return self._rest_query(f"pulls/{number}")
|
|
612
618
|
|
|
613
|
-
def pull_commits(
|
|
619
|
+
def pull_commits(
|
|
620
|
+
self,
|
|
621
|
+
number: int,
|
|
622
|
+
count: int = 0,
|
|
623
|
+
sort: Literal["first", "last"] = "last",
|
|
624
|
+
) -> list[dict]:
|
|
614
625
|
"""
|
|
615
626
|
Get a list of commits for a pull request.
|
|
616
627
|
|
|
@@ -629,6 +640,9 @@ class Repo:
|
|
|
629
640
|
----------
|
|
630
641
|
- [GitHub API Docs](https://docs.github.com/en/rest/pulls/commits?apiVersion=2022-11-28#list-commits-on-a-pull-request)
|
|
631
642
|
"""
|
|
643
|
+
payload = f"pullRequest(number: {number})"
|
|
644
|
+
commits = "{{commits()"
|
|
645
|
+
|
|
632
646
|
commits = []
|
|
633
647
|
page = 1
|
|
634
648
|
while True:
|
|
@@ -639,6 +653,8 @@ class Repo:
|
|
|
639
653
|
break
|
|
640
654
|
return commits
|
|
641
655
|
|
|
656
|
+
|
|
657
|
+
|
|
642
658
|
def pull_create(
|
|
643
659
|
self,
|
|
644
660
|
head: str,
|
|
@@ -1683,9 +1699,8 @@ class Repo:
|
|
|
1683
1699
|
----------
|
|
1684
1700
|
- [GitHub API Docs](https://docs.github.com/en/graphql/reference/objects#branchprotectionruleconnection)
|
|
1685
1701
|
"""
|
|
1686
|
-
payload = "
|
|
1687
|
-
|
|
1688
|
-
data = self._github.graphql_query(query)
|
|
1702
|
+
payload = "branchProtectionRules(first: 100) {nodes {id, pattern}}"
|
|
1703
|
+
data = self._graphql_query(payload)
|
|
1689
1704
|
return data["repository"]["branchProtectionRules"]["nodes"]
|
|
1690
1705
|
|
|
1691
1706
|
def branch_protection_rule_create(
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|