gpt-pr 0.5.0__py3-none-any.whl → 0.6.0__py3-none-any.whl
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.
Potentially problematic release.
This version of gpt-pr might be problematic. Click here for more details.
- {gpt_pr-0.5.0.dist-info → gpt_pr-0.6.0.dist-info}/METADATA +1 -1
- gpt_pr-0.6.0.dist-info/RECORD +17 -0
- gptpr/config.py +5 -1
- gptpr/gh.py +1 -1
- gptpr/prdata.py +11 -2
- gptpr/test_config.py +2 -0
- gptpr/version.py +1 -1
- gpt_pr-0.5.0.dist-info/RECORD +0 -17
- {gpt_pr-0.5.0.dist-info → gpt_pr-0.6.0.dist-info}/WHEEL +0 -0
- {gpt_pr-0.5.0.dist-info → gpt_pr-0.6.0.dist-info}/entry_points.txt +0 -0
- {gpt_pr-0.5.0.dist-info → gpt_pr-0.6.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
gptpr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
gptpr/checkversion.py,sha256=PmbGiYJelecs1Fv2aAZwdr6wn-qDC826nsYI4A6LLvk,2389
|
|
3
|
+
gptpr/config.py,sha256=jOr95rErnk-MByWtC92bpgY2dyVc6bbrjaVoP61oO-s,2822
|
|
4
|
+
gptpr/consolecolor.py,sha256=_JmBMNjIflWMlgP2VkCWu6uQLR9oHBy52uV3TRJJgF4,800
|
|
5
|
+
gptpr/gh.py,sha256=E03xg8UHfZlHJAY-aAYphpgS3xl-FZ2dmI5oBC2XdoA,1136
|
|
6
|
+
gptpr/gitutil.py,sha256=NBD3iRnbFEPRU47w7c5TowwtZieDYkU4zybvv0PoOU0,5783
|
|
7
|
+
gptpr/main.py,sha256=gen_8YXYAUJU0BpzULZ28j9Br6Y9PTqTr9JEm4nwsJI,2694
|
|
8
|
+
gptpr/prdata.py,sha256=Uls18CtkxWlflfHKrB62hT21MTUVabf8JgJ6CxOOccQ,7053
|
|
9
|
+
gptpr/test_checkversion.py,sha256=WtJ3v4MMkFG0Kob0R1wi_nwVhcQFd4mXtKCKZHajEhM,4266
|
|
10
|
+
gptpr/test_config.py,sha256=iL3b-Ypv1TaMQTFb6mrDKw8fPio3WBpMcaFkWbiLdNQ,3369
|
|
11
|
+
gptpr/test_prdata.py,sha256=rSJ-yqOdw-iYdBWyqnA2SXbdrhT8KgIkRTTf9SY1S1g,474
|
|
12
|
+
gptpr/version.py,sha256=cID1jLnC_vj48GgMN6Yb1FA3JsQ95zNmCHmRYE8TFhY,22
|
|
13
|
+
gpt_pr-0.6.0.dist-info/METADATA,sha256=icdIGcBPO4a9U8vYfbR36tKdcKHPo0hfmBpTMimhKv0,2638
|
|
14
|
+
gpt_pr-0.6.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
15
|
+
gpt_pr-0.6.0.dist-info/entry_points.txt,sha256=WhcbcQXqo5-IGliYWiYMhop4-Wm7bcH2ljFKLWrmO7c,81
|
|
16
|
+
gpt_pr-0.6.0.dist-info/top_level.txt,sha256=DZcbzlsjh4BD8njGcvhOeCZ83U_oYWgCn0w8qx5--04,6
|
|
17
|
+
gpt_pr-0.6.0.dist-info/RECORD,,
|
gptpr/config.py
CHANGED
|
@@ -7,7 +7,8 @@ def config_command_example(name, value_sample):
|
|
|
7
7
|
return f'gpt-pr-config set {name} {value_sample}'
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
CONFIG_PROJECT_REPO_URL = 'https://github.com/alissonperez/gpt-pr'
|
|
11
|
+
CONFIG_README_SECTION = f'{CONFIG_PROJECT_REPO_URL}?tab=readme-ov-file#configuration'
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class Config:
|
|
@@ -15,6 +16,9 @@ class Config:
|
|
|
15
16
|
config_filename = '.gpt-pr.ini'
|
|
16
17
|
|
|
17
18
|
_default_config = {
|
|
19
|
+
# Amenities
|
|
20
|
+
'ADD_TOOL_SIGNATURE': 'true', # Add GPT-PR signature to PRs
|
|
21
|
+
|
|
18
22
|
# Github
|
|
19
23
|
'GH_TOKEN': '',
|
|
20
24
|
|
gptpr/gh.py
CHANGED
|
@@ -30,7 +30,7 @@ def create_pr(pr_data, yield_confirmation):
|
|
|
30
30
|
default=True).execute()
|
|
31
31
|
|
|
32
32
|
if pr_confirmation:
|
|
33
|
-
pr = repo.create_pull(title=pr_data.title, body=pr_data.
|
|
33
|
+
pr = repo.create_pull(title=pr_data.title, body=pr_data.create_body(),
|
|
34
34
|
head=pr_data.branch_info.branch, base=pr_data.branch_info.base_branch)
|
|
35
35
|
print("Pull request created successfully: ", pr.html_url)
|
|
36
36
|
else:
|
gptpr/prdata.py
CHANGED
|
@@ -4,7 +4,7 @@ import os
|
|
|
4
4
|
from openai import OpenAI
|
|
5
5
|
|
|
6
6
|
from gptpr.gitutil import BranchInfo
|
|
7
|
-
from gptpr.config import config
|
|
7
|
+
from gptpr.config import config, CONFIG_PROJECT_REPO_URL
|
|
8
8
|
import gptpr.consolecolor as cc
|
|
9
9
|
|
|
10
10
|
TOKENIZER_RATIO = 4
|
|
@@ -67,9 +67,18 @@ class PrData():
|
|
|
67
67
|
f'{cc.bold("Title")}: {cc.yellow(self.title)}',
|
|
68
68
|
f'{cc.bold("Branch name")}: {cc.yellow(self.branch_info.branch)}',
|
|
69
69
|
f'{cc.bold("Base branch")}: {cc.yellow(self.branch_info.base_branch)}',
|
|
70
|
-
f'{cc.bold("PR Description")}:\n{self.
|
|
70
|
+
f'{cc.bold("PR Description")}:\n{self.create_body()}',
|
|
71
71
|
])
|
|
72
72
|
|
|
73
|
+
def create_body(self):
|
|
74
|
+
body = self.body
|
|
75
|
+
|
|
76
|
+
if config.get_user_config('ADD_TOOL_SIGNATURE') == 'true':
|
|
77
|
+
pr_signature = f'Generated by [GPT-PR]({CONFIG_PROJECT_REPO_URL})'
|
|
78
|
+
body += '\n\n---\n\n' + pr_signature
|
|
79
|
+
|
|
80
|
+
return body
|
|
81
|
+
|
|
73
82
|
|
|
74
83
|
functions = [
|
|
75
84
|
{
|
gptpr/test_config.py
CHANGED
|
@@ -87,10 +87,12 @@ def test_all_values(temp_config):
|
|
|
87
87
|
all_values = config.all_values()
|
|
88
88
|
|
|
89
89
|
assert all_values == [
|
|
90
|
+
('DEFAULT', 'add_tool_signature', 'true'),
|
|
90
91
|
('DEFAULT', 'gh_token', ''),
|
|
91
92
|
('DEFAULT', 'input_max_tokens', '15000'),
|
|
92
93
|
('DEFAULT', 'openai_model', 'gpt-4o-mini'),
|
|
93
94
|
('DEFAULT', 'openai_api_key', ''),
|
|
95
|
+
('user', 'add_tool_signature', 'true'),
|
|
94
96
|
('user', 'gh_token', ''),
|
|
95
97
|
('user', 'input_max_tokens', '15000'),
|
|
96
98
|
('user', 'openai_model', 'gpt-4o-mini'),
|
gptpr/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.6.0"
|
gpt_pr-0.5.0.dist-info/RECORD
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
gptpr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
gptpr/checkversion.py,sha256=PmbGiYJelecs1Fv2aAZwdr6wn-qDC826nsYI4A6LLvk,2389
|
|
3
|
-
gptpr/config.py,sha256=XwHwveyVmeFoHqHpwZXI2BF1Ac3nT1hnEpclmP2TYhQ,2677
|
|
4
|
-
gptpr/consolecolor.py,sha256=_JmBMNjIflWMlgP2VkCWu6uQLR9oHBy52uV3TRJJgF4,800
|
|
5
|
-
gptpr/gh.py,sha256=uSWY_TzbrAM00neOBkyfV5vxDO4FzMtIrs-Zczp-Tck,1127
|
|
6
|
-
gptpr/gitutil.py,sha256=NBD3iRnbFEPRU47w7c5TowwtZieDYkU4zybvv0PoOU0,5783
|
|
7
|
-
gptpr/main.py,sha256=gen_8YXYAUJU0BpzULZ28j9Br6Y9PTqTr9JEm4nwsJI,2694
|
|
8
|
-
gptpr/prdata.py,sha256=h3RvlfGcAXWUSxy6wfVqem4uxk53gxpvSrmj7xxuYUc,6749
|
|
9
|
-
gptpr/test_checkversion.py,sha256=WtJ3v4MMkFG0Kob0R1wi_nwVhcQFd4mXtKCKZHajEhM,4266
|
|
10
|
-
gptpr/test_config.py,sha256=ucqbj2mbee4fDK1JwXVY_FfnPXMeRA3VMM6m4-x7OTU,3270
|
|
11
|
-
gptpr/test_prdata.py,sha256=rSJ-yqOdw-iYdBWyqnA2SXbdrhT8KgIkRTTf9SY1S1g,474
|
|
12
|
-
gptpr/version.py,sha256=LBK46heutvn3KmsCrKIYu8RQikbfnjZaj2xFrXaeCzQ,22
|
|
13
|
-
gpt_pr-0.5.0.dist-info/METADATA,sha256=Dt_i-Of-R8hHlBDFWGm2rzWij5diWPVE6cT2FKeXd1k,2638
|
|
14
|
-
gpt_pr-0.5.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
15
|
-
gpt_pr-0.5.0.dist-info/entry_points.txt,sha256=WhcbcQXqo5-IGliYWiYMhop4-Wm7bcH2ljFKLWrmO7c,81
|
|
16
|
-
gpt_pr-0.5.0.dist-info/top_level.txt,sha256=DZcbzlsjh4BD8njGcvhOeCZ83U_oYWgCn0w8qx5--04,6
|
|
17
|
-
gpt_pr-0.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|