Skip to content

Commit

Permalink
Initialize the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
fairyshine committed Sep 14, 2024
1 parent 014f133 commit 2617fc0
Show file tree
Hide file tree
Showing 15 changed files with 281 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: documentation
on:
push:
branches:
- main

env:
PYTHON_VERSION: 3.10.14

permissions:
contents: write
id-token: write
pages: write

jobs:
documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python runtime
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
- name: Set up build cache
uses: actions/cache/restore@v4
with:
key: mkdocs-material-${{ hashfiles('.cache/**') }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install Python dependencies
run: |
pip install mkdocs-material
pip install "mkdocstrings[python]"
- name: Build documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
mkdocs build --clean
mkdocs --version
- name: Adjust permissions
run: |
chmod -c -R +rX site/ | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

- name: Save build cache
uses: actions/cache/save@v4
with:
key: mkdocs-material-${{ hashfiles('.cache/**') }}
path: .cache
39 changes: 39 additions & 0 deletions .github/workflows/publish_PYPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: publish python package to PyPI

on:
release:
types: [published]

jobs:
build_wheels:
name: Build wheels
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@master

- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.10.14

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: publish to PYPI
uses: pypa/gh-action-pypi-publish@v1.8.12
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/publish_TESTPYPI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish python package to PyPI

on:
push:
# Alternative: only build for tags.
tags:
- 'v*'
jobs:
build_wheels:
name: Build wheels
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@master

- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.10.14

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: publish to Test PYPI
uses: pypa/gh-action-pypi-publish@v1.8.12
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN }}
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include *.md
include asset/*
recursive-include *.cpp *.c *.hpp *.h
recursive-include *.py *.csv *.json *.txt *.cpp *.hpp *.h

exclude data/*

global-exclude .DS_Store
global-exclude *.pyc
Binary file added asset/FMA_social_preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/Documentation/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file added docs/HOME/ABOUT.md
Empty file.
Empty file.
Empty file added docs/Quick_Start/user_guide.md
Empty file.
Empty file added docs/Tutorial/tutorial.md
Empty file.
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 🔧 FastMindAPI
59 changes: 59 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Project information
site_name: FastMindAPI

# Repository
repo_name: fairyshine/FastMindAPI
repo_url: https://github.com/fairyshine/FastMindAPI

# Configuration
theme:
name: "material"
features:
- navigation.tabs # 页面上方的导航栏
- navigation.instant # 现在页面不会跳转,而是类似单页应用,搜索和各种跳转都是在当前页面完成,对美观有很大帮助
- navigation.tracking # 页面滚动时,导航栏高亮当前页面
- navigation.sections # 使导航栏分块
- navigation.expand # 默认展开导航
- navigation.prune # 只渲染当前页面的导航
- toc.follow # 滚动的时候侧边栏自动跟随
- navigation.top # 返回顶部按钮
- search.suggest # 补全建议
- search.highlight # 搜索结果高亮
- search.share # 搜索结果分享
- navigation.footer # 页脚提示下一章
- content.code.copy # 代码段上的赋值按钮
icon:
logo: material/tools
palette:
# Palette toggle for light mode
- scheme: default
primary: deep purple
accent: purple
toggle:
icon: material/weather-night
name: Switch to dark mode

# Palette toggle for dark mode
- scheme: slate
primary: deep purple
accent: purple
toggle:
icon: material/weather-sunny
name: Switch to light mode

plugins:
- mkdocstrings:
handlers:
python:
paths: [src]
- search # built-in 搜索插件

nav:
- Home:
- index.md
- ABOUT: HOME/ABOUT.md
- Quick Start:
- Installation: Quick_Start/installation.md
- User Guide: Quick_Start/user_guide.md
- Tutorial: Tutorial/tutorial.md
- Documentation: Documentation/API.md
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[build-system]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "fastmindapi"
description = "An easy-to-use, high-performance(?) backend for serving LLMs and other AI models, built on FastAPI."
dynamic = ["version", "dependencies"]
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [
{ name = "Mengsong Wu", email = "radi.cat@qq.com" },
]
maintainers = [
{ name = "Mengsong Wu", email = "radi.cat@qq.com" },
]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.packages.find]
where = ["src"]
include = ["fastmindapi"]

[tool.setuptools_scm]

[project.urls]
"Homepage" = "https://github.com/fairyshine/FastMindAPI/"
"Bug Tracker" = "https://github.com/fairyshine/FastMindAPI/issues"
"Source" = "https://github.com/fairyshine/FastMindAPI"
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pydantic
uvicorn
fastapi
rich
25 changes: 25 additions & 0 deletions src/fastmindapi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Python Package named ToolAgent (A Highly-Modularized Tool Learning Framework for LLM Based Agent)"""

from importlib.metadata import PackageNotFoundError
from importlib.metadata import version

# from fastmindapi.utils.config import get_config
# from fastmindapi.utils.logging import get_logger

__all__ = [
"__version__",
# "config",
# "logger"
]

# Official PEP 396
try:
__version__ = version("fastmindapi")
except PackageNotFoundError:
__version__ = "unknown version"

# config = get_config()
# logger = get_logger()


# logger.info("FastMindAPI (FM) initialization is completed.")

0 comments on commit 2617fc0

Please sign in to comment.