Skip to content

Commit b81bb01

Browse files
Enhance project configuration and add CI for PyPI publishing
- Updated `pyproject.toml` to include build system requirements and dynamic versioning. - Expanded project description and added classifiers for better package metadata. - Introduced a new GitHub Actions workflow for automated publishing to PyPI on version tags. - Added version management in `__init__.py` to handle version retrieval gracefully.
1 parent 0993f72 commit b81bb01

3 files changed

Lines changed: 70 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish PyPi
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
pypi-publish:
11+
name: Upload to PyPI
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write # For PyPI's trusted publishing
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
with:
19+
fetch-depth: 0
20+
21+
- name: "Install uv"
22+
uses: astral-sh/setup-uv@v6
23+
24+
- name: Build
25+
run: uv build
26+
27+
- name: Publish to PyPi
28+
run: uv publish -v dist/*

openfox/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
try:
2+
from ._version import version as __version__ # pyright: ignore[reportMissingImports]
3+
except ImportError:
4+
try:
5+
from importlib.metadata import version as _pkg_version
6+
7+
__version__ = _pkg_version("openfox")
8+
except Exception:
9+
__version__ = "0+unknown"

pyproject.toml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1+
[build-system]
2+
requires = ["setuptools>=80", "setuptools-scm>=10.0.5"]
3+
build-backend = "setuptools.build_meta"
4+
15
[project]
26
name = "openfox"
3-
version = "0.1.0"
4-
description = "Add your description here"
7+
dynamic = ["version"]
8+
description = "Self-hosted personal AI assistant with Feishu integration, a built-in web console, and LiteLLM multi-model support."
59
readme = "README.md"
610
requires-python = ">=3.12"
11+
classifiers = [
12+
"Development Status :: 3 - Alpha",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: Apache Software License",
15+
"Operating System :: OS Independent",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3 :: Only",
20+
"Typing :: Typed",
21+
]
722
dependencies = [
823
"agno[scheduler]>=2.5.17",
924
"aiosqlite>=0.22.1",
@@ -36,3 +51,19 @@ dependencies = [
3651
"wikipedia>=1.4.0",
3752
"youtube-transcript-api>=1.2.4",
3853
]
54+
55+
[project.urls]
56+
Homepage = "https://github.com/InfernalAzazel/openfox"
57+
Repository = "https://github.com/InfernalAzazel/openfox"
58+
Issues = "https://github.com/InfernalAzazel/openfox/issues"
59+
60+
[dependency-groups]
61+
dev = [
62+
"setuptools-scm>=10.0.5",
63+
]
64+
65+
[tool.setuptools_scm]
66+
version_file = "openfox/_version.py"
67+
68+
[tool.hatch.build.targets.wheel]
69+
packages = ["openfox"]

0 commit comments

Comments
 (0)