Skip to content

Commit b536fc4

Browse files
authored
Add Python 3.11 and 3.13 support (#4236)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Medium Risk** > Broader Python version support and CI matrix changes are mostly low-impact, but dependency constraint updates (notably `unstructured-ingest`) and new interpreter compatibility can surface runtime/packaging issues. > > **Overview** > Adds **Python 3.11 and 3.13 support** by widening `requires-python` to `>=3.11, <3.14`, updating package classifiers, and bumping the `unstructured[ingest]` extra’s `unstructured-ingest` lower bound to `>=1.4.0`. > > Expands CI to run `lint` and multiple unit-test jobs across Python 3.11/3.12/3.13, and moves `test_json_to_html`/`test_json_to_markdown` to `ubuntu-latest` runners. Also aligns static tooling by setting `ruff` `target-version=py311` and `pyright` `pythonVersion=3.11`, bumps the library version to `0.20.0`, and removes a dead pre-3.8 conditional import in `unstructured/nlp/patterns.py`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 72e9dd8. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 95b953d commit b536fc4

6 files changed

Lines changed: 1214 additions & 1646 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
setup:
2020
strategy:
2121
matrix:
22-
python-version: ["3.12"]
22+
python-version: ["3.11", "3.12", "3.13"]
2323
runs-on: ubuntu-latest
2424
steps:
2525
- uses: actions/checkout@v4
@@ -44,7 +44,7 @@ jobs:
4444
lint:
4545
strategy:
4646
matrix:
47-
python-version: ["3.12"]
47+
python-version: ["3.11", "3.12", "3.13"]
4848
runs-on: ubuntu-latest
4949
needs: [setup, changelog]
5050
steps:
@@ -75,7 +75,7 @@ jobs:
7575
test_unit:
7676
strategy:
7777
matrix:
78-
python-version: ["3.12"]
78+
python-version: ["3.11", "3.12", "3.13"]
7979
runs-on: ubuntu-latest
8080
needs: [setup, lint]
8181
steps:
@@ -105,7 +105,7 @@ jobs:
105105
test_unit_no_extras:
106106
strategy:
107107
matrix:
108-
python-version: ["3.12"]
108+
python-version: ["3.11", "3.12", "3.13"]
109109
runs-on: ubuntu-latest
110110
needs: [setup, lint]
111111
steps:
@@ -129,7 +129,7 @@ jobs:
129129
test_unit_dependency_extras:
130130
strategy:
131131
matrix:
132-
python-version: ["3.12"]
132+
python-version: ["3.11", "3.12", "3.13"]
133133
extra: ["csv", "docx", "odt", "markdown", "pypandoc", "pdf-image", "pptx", "xlsx"]
134134
include:
135135
- extra: csv
@@ -256,7 +256,7 @@ jobs:
256256
strategy:
257257
matrix:
258258
python-version: ["3.12"]
259-
runs-on: opensource-linux-8core
259+
runs-on: ubuntu-latest
260260
needs: [setup, lint]
261261
steps:
262262
- uses: 'actions/checkout@v4'
@@ -274,7 +274,7 @@ jobs:
274274
strategy:
275275
matrix:
276276
python-version: ["3.12"]
277-
runs-on: opensource-linux-8core
277+
runs-on: ubuntu-latest
278278
needs: [setup, lint]
279279
steps:
280280
- uses: 'actions/checkout@v4'

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.20.0
2+
3+
### Enhancements
4+
- Add Python 3.11 and 3.13 support (`requires-python = ">=3.11, <3.14"`)
5+
- Expand CI matrix to test against Python 3.11, 3.12, and 3.13 for lint, unit tests, no-extras tests, and per-extra tests
6+
- Move lightweight CI jobs (`test_json_to_html`, `test_json_to_markdown`) from `opensource-linux-8core` to `ubuntu-latest` runners
7+
- Bump `unstructured-ingest` lower bound to `>=1.4.0` (first release with Python 3.11 and 3.13 support)
8+
- Remove dead `sys.version_info < (3, 8)` conditional import in `unstructured/nlp/patterns.py`
9+
- Update ruff `target-version` to `py311` and pyright `pythonVersion` to `3.11` to match new minimum
10+
111
## 0.19.3
212

313
### Enhancements

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "unstructured"
33
description = "A library that prepares raw documents for downstream ML tasks."
4-
requires-python = ">=3.12"
4+
requires-python = ">=3.11, <3.14"
55
authors = [{name = "Unstructured Technologies", email = "devops@unstructuredai.io"}]
66
classifiers = [
77
"Development Status :: 4 - Beta",
@@ -11,7 +11,9 @@ classifiers = [
1111
"License :: OSI Approved :: Apache Software License",
1212
"Operating System :: OS Independent",
1313
"Programming Language :: Python :: 3",
14+
"Programming Language :: Python :: 3.11",
1415
"Programming Language :: Python :: 3.12",
16+
"Programming Language :: Python :: 3.13",
1517
"Topic :: Scientific/Engineering :: Artificial Intelligence",
1618
]
1719
readme = "README.md"
@@ -120,7 +122,7 @@ paddleocr = [
120122
"unstructured-paddleocr==2.10.0",
121123
]
122124
ingest = [
123-
"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.3.1, <2.0.0",
125+
"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",
124126
]
125127

126128
[project.urls]
@@ -186,7 +188,7 @@ constraint-dependencies = [
186188

187189
[tool.pyright]
188190
pythonPlatform = "Linux"
189-
pythonVersion = "3.12"
191+
pythonVersion = "3.11"
190192
reportUnnecessaryCast = true
191193
reportUnnecessaryTypeIgnoreComment = true
192194
stubPath = "./typings"
@@ -195,7 +197,7 @@ verboseOutput = true
195197

196198
[tool.ruff]
197199
line-length = 100
198-
target-version = "py312"
200+
target-version = "py311"
199201

200202
[tool.ruff.lint]
201203
ignore = [

unstructured/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.19.3" # pragma: no cover
1+
__version__ = "0.20.0" # pragma: no cover

unstructured/nlp/patterns.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
import sys
2-
from typing import List
3-
4-
if sys.version_info < (3, 8):
5-
from typing_extensions import Final
6-
else:
7-
from typing import Final
8-
91
import re
2+
from typing import Final, List
103

114
# NOTE(robinson) - Modified from answers found on this stackoverflow post
125
# ref: https://stackoverflow.com/questions/16699007/

0 commit comments

Comments
 (0)