Skip to content

Commit d6182af

Browse files
committed
Bump Python to 3.11, rebuild deps, revert CI changes
1 parent d7f339f commit d6182af

File tree

8 files changed

+212
-202
lines changed

8 files changed

+212
-202
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ main ]
88

99
env:
10-
PYTHON_VERSION: "3.10"
10+
PYTHON_VERSION: "3.12"
1111
PIPELINE_FAMILY: "general"
1212

1313
jobs:
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
path: |
2222
.venv
23-
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/base.txt', 'requirements/test.txt') }}
23+
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/*.txt') }}
2424
- name: Set up Python ${{ env.PYTHON_VERSION }}
2525
uses: actions/setup-python@v5
2626
with:
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
path: |
4444
.venv
45-
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/base.txt', 'requirements/test.txt') }}
45+
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/*.txt') }}
4646
- name: Lint
4747
run: |
4848
source .venv/bin/activate
@@ -65,11 +65,13 @@ jobs:
6565
with:
6666
path: |
6767
.venv
68-
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/base.txt', 'requirements/test.txt') }}
68+
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/test.txt') }}
6969
- name: Run core tests
7070
run: |
71+
python${{ env.PYTHON_VERSION }} -m venv .venv
7172
source .venv/bin/activate
7273
sudo apt-get update && sudo apt-get install --yes poppler-utils libreoffice
74+
make install-test
7375
make install-pandoc
7476
sudo add-apt-repository -y ppa:alex-p/tesseract-ocr5
7577
sudo apt-get install -y tesseract-ocr tesseract-ocr-kor
@@ -105,9 +107,11 @@ jobs:
105107
with:
106108
path: |
107109
.venv
108-
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/base.txt', 'requirements/test.txt') }}
110+
key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/test.txt') }}
109111
- name: Test Dockerfile
110112
run: |
113+
python${{ env.PYTHON_VERSION }} -m venv .venv
114+
make install-test
111115
source .venv/bin/activate
112116
make docker-build
113117
make docker-test

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111
PACKAGE: "unstructured-api"
1212
PIPELINE_FAMILY: "general"
1313
PIP_VERSION: "25.1.1"
14-
PYTHON_VERSION: "3.10"
14+
PYTHON_VERSION: "3.12"
1515

1616
jobs:
1717
setup:

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# syntax=docker/dockerfile:experimental
2-
FROM quay.io/unstructured-io/base-images:wolfi-base-latest as base
2+
FROM quay.io/unstructured-io/base-images:wolfi-py3.12-slim-latest as base
33

44
# NOTE(crag): NB_USER ARG for mybinder.org compat:
55
# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
66
ARG NB_USER=notebook-user
77
ARG NB_UID=1000
88
ARG PIP_VERSION
99
ARG PIPELINE_PACKAGE
10-
ARG PYTHON_VERSION="3.11"
10+
ARG PYTHON_VERSION="3.12"
11+
12+
USER root
13+
14+
RUN apk add --no-cache shadow \
15+
&& useradd -m -u ${NB_UID} -s /bin/sh ${NB_USER}
16+
RUN chown -R ${NB_USER}:${NB_USER} ${HOME}
1117

1218
# Set up environment
1319
ENV PYTHON python${PYTHON_VERSION}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,13 @@ curl -X 'POST'
289289
* Using `pyenv` to manage virtualenv's is recommended
290290
* Mac install instructions. See [here](https://github.com/Unstructured-IO/community#mac--homebrew) for more detailed instructions.
291291
* `brew install pyenv-virtualenv`
292-
* `pyenv install 3.10.12`
292+
* `pyenv install 3.12.11`
293293
* Linux instructions are available [here](https://github.com/Unstructured-IO/community#linux).
294294

295295
* Create a virtualenv to work in and activate it, e.g. for one named `document-processing`:
296296

297-
`pyenv virtualenv 3.10.12 unstructured-api` <br />
297+
`pyenv virtualenv 3.12.11
298+
unstructured-api` <br />
298299
`pyenv activate unstructured-api`
299300

300301
See the [Unstructured Quick Start](https://github.com/Unstructured-IO/unstructured#eight_pointed_black_star-quick-start) for the many OS dependencies that are required, if the ability to process all file types is desired.

requirements/base.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
-c constraints.in
22
unstructured[all-docs]
3-
# Pinning click due to a unicode issue in black
4-
# can remove after black drops support for Python 3.6
5-
# ref: https://github.com/psf/black/issues/2964
6-
click==8.2.1
3+
click
74
fastapi
85
uvicorn
96
ratelimit

0 commit comments

Comments
 (0)