PyLinks 0.0.0.dev43__tar.gz → 0.0.0.dev45__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.dev43 → pylinks-0.0.0.dev45}/PKG-INFO +3 -3
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/pyproject.toml +3 -3
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/PyLinks.egg-info/PKG-INFO +3 -3
- pylinks-0.0.0.dev45/src/PyLinks.egg-info/requires.txt +3 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/api/github.py +37 -5
- pylinks-0.0.0.dev43/src/PyLinks.egg-info/requires.txt +0 -3
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/README.md +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/setup.cfg +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/PyLinks.egg-info/SOURCES.txt +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/PyLinks.egg-info/dependency_links.txt +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/PyLinks.egg-info/not-zip-safe +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/PyLinks.egg-info/top_level.txt +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/__init__.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/_settings.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/api/__init__.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/api/doi.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/api/orcid.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/api/zenodo.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/exception/__init__.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/exception/api.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/exception/base.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/exception/media_type.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/exception/uri.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/http.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/media_type.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/__init__.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/binder.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/conda.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/github.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/lib_io.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/pypi.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/site/readthedocs.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/string.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/uri/__init__.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/src/pylinks/uri/data.py +0 -0
- {pylinks-0.0.0.dev43 → pylinks-0.0.0.dev45}/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.dev45
|
|
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.dev32
|
|
7
|
+
Requires-Dist: MDit==0.0.0.dev32
|
|
@@ -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.dev45"
|
|
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.dev32",
|
|
25
|
+
"MDit == 0.0.0.dev32",
|
|
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.dev45
|
|
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.dev32
|
|
7
|
+
Requires-Dist: MDit==0.0.0.dev32
|
|
@@ -31,6 +31,10 @@ class GitHub:
|
|
|
31
31
|
def user(self, username) -> "User":
|
|
32
32
|
return User(username=username, token=self._token)
|
|
33
33
|
|
|
34
|
+
def user_from_id(self, user_id) -> "User":
|
|
35
|
+
user_data = self.rest_query(f"user/{user_id}")
|
|
36
|
+
return User(username=user_data["login"], token=self._token)
|
|
37
|
+
|
|
34
38
|
def graphql_query(
|
|
35
39
|
self,
|
|
36
40
|
query: str,
|
|
@@ -606,6 +610,35 @@ class Repo:
|
|
|
606
610
|
"""
|
|
607
611
|
return self._rest_query(f"pulls/{number}")
|
|
608
612
|
|
|
613
|
+
def pull_commits(self, number: int) -> list[dict]:
|
|
614
|
+
"""
|
|
615
|
+
Get a list of commits for a pull request.
|
|
616
|
+
|
|
617
|
+
Parameters
|
|
618
|
+
----------
|
|
619
|
+
number : int
|
|
620
|
+
Pull request number.
|
|
621
|
+
|
|
622
|
+
Returns
|
|
623
|
+
-------
|
|
624
|
+
list[dict]
|
|
625
|
+
A list of commits as dictionaries.
|
|
626
|
+
Commits are ordered by ascending commit date.
|
|
627
|
+
|
|
628
|
+
References
|
|
629
|
+
----------
|
|
630
|
+
- [GitHub API Docs](https://docs.github.com/en/rest/pulls/commits?apiVersion=2022-11-28#list-commits-on-a-pull-request)
|
|
631
|
+
"""
|
|
632
|
+
commits = []
|
|
633
|
+
page = 1
|
|
634
|
+
while True:
|
|
635
|
+
response = self._rest_query(f"pulls/{number}/commits?per_page=100&page={page}")
|
|
636
|
+
commits.extend(response)
|
|
637
|
+
page += 1
|
|
638
|
+
if len(response) < 100:
|
|
639
|
+
break
|
|
640
|
+
return commits
|
|
641
|
+
|
|
609
642
|
def pull_create(
|
|
610
643
|
self,
|
|
611
644
|
head: str,
|
|
@@ -1009,8 +1042,7 @@ class Repo:
|
|
|
1009
1042
|
generate_release_notes: bool = False,
|
|
1010
1043
|
make_latest: Literal['true', 'false', 'legacy'] = 'true'
|
|
1011
1044
|
):
|
|
1012
|
-
"""
|
|
1013
|
-
Create a new release.
|
|
1045
|
+
"""Create a new release.
|
|
1014
1046
|
|
|
1015
1047
|
Parameters
|
|
1016
1048
|
----------
|
|
@@ -1068,10 +1100,10 @@ class Repo:
|
|
|
1068
1100
|
release_id: int,
|
|
1069
1101
|
filepath: str | Path,
|
|
1070
1102
|
mime_type: str = "",
|
|
1103
|
+
name: str = "",
|
|
1071
1104
|
label: str = "",
|
|
1072
1105
|
) -> dict:
|
|
1073
|
-
"""
|
|
1074
|
-
Upload a file as an asset to a release.
|
|
1106
|
+
"""Upload a file as an asset to a release.
|
|
1075
1107
|
|
|
1076
1108
|
Parameters
|
|
1077
1109
|
----------
|
|
@@ -1099,7 +1131,7 @@ class Repo:
|
|
|
1099
1131
|
f"Could not guess MIME type of file '{filepath}'. Please provide it as input argument."
|
|
1100
1132
|
)
|
|
1101
1133
|
headers = {"Content-Type": mime_type}
|
|
1102
|
-
query = f"releases/{release_id}/assets?name={filepath.name}"
|
|
1134
|
+
query = f"releases/{release_id}/assets?name={name or filepath.name}"
|
|
1103
1135
|
if label:
|
|
1104
1136
|
query += f"&label={label}"
|
|
1105
1137
|
return self._rest_query(
|
|
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
|