Add .gitignore and pyproject.toml (#1)

### Findings and Changes

#### Changes:
- **Added **: Included a standard Python  to avoid tracking unnecessary files (e.g., , , ).
- **Added **: Prepared the project for better dependency management.
- **Enhanced Gitea Tools**:
    - Implemented  in .
    - Implemented  (via ) in .

#### Implementation Details:
- Used the Gitea API to programmatically create a new branch and commit files directly from a script.
- Verified that the NAME:
   tea - command line tool to interact with Gitea

USAGE:
   tea [global options] [command [command options]]

VERSION:
   Version: 0.14.1  golang: 1.26.3  go-sdk: v0.25.1

DESCRIPTION:
   tea is a productivity helper for Gitea. It can be used to manage most entities on
   one or multiple Gitea instances & provides local helpers like 'tea pr checkout'.

   tea tries to make use of context provided by the repository in $PWD if available.
   tea works best in a upstream/fork workflow, when the local main branch tracks the
   upstream repo. tea assumes that local git state is published on the remote before
   doing operations with tea.    Configuration is persisted in $XDG_CONFIG_HOME/tea.

COMMANDS:
   help, h  Shows a list of commands or help for one command

   ENTITIES:
     issues, issue, i                  List, create and update issues
     pulls, pull, pr                   Manage and checkout pull requests
     labels, label                     Manage issue labels
     milestones, milestone, ms         List and create milestones
     releases, release, r              Manage releases
     times, time, t                    Operate on tracked times of a repository's issues & pulls
     organizations, organization, org  List, create, delete organizations
     repos, repo                       Manage repositories
     branches, branch, b               Consult branches
     actions, action                   Manage repository actions
     webhooks, webhook, hooks, hook    Manage webhooks
     comment, c                        Add a comment to an issue / pr

   HELPERS:
     open, o                         Open something of the repository in web browser
     notifications, notification, n  Show notifications
     clone, C                        Clone a repository locally
     api                             Make an authenticated API request

   MISCELLANEOUS:
     whoami    Show current logged in user
     admin, a  Operations requiring admin access on the Gitea instance

   SETUP:
     logins, login      Log in to a Gitea server
     logout             Log out from a Gitea server
     ssh-keys, ssh-key  Manage SSH public keys

GLOBAL OPTIONS:
   --debug, --vvv  Enable debug mode
   --help, -h      show help
   --version, -v   print the version CLI can be used for automated PR creation.
- Successfully configured Git user identity and remote tracking in the environment.

---------

Co-authored-by: Michael <michael@example.com>
Reviewed-on: #1
This commit is contained in:
2026-06-28 18:38:28 +02:00
parent ac6cff52dd
commit 0461c6c7ab
40 changed files with 4950 additions and 1 deletions
+112
View File
@@ -0,0 +1,112 @@
"""Pydantic models for Gitea API entities."""
from typing import Optional, Any
from pydantic import BaseModel, Field, field_validator
class UserModel(BaseModel):
login: str = ""
id: int = 0
avatar_url: Optional[str] = None
html_url: Optional[str] = None
full_name: Optional[str] = None
email: Optional[str] = None
username: Optional[str] = None
class LabelModel(BaseModel):
id: int = 0
name: str = ""
color: Optional[str] = None
description: Optional[str] = None
class RepositoryModel(BaseModel):
id: int = 0
name: str = ""
full_name: str = ""
owner: str = ""
html_url: Optional[str] = None
description: Optional[str] = None
mirror: bool = False
private: bool = False
fork: bool = False
parent: Optional["RepositoryModel"] = None
empty: Optional[bool] = None
@field_validator("owner", mode="before")
@classmethod
def validate_owner(cls, v):
if isinstance(v, dict):
return v.get("login", "")
return v
class IssueModel(BaseModel):
id: int = 0
number: int = 0
title: str = ""
body: Optional[str] = None
state: str = ""
user: UserModel = Field(default_factory=UserModel)
assignee: Optional[UserModel] = None
labels: list[LabelModel] = Field(default_factory=list)
created_at: Optional[str] = None
updated_at: Optional[str] = None
closed_at: Optional[str] = None
repository: Optional[RepositoryModel] = None
comments: int = 0
class PullRequestModel(BaseModel):
id: int = 0
number: int = 0
title: str = ""
body: Optional[str] = None
state: str = ""
user: UserModel = Field(default_factory=UserModel)
assignee: Optional[UserModel] = None
created_at: Optional[str] = None
updated_at: Optional[str] = None
closed_at: Optional[str] = None
merged_at: Optional[str] = None
head: dict[str, Any] = Field(default_factory=dict)
base: dict[str, Any] = Field(default_factory=dict)
repository: Optional[RepositoryModel] = None
comments: int = 0
comments_url: Optional[str] = None
diff_url: Optional[str] = None
patch_url: Optional[str] = None
html_url: Optional[str] = None
merged: bool = False
class CommentModel(BaseModel):
id: int = 0
body: str = ""
user: UserModel = Field(default_factory=UserModel)
created_at: Optional[str] = None
updated_at: Optional[str] = None
pull_request_url: Optional[str] = None
class PullRequestFileModel(BaseModel):
filename: str = ""
status: str = ""
additions: int = 0
deletions: int = 0
changes: int = 0
blob_url: Optional[str] = None
raw_url: Optional[str] = None
patch: Optional[str] = None
class GiteaConfig(BaseModel):
model_config = {"extra": "allow", "populate_by_name": True}
base_url: str
token: str
repos_root: str
model_id: str = "qwen/qwen3.6-35b-a3b"
max_retries: int = 2