feat: add project structure and dependency management
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 3s
Auto Changelog & Release / release (push) Has been skipped
Build and Publish nightly package / build-and-publish (push) Successful in 26s
Auto Changelog & Release / changelog-only (push) Successful in 1m14s

- Initialize project with Poetry for dependency management
- Add pyproject.toml and poetry.lock for package configuration
- Refactor existing code into a modular structure under `src/ait`
- Define `ait` as a script entry point for execution
This commit is contained in:
2025-05-24 12:55:36 +02:00
parent 579c70b784
commit a9ed247cb4
5 changed files with 1161 additions and 3 deletions

1133
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

21
pyproject.toml Normal file
View File

@@ -0,0 +1,21 @@
[tool.poetry]
name = "ait"
version = "0.1.0"
description = "This script uses the OpenAI API to generate text based on the outputs of git diff and git log commands. It can be particularly useful for creating pull request descriptions, commit messages, or any other narrative that requires summarizing changes between different branches or commits in a Git repository."
authors = ["Max P. <Mail@0xMax42.io>"]
readme = "README.md"
packages = [{ include = "ait", from = "src" }]
[tool.poetry.dependencies]
python = ">=3.12"
openai = "^1.82.0"
[tool.poetry.scripts]
ait = "ait.__main__:main"
[build-system]
requires = ["poetry-core>=2.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.group.dev.dependencies]
twine = "^6.1.0"

0
src/ait/__init__.py Normal file
View File

4
src/ait/__main__.py Normal file
View File

@@ -0,0 +1,4 @@
from ait.ait import main
if __name__ == "__main__":
main()

View File

@@ -106,11 +106,11 @@ def generate_text_from_git_data(diff_output, log_output, system_prompt, user_pro
) )
# Extract and return the generated text # Extract and return the generated text
generated_text = response.choices[0].message.content.strip() generated_text = response.choices[0].message.content.strip() # type: ignore
return generated_text return generated_text
if __name__ == "__main__": def main():
# Default configuration file path # Default configuration file path
default_config_path = "ait.config.json" default_config_path = "ait.config.json"
# Parse command-line arguments # Parse command-line arguments