Document missing setup prerequisites and env vars in README #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| pull_request: | |
| paths: | |
| - "**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Check out the code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends libgomp1 libmagic1 | |
| - name: Install dependencies | |
| run: uv sync --python ${{ matrix.python-version }} --group dev --extra ocr --frozen | |
| - name: Download NLTK data | |
| # nltk.download returns False on a failed download instead of raising, | |
| # which used to surface later as a baffling punkt_tab LookupError at | |
| # test collection. Retry transient failures and fail this step loudly. | |
| run: | | |
| uv run python -c " | |
| import sys, time, nltk | |
| for pkg in ('punkt', 'punkt_tab', 'stopwords'): | |
| for attempt in range(5): | |
| if nltk.download(pkg): | |
| break | |
| time.sleep(10) | |
| else: | |
| sys.exit(f'failed to download nltk package {pkg!r}') | |
| " | |
| - name: Run tests (pure Python, no Java/Tika) | |
| run: | | |
| uv run pytest -vv tests/ --runslow |