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
23 changes: 14 additions & 9 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,33 @@ jobs:
fail-fast: false
matrix:
python-version: [ '3.10', '3.11', '3.12', '3.13' ]
poetry-version: [ '2.1.1' ]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup poetry
uses: abatilo/actions-poetry@v3
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Cache .venv
uses: actions/cache@v4
with:
poetry-version: ${{ matrix.poetry-version }}
path: .venv
key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
venv-${{ runner.os }}-py${{ matrix.python-version }}-
venv-${{ runner.os }}-
- name: UV lock file
run: uv lock
- name: Install platform dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libdbus-1-dev build-essential libpython3-dev freeglut3-dev
- name: Poetry lock file
run: poetry lock
sudo apt install libdbus-1-dev build-essential libpython3-dev freeglut3-dev libxkbcommon-x11-0 libxcb-cursor0 libegl1 libgl1
- name: Install dependencies
run: poetry install
run: uv sync --group dev
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: poetry run pytest -v tests/
run: env QT_DEBUG_PLUGINS=1 uv run pytest -v tests/
25 changes: 15 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
fail-fast: false
matrix:
python-version: [ '3.13' ]
poetry-version: [ '2.1.1' ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -22,16 +21,22 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup poetry
uses: abatilo/actions-poetry@v3
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Cache .venv
uses: actions/cache@v4
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Poetry lock file
run: poetry lock
path: .venv
key: venv-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
venv-${{ runner.os }}-py${{ matrix.python-version }}-
venv-${{ runner.os }}-
- name: UV lock file
run: uv lock
- name: Install dependencies
run: poetry install
run: uv sync --group dev
- name: Build
run: poetry build
run: uv build
- name: Create release
uses: ncipollo/release-action@v1
with:
Expand All @@ -40,5 +45,5 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ FastOCR 是一款开源免费的提供在线 OCR 文字识别的桌面工具
理论上支持但无构建环境,打包过程类似 Windows 如下,生成的文件位于项目的 dist 目录下

```shell
pip install poetry
poetry update
poetry run pyinstaller build.spec
uv sync --group dev
uv run pyinstaller build.spec
```

### Arch Linux
Expand Down Expand Up @@ -92,10 +91,10 @@ python setup.py install

### 通用 (仅本地开发)

自豪地使用 [Poetry](https://python-poetry.org/docs/) 进行开发
自豪地使用 [uv](https://docs.astral.sh/uv/) 进行开发

```shell
poetry install
uv sync --group dev
```

## 使用方法
Expand Down
Loading
Loading