Skip to content

Commit a23ab49

Browse files
committed
Refactor APIClient to include repo details in file generation request
1 parent 2ef4225 commit a23ab49

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include penify_hook/*.py

penify_hook/api_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ def get_supported_file_types(self) -> list[str]:
100100
return ["py", "js", "ts", "java", "kt", "cs", "c"]
101101

102102
def generate_commit_summary(self, git_diff, instruction: str = "", repo_details = None):
103+
"""
104+
Generates a commit summary by sending a POST request to the API endpoint.
105+
106+
Args:
107+
git_diff (str): The git diff of the commit.
108+
instruction (str, optional): Additional instruction for the commit. Defaults to "".
109+
repo_details (dict, optional): Details of the git repository. Defaults to None.
110+
111+
Returns:
112+
dict: The response from the API if the request is successful, None otherwise.
113+
"""
103114
payload = {
104115
'git_diff': git_diff,
105116
'additional_instruction': instruction

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
setup(
44
name="penify-cli",
5-
version="0.1.0",
6-
packages=find_packages(),
5+
version="0.1.1", # Increment the version number
6+
packages=['penify_hook'], # Explicitly include the penify_hook package
77
install_requires=[
88
"requests",
99
"tqdm",
@@ -26,4 +26,4 @@
2626
"Operating System :: OS Independent",
2727
],
2828
python_requires='>=3.6',
29-
)
29+
)

0 commit comments

Comments
 (0)