-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve: add Python 3.12 support (#3033) #3047
Conversation
Draft: currently blocked by argilla not supporting 3.12 Waiting for this PR to be released: argilla-io/argilla#4837 Fixes #2959 --------- Co-authored-by: Matt Robinson <mrobinson@unstructured.io> Co-authored-by: Matt Robinson <mrobinson@unstructuredai.io>
…ctured into 2959/py32-support
Looks like there's a package version issue that needs to be run down for the GCS connector: Exception ignored in: <function AbstractBufferedFile.__del__ at 0x7fe177b8f3a0>
Traceback (most recent call last):
File "/home/runner/work/unstructured/unstructured/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1971, in __del__
self.close()
File "/home/runner/work/unstructured/unstructured/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1949, in close
self.flush(force=True)
File "/home/runner/work/unstructured/unstructured/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1808, in flush
self._initiate_upload()
File "/home/runner/work/unstructured/unstructured/.venv/lib/python3.9/site-packages/gcsfs/core.py", line 1509, in _initiate_upload
self.content_type,
AttributeError: 'GCSFile' object has no attribute 'content_type' |
Looks like the Mongo failures are related to this. The Mongo client ships with its own version of |
…ctured into 2959/py32-support
Captured the issue related to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
### Summary Closes #3049. Reenables the MongoDB connector test, which was disabled previously in #3047 due to incompatibility between the `pymongo` and the `bson` package from `pip`, which is a dependency for the Astra connector. Per the `pymongo` docs below, `pymongo` ships with its own version of `bson` and installing `bson` from `pip` breaks `pymongo`. - https://pymongo.readthedocs.io/en/stable/installation.html ### Testing Ingest tests ran successfully for the [source connector](https://github.com/Unstructured-IO/unstructured/actions/runs/9273154676/job/25512636315) and the [destination connector](https://github.com/Unstructured-IO/unstructured/actions/runs/9273154676/job/25512635546).
Summary
Closes #2959. Updates the dependency and CI to add support for Python 3.12.
The MongoDB ingest tests were disabled due to jobs like this one failing due to issues with the
bson
package.bson
is a dependency for the AstraDB connector, butpymongo
does not work whenbson
is installed frompip
. This issue is documented by MongoDB here. Spun off #3049 to resolve this. Issue seems unrelated to Python 3.12, though unsure why this didn't surface previously.Disables the
argilla
tests becauseargilla
does not yet support Python 3.12. We can add theargilla
tests back in once the PR references below is merged. You can still use thestage_for_argilla
function if you're onpython<3.12
and you installargilla
yourself.