Skip to content

feat: Initial Pydantic processor implementation from original PR #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Publish Release'

on:
push:
tags:
- '*'

env:
PACKAGE_NAME: genai-processors-pydantic

jobs:
publish:
name: Publish Release
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout Source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Install uv and set the python version
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6
with:
enable-cache: true
python-version-file: .python-version

- name: Verify Versions Match
run: |
TAG_VERSION=$(git describe HEAD --tags --abbrev=0)
MODULE_VERSION=$(uv version)
echo "Git Tag Version: $TAG_VERSION"
echo "Python Module Version: $MODULE_VERSION"
if [[ " $PACKAGE_NAME $TAG_VERSION" != "$MODULE_VERSION" ]]; then exit 1; fi
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV

- name: Build Package
run: uv build

# TODO: Update the PyPi token to push to PyPi.
- name: Publish to PyPi
run: uv publish

- name: Release
uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2
with:
discussion_category_name: announcements
generate_release_notes: true
files: |
dist/${{env.PACKAGE_NAME}}-${{env.TAG_VERSION}}.tar.gz
dist/${{env.PACKAGE_NAME}}-${{env.TAG_VERSION}}-py3-none-any.whl
46 changes: 46 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Validation'

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: continuous-integration
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"

steps:
- name: Checkout Source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install uv and set the python version
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6
with:
python-version: ${{ matrix.python-version }}
enable-cache: true

- name: Install the project
run: uv sync --locked --all-extras --all-groups

- name: Run tests
run: uv run poe test

- name: Run security checks
if: matrix.python-version == '3.13'
run: uv run poe security

- name: Codecov
if: matrix.python-version == '3.13'
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ cython_debug/
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

Expand Down
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

fail_fast: false
minimum_pre_commit_version: "4.0.1"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-symlinks
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/PyCQA/bandit
rev: 2d0b675b04c80ae42277e10500db06a0a37bae17 # frozen: 1.8.6
hooks:
- id: bandit
description: 'Bandit is a tool for finding common security issues in Python code'
additional_dependencies: [ "bandit[toml]" ]
args: ["-c", "pyproject.toml"]

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: 3d44372123ca5e8617fdb65d9f11facd159b9e95 # frozen: v0.12.3
hooks:
- id: ruff
args: [ --fix, --exit-non-zero-on-fix ]

- repo: https://github.com/psf/black
rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0
hooks:
- id: black
language_version: python3.13
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
Loading