Skip to content
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
setup:
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
lint:
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
test_unit:
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
runs-on: opensource-linux-8core
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
test_unit_no_extras:
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -161,7 +161,7 @@ jobs:
test_unit_dependency_extras:
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
extra: ["csv", "docx", "odt", "markdown", "pypandoc", "pdf-image", "pptx", "xlsx"]
include:
- extra: csv
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "unstructured"
description = "A library that prepares raw documents for downstream ML tasks."
requires-python = ">=3.11, <3.14"
requires-python = ">=3.11, <3.15"
authors = [{name = "Unstructured Technologies", email = "devops@unstructuredai.io"}]
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -14,6 +14,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
readme = "README.md"
Expand Down Expand Up @@ -134,9 +135,9 @@ local-inference = [
"unstructured[all-docs]",
]
paddleocr = [
"paddlepaddle>=3.3.0, <4.0.0; platform_machine != 'aarch64' and platform_system != 'Windows'",
"paddlepaddle>=3.3.0, <4.0.0; platform_machine != 'aarch64' and platform_system != 'Windows' and python_version < '3.14'",
"paddlepaddle>=3.3.0, <4.0.0; platform_system == 'Windows' and python_version < '3.13'",
"unstructured-paddleocr==2.10.0",
"unstructured-paddleocr==2.10.0; python_version < '3.14'",
]
ingest = [
"unstructured-ingest[airtable,astradb,azure,azure-ai-search,bedrock,biomed,box,chroma,confluence,couchbase,databricks-volumes,delta-table,discord,dropbox,elasticsearch,gcs,github,gitlab,google-drive,hubspot,huggingface,jira,kafka,kdbai,milvus,mongodb,notion,octoai,onedrive,openai,opensearch,outlook,pinecone,postgres,qdrant,reddit,remote,s3,salesforce,sftp,sharepoint,singlestore,slack,vectara,vertexai,voyageai,weaviate,wikipedia]>=1.4.0, <2.0.0; platform_system != 'Windows'",
Expand Down
5 changes: 5 additions & 0 deletions test_unstructured/partition/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import os
import pathlib
import sys
import tempfile
from collections.abc import Iterable

Expand Down Expand Up @@ -706,6 +707,10 @@ def it_rejects_non_standard_json_constants(payload: str):
partition_json(text=payload)


@pytest.mark.skipif(
sys.version_info >= (3, 14),
reason="Python 3.14+ json encoder no longer hits a RecursionError at this depth",
)
def and_it_raises_ValueError_when_a_valid_payload_is_too_deep_to_pretty_print():
# -- json.loads() (C scanner) parses deeper than json.dumps() (pure Python) can serialize,
# -- so a valid payload can still fail pretty-printing; that surfaces as ValueError too --
Expand Down
5 changes: 5 additions & 0 deletions test_unstructured/partition/test_ndjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import os
import pathlib
import sys
import tempfile

import pytest
Expand Down Expand Up @@ -436,6 +437,10 @@ def it_rejects_non_standard_json_constants_on_a_line(payload: str):
partition_ndjson(text=payload + "\n")


@pytest.mark.skipif(
sys.version_info >= (3, 14),
reason="Python 3.14+ json encoder no longer hits a RecursionError at this depth",
)
def and_it_raises_ValueError_when_a_valid_line_is_too_deep_to_pretty_print():
# -- json.loads() (C scanner) parses deeper than json.dumps() (pure Python) can serialize,
# -- so a valid line can still fail pretty-printing; that surfaces as ValueError too --
Expand Down
8 changes: 6 additions & 2 deletions test_unstructured/staging/test_streamed_orig_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ def test_compression_preserves_standard_encoder_circular_reference_error(
element = NarrativeText("text", element_id="id", metadata=metadata)

adjusted = base._fix_metadata_field_precision([element])
with pytest.raises(ValueError, match="^Circular reference detected$") as expected:
# -- compare str(exc), not `match=`: Python 3.14+ adds "when serializing ..." notes to the
# -- exception and `pytest.raises(match=...)` also matches against those notes --
with pytest.raises(ValueError) as expected:
json.dumps(base.elements_to_dicts(adjusted), sort_keys=True)
with pytest.raises(type(expected.value), match="^Circular reference detected$"):
assert str(expected.value) == "Circular reference detected"
with pytest.raises(type(expected.value)) as actual:
base.elements_to_base64_gzipped_json([element])
assert str(actual.value) == "Circular reference detected"


@pytest.mark.parametrize("large_string", [False, True])
Expand Down
Loading
Loading