Skip to content

Commit bed7d3d

Browse files
Update packages for better 3.13 support (#2238)
1 parent f730209 commit bed7d3d

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

.github/workflows/python-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
os: ["ubuntu-20.04", "windows-latest"]
28-
python_version: ["3.9", "3.10", "3.11", "3.12"]
28+
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2929
env:
3030
UV_SYSTEM_PYTHON: 1
3131
steps:

app/backend/prepdocslib/blobmanager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from typing import List, Optional, Union
77

8-
import fitz # type: ignore
8+
import pymupdf
99
from azure.core.credentials_async import AsyncTokenCredential
1010
from azure.storage.blob import (
1111
BlobSasPermissions,
@@ -77,7 +77,7 @@ async def upload_pdf_blob_images(
7777
with open(file.content.name, "rb") as reopened_file:
7878
reader = PdfReader(reopened_file)
7979
page_count = len(reader.pages)
80-
doc = fitz.open(file.content.name)
80+
doc = pymupdf.open(file.content.name)
8181
sas_uris = []
8282
start_time = datetime.datetime.now(datetime.timezone.utc)
8383
expiry_time = start_time + datetime.timedelta(days=1)
@@ -95,7 +95,7 @@ async def upload_pdf_blob_images(
9595
blob_name = BlobManager.blob_image_name_from_file_page(file.content.name, i)
9696
logger.info("Converting page %s to image and uploading -> %s", i, blob_name)
9797

98-
doc = fitz.open(file.content.name)
98+
doc = pymupdf.open(file.content.name)
9999
page = doc.load_page(i)
100100
pix = page.get_pixmap()
101101
original_img = Image.frombytes("RGB", [pix.width, pix.height], pix.samples) # type: ignore

app/backend/requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ azure-identity
22
quart
33
quart-cors
44
openai>=1.3.7
5-
numpy>=1,<2.1.0 # Used by openai embeddings.create to optimize embeddings (but not required)
5+
numpy>=1,<2.1.0 # Used by openai embeddings.create to optimize embeddings (but not required). Pinned for 3.9 support.
66
tiktoken
77
tenacity
88
azure-ai-documentintelligence==1.0.0b4

app/backend/requirements.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jinja2==3.1.5
153153
# via
154154
# flask
155155
# quart
156-
jiter==0.5.0
156+
jiter==0.8.2
157157
# via openai
158158
markdown-it-py==3.0.0
159159
# via rich
@@ -168,7 +168,9 @@ microsoft-kiota-abstractions==1.3.3
168168
# via
169169
# microsoft-kiota-authentication-azure
170170
# microsoft-kiota-http
171+
# microsoft-kiota-serialization-form
171172
# microsoft-kiota-serialization-json
173+
# microsoft-kiota-serialization-multipart
172174
# microsoft-kiota-serialization-text
173175
# msgraph-core
174176
# msgraph-sdk
@@ -180,8 +182,12 @@ microsoft-kiota-http==1.3.3
180182
# via
181183
# msgraph-core
182184
# msgraph-sdk
185+
microsoft-kiota-serialization-form==0.1.1
186+
# via msgraph-sdk
183187
microsoft-kiota-serialization-json==1.3.0
184188
# via msgraph-sdk
189+
microsoft-kiota-serialization-multipart==0.1.0
190+
# via msgraph-sdk
185191
microsoft-kiota-serialization-text==1.0.0
186192
# via msgraph-sdk
187193
msal==1.30.0
@@ -205,7 +211,7 @@ numpy==2.0.1
205211
# via -r requirements.in
206212
oauthlib==3.2.2
207213
# via requests-oauthlib
208-
openai==1.42.0
214+
openai==1.59.4
209215
# via
210216
# -r requirements.in
211217
# openai-messages-token-helper
@@ -321,7 +327,9 @@ opentelemetry-util-http==0.47b0
321327
packaging==24.1
322328
# via opentelemetry-instrumentation-flask
323329
pendulum==3.0.0
324-
# via microsoft-kiota-serialization-json
330+
# via
331+
# microsoft-kiota-serialization-form
332+
# microsoft-kiota-serialization-json
325333
pillow==10.4.0
326334
# via
327335
# -r requirements.in
@@ -346,10 +354,8 @@ pyjwt[crypto]==2.9.0
346354
# via
347355
# -r requirements.in
348356
# msal
349-
pymupdf==1.24.9
357+
pymupdf==1.25.1
350358
# via -r requirements.in
351-
pymupdfb==1.24.9
352-
# via pymupdf
353359
pypdf==4.3.1
354360
# via -r requirements.in
355361
python-dateutil==2.9.0.post0
@@ -359,7 +365,7 @@ python-dateutil==2.9.0.post0
359365
# time-machine
360366
python-dotenv==1.0.1
361367
# via -r requirements.in
362-
quart==0.19.7
368+
quart==0.20.0
363369
# via
364370
# -r requirements.in
365371
# quart-cors
@@ -394,7 +400,7 @@ std-uritemplate==1.0.5
394400
# via microsoft-kiota-abstractions
395401
tenacity==9.0.0
396402
# via -r requirements.in
397-
tiktoken==0.7.0
403+
tiktoken==0.8.0
398404
# via
399405
# -r requirements.in
400406
# openai-messages-token-helper

0 commit comments

Comments
 (0)