Skip to content
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
42 changes: 17 additions & 25 deletions .github/workflows/on-release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,36 @@ on:

jobs:

set-version:
runs-on: ubuntu-24.04
release-note:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Check out
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Export tag
id: vars
run: echo tag=${GITHUB_REF#refs/*/} >> $GITHUB_OUTPUT
if: ${{ github.event_name == 'release' }}
- uses: actions/setup-node@v6
with:
node-version: lts/*

- name: Update project version
run: |
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml
- run: npx changelogithub
continue-on-error: true
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
if: ${{ github.event_name == 'release' }}

- name: Upload updated pyproject.toml
uses: actions/upload-artifact@v4
with:
name: pyproject-toml
path: pyproject.toml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
runs-on: ubuntu-latest
needs: [set-version]
steps:
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up the environment
uses: ./.github/actions/setup-python-env

- name: Download updated pyproject.toml
uses: actions/download-artifact@v4
with:
name: pyproject-toml

- name: Build package
run: uv build

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -209,3 +209,5 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/

_version.py
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "republic"
version = "0.5.8"
dynamic = ["version"]
description = "Build LLM workflows like normal Python while keeping a full audit trail by default."
authors = [
{ name = "Chojan Shang", email = "psiace@apache.org" },
Expand Down Expand Up @@ -59,9 +59,16 @@ dev = [
]

[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"


[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "src/republic/_version.py"

[tool.hatch.build.targets.wheel]
packages = ["src/republic"]

Expand Down
18 changes: 0 additions & 18 deletions src/republic/__about__.py

This file was deleted.

12 changes: 12 additions & 0 deletions src/republic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Republic public API."""

from importlib import import_module
from importlib.metadata import PackageNotFoundError
from importlib.metadata import version as metadata_version

from republic.auth import (
github_copilot_oauth_resolver,
load_openai_codex_oauth_tokens,
Expand Down Expand Up @@ -52,3 +56,11 @@
"tool",
"tool_from_model",
]

try:
__version__ = import_module("republic._version").version
except ModuleNotFoundError:
try:
__version__ = metadata_version("republic")
except PackageNotFoundError:
__version__ = "0.0.0"
3 changes: 2 additions & 1 deletion src/republic/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from collections.abc import Callable
from typing import Any, Literal, cast

from republic.__about__ import DEFAULT_MODEL
from republic.auth import APIKeyResolver
from republic.clients._internal import InternalOps
from republic.clients.chat import ChatClient
Expand Down Expand Up @@ -35,6 +34,8 @@
from republic.tools.executor import ToolExecutor
from republic.tools.schema import ToolInput

DEFAULT_MODEL = "openrouter:free"


class LLM:
"""Developer-first LLM client powered by any-llm."""
Expand Down
1 change: 0 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading