Skip to content

Instantly share code, notes, and snippets.

@nathanjmcdougall
nathanjmcdougall / merge.py
Last active December 22, 2024 01:36
Mergeable pydantic models
from __future__ import annotations
from typing import Self, TypeVar, cast
import pandas as pd
from pydantic import BaseModel
class MergeIncompatibleError(Exception):
"""Raised when two models have conflicting attributes when trying to merge them."""
@nathanjmcdougall
nathanjmcdougall / release.yml
Created December 11, 2024 02:19
Example release.yml using uv
name: Release to PyPI
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
permissions: