github_rest_api 0.28.0__tar.gz → 0.29.0__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.
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/.github/workflows/create_pr_dev_to_main.yml +5 -1
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/.github/workflows/create_pr_to_dev.yml +5 -1
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/PKG-INFO +1 -1
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/utils.py +0 -22
- github_rest_api-0.29.0/github_rest_api/utils.py +34 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/pyproject.toml +1 -1
- github_rest_api-0.28.0/.github/pr.py +0 -67
- github_rest_api-0.28.0/github_rest_api/utils.py +0 -12
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/.github/workflows/lint.yml +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/.github/workflows/release.yml +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/.gitignore +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/.gitpod.yml +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/README.md +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/__init__.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/__init__.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/cargo/__init__.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/cargo/benchmark.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/cargo/profiling.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/cargo/utils.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/github.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/tests/__init__.py +0 -0
- {github_rest_api-0.28.0 → github_rest_api-0.29.0}/uv.lock +0 -0
{github_rest_api-0.28.0 → github_rest_api-0.29.0}/.github/workflows/create_pr_dev_to_main.yml
RENAMED
|
@@ -13,5 +13,9 @@ jobs:
|
|
|
13
13
|
- uses: actions/checkout@v6
|
|
14
14
|
- name: Create PR From dev To main
|
|
15
15
|
run: |
|
|
16
|
-
|
|
16
|
+
curl -sSL https://raw.githubusercontent.com/legendu-net/github_actions_scripts/main/create_pull_request.py \
|
|
17
|
+
| uv run --script - \
|
|
18
|
+
--head-branch dev \
|
|
19
|
+
--base-branch main \
|
|
20
|
+
--token ${{ secrets.GITHUBACTIONS }}
|
|
17
21
|
|
|
@@ -15,5 +15,9 @@ jobs:
|
|
|
15
15
|
- uses: actions/checkout@v6
|
|
16
16
|
- name: Create PR to dev
|
|
17
17
|
run: |
|
|
18
|
-
|
|
18
|
+
curl -sSL https://raw.githubusercontent.com/legendu-net/github_actions_scripts/main/create_pull_request.py \
|
|
19
|
+
| uv run --script - \
|
|
20
|
+
--head-branch ${{ github.ref_name }} \
|
|
21
|
+
--base-branch dev \
|
|
22
|
+
--token ${{ secrets.GITHUBACTIONS }}
|
|
19
23
|
|
|
@@ -73,25 +73,3 @@ def commit_profiling(prof_dir: str | Path):
|
|
|
73
73
|
"""
|
|
74
74
|
porcelain.add(paths=prof_dir)
|
|
75
75
|
porcelain.commit(message="Updating profiling results.")
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
def strip_patch_version(version: str) -> str:
|
|
79
|
-
parts = version.split(".")
|
|
80
|
-
match len(parts):
|
|
81
|
-
case 1:
|
|
82
|
-
return parts[0] + ".0.0"
|
|
83
|
-
case 2 | 3:
|
|
84
|
-
return ".".join(parts[:2]) + ".0"
|
|
85
|
-
case _:
|
|
86
|
-
raise ValueError("Invalid version semantic provided!")
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def strip_minor_version(version: str) -> str:
|
|
90
|
-
parts = version.split(".")
|
|
91
|
-
match len(parts):
|
|
92
|
-
case 1:
|
|
93
|
-
return parts[0] + ".0.0"
|
|
94
|
-
case 2 | 3:
|
|
95
|
-
return ".".join(parts[:1]) + ".0.0"
|
|
96
|
-
case _:
|
|
97
|
-
raise ValueError("Invalid version semantic provided!")
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Some generally useful util functions."""
|
|
2
|
+
|
|
3
|
+
from itertools import tee, filterfalse
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def partition(pred, iterable):
|
|
7
|
+
"""Use a predicate to partition entries into true entries and false entries.
|
|
8
|
+
:param pred: A function takes one parameter and return a boolean value.
|
|
9
|
+
:param iterable: An iterable of values to partition.
|
|
10
|
+
"""
|
|
11
|
+
it1, it2 = tee(iterable)
|
|
12
|
+
return filter(pred, it1), filterfalse(pred, it2)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def strip_patch_version(version: str) -> str:
|
|
16
|
+
parts = version.split(".")
|
|
17
|
+
match len(parts):
|
|
18
|
+
case 1:
|
|
19
|
+
return parts[0] + ".0.0"
|
|
20
|
+
case 2 | 3:
|
|
21
|
+
return ".".join(parts[:2]) + ".0"
|
|
22
|
+
case _:
|
|
23
|
+
raise ValueError("Invalid version semantic provided!")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def strip_minor_version(version: str) -> str:
|
|
27
|
+
parts = version.split(".")
|
|
28
|
+
match len(parts):
|
|
29
|
+
case 1:
|
|
30
|
+
return parts[0] + ".0.0"
|
|
31
|
+
case 2 | 3:
|
|
32
|
+
return ".".join(parts[:1]) + ".0.0"
|
|
33
|
+
case _:
|
|
34
|
+
raise ValueError("Invalid version semantic provided!")
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S uv run --script
|
|
2
|
-
#
|
|
3
|
-
# /// script
|
|
4
|
-
# requires-python = ">=3.12"
|
|
5
|
-
# dependencies = [
|
|
6
|
-
# "github-rest-api>=0.25.0",
|
|
7
|
-
# ]
|
|
8
|
-
# ///
|
|
9
|
-
|
|
10
|
-
"""Create a PR from the specified branch to dev.
|
|
11
|
-
The branch is updated (using dev) before creating the PR.
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
from argparse import ArgumentParser, Namespace
|
|
15
|
-
from github_rest_api import Repository
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def parse_args(args=None, namespace=None) -> Namespace:
|
|
19
|
-
"""Parse command-line arguments.
|
|
20
|
-
:param args: The arguments to parse.
|
|
21
|
-
If None, the arguments from command-line are parsed.
|
|
22
|
-
:param namespace: An inital Namespace object.
|
|
23
|
-
:return: A namespace object containing parsed options.
|
|
24
|
-
"""
|
|
25
|
-
parser = ArgumentParser(description="Create pull requests to the dev branch.")
|
|
26
|
-
parser.add_argument(
|
|
27
|
-
"--token",
|
|
28
|
-
dest="token",
|
|
29
|
-
required=True,
|
|
30
|
-
help="The personal access token for authentication.",
|
|
31
|
-
)
|
|
32
|
-
parser.add_argument(
|
|
33
|
-
"--head-branch",
|
|
34
|
-
dest="head_branch",
|
|
35
|
-
required=True,
|
|
36
|
-
help="The head branch containing changes to merge.",
|
|
37
|
-
)
|
|
38
|
-
parser.add_argument(
|
|
39
|
-
"--base-branch",
|
|
40
|
-
dest="base_branch",
|
|
41
|
-
required=True,
|
|
42
|
-
help="The base branch to merge changes into.",
|
|
43
|
-
)
|
|
44
|
-
return parser.parse_args(args=args, namespace=namespace)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def main():
|
|
48
|
-
"""Main entrance of the script,
|
|
49
|
-
which creates a PR from the specified branch to dev.
|
|
50
|
-
The branch is updated (using dev) before creating the PR.
|
|
51
|
-
"""
|
|
52
|
-
args = parse_args()
|
|
53
|
-
# skip branches with the pattern _*
|
|
54
|
-
if args.head_branch.startswith("_"):
|
|
55
|
-
return
|
|
56
|
-
repo = Repository(args.token, "legendu-net/github_rest_api")
|
|
57
|
-
repo.create_pull_request(
|
|
58
|
-
{
|
|
59
|
-
"base": args.base_branch,
|
|
60
|
-
"head": args.head_branch,
|
|
61
|
-
"title": f"Merge {args.head_branch} Into {args.base_branch}",
|
|
62
|
-
},
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if __name__ == "__main__":
|
|
67
|
-
main()
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"""Some generally useful util functions."""
|
|
2
|
-
|
|
3
|
-
from itertools import tee, filterfalse
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def partition(pred, iterable):
|
|
7
|
-
"""Use a predicate to partition entries into true entries and false entries.
|
|
8
|
-
:param pred: A function takes one parameter and return a boolean value.
|
|
9
|
-
:param iterable: An iterable of values to partition.
|
|
10
|
-
"""
|
|
11
|
-
it1, it2 = tee(iterable)
|
|
12
|
-
return filter(pred, it1), filterfalse(pred, it2)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/cargo/benchmark.py
RENAMED
|
File without changes
|
{github_rest_api-0.28.0 → github_rest_api-0.29.0}/github_rest_api/actions/cargo/profiling.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|