Skip to content

Commit

Permalink
Convert to uv build
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed Oct 27, 2024
1 parent 6f75532 commit f50620c
Showing 1 changed file with 47 additions and 37 deletions.
84 changes: 47 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
python: "pypy3.10"
- os: ubuntu-22.04
python: "3.13"
experimental: true

env:
OS: ${{ matrix.os }}
Expand All @@ -49,12 +48,15 @@ jobs:
with:
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags

- uses: actions/setup-python@v5
name: Setup Python
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python }}
cache: "pip"
allow-prereleases: ${{ matrix.experimental }}
version: "0.4.27"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Install Tesseract 5
if: matrix.tesseract5
Expand Down Expand Up @@ -89,11 +91,6 @@ jobs:
libxslt1-dev \
pypy3-dev
- name: Install Python packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install --prefer-binary .[test]
- name: Report versions
run: |
tesseract --version
Expand All @@ -102,9 +99,13 @@ jobs:
unpaper --version
img2pdf --version
- name: Install Python packages
run: |
uv sync --extra test
- name: Test
run: |
python -m pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
uv run pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down Expand Up @@ -144,27 +145,30 @@ jobs:
pngquant \
tesseract
- uses: actions/setup-python@v5
name: Setup Python
with:
python-version: ${{ matrix.python }}
cache: "pip"

- name: Install Python packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install --prefer-binary .[test]
- name: Report versions
run: |
tesseract --version
gs --version
pngquant --version
img2pdf --version
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.27"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"

- name: Install Python packages
run: |
uv sync --extra test
- name: Test
run: |
python -m pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
uv run pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -191,11 +195,15 @@ jobs:
with:
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags

- uses: actions/setup-python@v5
name: Setup Python
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.27"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: "pip"
python-version-file: ".python-version"

- name: Install system packages
run: |
Expand All @@ -204,12 +212,11 @@ jobs:
- name: Install Python packages
run: |
python -m pip install --upgrade pip wheel
python -m pip install --prefer-binary .[test]
uv sync --extra test
- name: Test
run: |
python -m pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
uv run pytest --cov-report xml --cov=ocrmypdf --cov=tests/ -n0 tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -227,16 +234,19 @@ jobs:
with:
fetch-depth: "0" # 0=all, needed for setuptools-scm to resolve version tags

- uses: actions/setup-python@v5
name: Setup Python
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "0.4.27"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
python-version-file: ".python-version"

- name: Make wheels and sdist
run: |
python -m pip install --upgrade pip wheel build
python -m build --sdist --wheel
uv build --sdist --wheel
- uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit f50620c

Please sign in to comment.