Spaces:
Paused
Paused
Commit ·
d439f56
1
Parent(s): ebd8962
更新requirements
Browse files- .github/workflows/docker.yaml +0 -60
- .github/workflows/ruff.yaml +0 -30
- .github/workflows/track.yml +0 -71
- LICENSE +0 -21
- requirements.txt +9 -0
.github/workflows/docker.yaml
DELETED
|
@@ -1,60 +0,0 @@
|
|
| 1 |
-
name: Build and Push Docker Image
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
push:
|
| 5 |
-
branches:
|
| 6 |
-
- main
|
| 7 |
-
tags:
|
| 8 |
-
- "v*"
|
| 9 |
-
paths-ignore:
|
| 10 |
-
- "**/*.md"
|
| 11 |
-
- ".github/workflows/ruff.yaml"
|
| 12 |
-
- ".github/workflows/track.yml"
|
| 13 |
-
|
| 14 |
-
env:
|
| 15 |
-
REGISTRY: ghcr.io
|
| 16 |
-
IMAGE_NAME: ${{ github.repository }}
|
| 17 |
-
|
| 18 |
-
jobs:
|
| 19 |
-
build-and-push:
|
| 20 |
-
runs-on: ubuntu-latest
|
| 21 |
-
permissions:
|
| 22 |
-
contents: read
|
| 23 |
-
packages: write
|
| 24 |
-
|
| 25 |
-
steps:
|
| 26 |
-
- name: Checkout repository
|
| 27 |
-
uses: actions/checkout@v4
|
| 28 |
-
|
| 29 |
-
- name: Set up Docker Buildx
|
| 30 |
-
uses: docker/setup-buildx-action@v3
|
| 31 |
-
|
| 32 |
-
- name: Log in to Container Registry
|
| 33 |
-
uses: docker/login-action@v3
|
| 34 |
-
with:
|
| 35 |
-
registry: ${{ env.REGISTRY }}
|
| 36 |
-
username: ${{ github.actor }}
|
| 37 |
-
password: ${{ secrets.GITHUB_TOKEN }}
|
| 38 |
-
|
| 39 |
-
- name: Extract metadata
|
| 40 |
-
id: meta
|
| 41 |
-
uses: docker/metadata-action@v5
|
| 42 |
-
with:
|
| 43 |
-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
| 44 |
-
tags: |
|
| 45 |
-
type=ref,event=branch
|
| 46 |
-
type=semver,pattern={{version}}
|
| 47 |
-
type=semver,pattern={{major}}.{{minor}}
|
| 48 |
-
type=semver,pattern={{major}}
|
| 49 |
-
type=raw,value=latest,enable={{is_default_branch}}
|
| 50 |
-
|
| 51 |
-
- name: Build and push Docker image
|
| 52 |
-
uses: docker/build-push-action@v5
|
| 53 |
-
with:
|
| 54 |
-
context: .
|
| 55 |
-
push: true
|
| 56 |
-
tags: ${{ steps.meta.outputs.tags }}
|
| 57 |
-
labels: ${{ steps.meta.outputs.labels }}
|
| 58 |
-
platforms: linux/amd64,linux/arm64
|
| 59 |
-
cache-from: type=gha
|
| 60 |
-
cache-to: type=gha,mode=max
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/ruff.yaml
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
name: Ruff Lint
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
push:
|
| 5 |
-
branches:
|
| 6 |
-
- main
|
| 7 |
-
pull_request:
|
| 8 |
-
types:
|
| 9 |
-
- opened
|
| 10 |
-
|
| 11 |
-
jobs:
|
| 12 |
-
lint:
|
| 13 |
-
runs-on: ubuntu-latest
|
| 14 |
-
|
| 15 |
-
steps:
|
| 16 |
-
- name: Checkout repository
|
| 17 |
-
uses: actions/checkout@v4
|
| 18 |
-
|
| 19 |
-
- name: Set up Python
|
| 20 |
-
uses: actions/setup-python@v5
|
| 21 |
-
with:
|
| 22 |
-
python-version: "3.12"
|
| 23 |
-
|
| 24 |
-
- name: Install Ruff
|
| 25 |
-
run: |
|
| 26 |
-
python -m pip install --upgrade pip
|
| 27 |
-
pip install "ruff>=0.11.7"
|
| 28 |
-
|
| 29 |
-
- name: Run Ruff
|
| 30 |
-
run: ruff check .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.github/workflows/track.yml
DELETED
|
@@ -1,71 +0,0 @@
|
|
| 1 |
-
name: Update gemini-webapi
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
schedule:
|
| 5 |
-
- cron: "0 0 * * *" # Runs every day at midnight
|
| 6 |
-
workflow_dispatch:
|
| 7 |
-
|
| 8 |
-
jobs:
|
| 9 |
-
update-dep:
|
| 10 |
-
runs-on: ubuntu-latest
|
| 11 |
-
permissions:
|
| 12 |
-
contents: write
|
| 13 |
-
pull-requests: write
|
| 14 |
-
steps:
|
| 15 |
-
- uses: actions/checkout@v4
|
| 16 |
-
|
| 17 |
-
- name: Install uv
|
| 18 |
-
uses: astral-sh/setup-uv@v5
|
| 19 |
-
with:
|
| 20 |
-
version: "latest"
|
| 21 |
-
|
| 22 |
-
- name: Update gemini-webapi
|
| 23 |
-
id: update
|
| 24 |
-
run: |
|
| 25 |
-
# Install dependencies first to enable uv pip show
|
| 26 |
-
uv sync
|
| 27 |
-
|
| 28 |
-
# Get current version of gemini-webapi before upgrade
|
| 29 |
-
OLD_VERSION=$(uv pip show gemini-webapi 2>/dev/null | grep ^Version: | awk '{print $2}')
|
| 30 |
-
if [ -z "$OLD_VERSION" ]; then
|
| 31 |
-
echo "Error: Could not extract current gemini-webapi version" >&2
|
| 32 |
-
exit 1
|
| 33 |
-
fi
|
| 34 |
-
echo "Current gemini-webapi version: $OLD_VERSION"
|
| 35 |
-
|
| 36 |
-
# Update the package using uv, which handles pyproject.toml and uv.lock
|
| 37 |
-
uv add --upgrade gemini-webapi
|
| 38 |
-
|
| 39 |
-
# Get new version of gemini-webapi after upgrade
|
| 40 |
-
NEW_VERSION=$(uv pip show gemini-webapi | grep ^Version: | awk '{print $2}')
|
| 41 |
-
if [ -z "$NEW_VERSION" ]; then
|
| 42 |
-
echo "Error: Could not extract new gemini-webapi version" >&2
|
| 43 |
-
exit 1
|
| 44 |
-
fi
|
| 45 |
-
echo "New gemini-webapi version: $NEW_VERSION"
|
| 46 |
-
|
| 47 |
-
# Only proceed if gemini-webapi version has changed
|
| 48 |
-
if [ "$OLD_VERSION" != "$NEW_VERSION" ]; then
|
| 49 |
-
echo "gemini-webapi has been updated from $OLD_VERSION to $NEW_VERSION"
|
| 50 |
-
echo "updated=true" >> $GITHUB_OUTPUT
|
| 51 |
-
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
| 52 |
-
else
|
| 53 |
-
echo "No updates available for gemini-webapi (version $OLD_VERSION unchanged)"
|
| 54 |
-
echo "updated=false" >> $GITHUB_OUTPUT
|
| 55 |
-
fi
|
| 56 |
-
|
| 57 |
-
- name: Create Pull Request
|
| 58 |
-
if: steps.update.outputs.updated == 'true'
|
| 59 |
-
uses: peter-evans/create-pull-request@v6
|
| 60 |
-
with:
|
| 61 |
-
token: ${{ secrets.GITHUB_TOKEN }}
|
| 62 |
-
commit-message: ":arrow_up: update gemini-webapi to ${{ steps.update.outputs.version }}"
|
| 63 |
-
title: ":arrow_up: update gemini-webapi to ${{ steps.update.outputs.version }}"
|
| 64 |
-
body: |
|
| 65 |
-
Update `gemini-webapi` to version `${{ steps.update.outputs.version }}`.
|
| 66 |
-
|
| 67 |
-
Auto-generated by GitHub Actions using `uv`.
|
| 68 |
-
branch: update-gemini-webapi
|
| 69 |
-
base: main
|
| 70 |
-
delete-branch: true
|
| 71 |
-
labels: dependency, automated
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
MIT License
|
| 2 |
-
|
| 3 |
-
Copyright (c) 2025 Yongkun Li
|
| 4 |
-
|
| 5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
-
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
-
in the Software without restriction, including without limitation the rights
|
| 8 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
-
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
-
furnished to do so, subject to the following conditions:
|
| 11 |
-
|
| 12 |
-
The above copyright notice and this permission notice shall be included in all
|
| 13 |
-
copies or substantial portions of the Software.
|
| 14 |
-
|
| 15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
-
SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi>=0.128.0
|
| 2 |
+
gemini-webapi>=1.18.0
|
| 3 |
+
lmdb>=1.7.5
|
| 4 |
+
loguru>=0.7.3
|
| 5 |
+
orjson>=3.11.7
|
| 6 |
+
pydantic-settings[yaml]>=2.12.0
|
| 7 |
+
uvicorn>=0.40.0
|
| 8 |
+
# uvloop>=0.22.1; sys_platform != 'win32'
|
| 9 |
+
python-multipart
|