Skip to content
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

Merged
merged 15 commits into from
May 19, 2024
Merged

improve: add Python 3.12 support (#3033) #3047

merged 15 commits into from
May 19, 2024

Conversation

MthwRobinson
Copy link
Contributor

@MthwRobinson MthwRobinson commented May 17, 2024

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, but pymongo does not work when bson is installed from pip. 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 because argilla does not yet support Python 3.12. We can add the argilla tests back in once the PR references below is merged. You can still use the stage_for_argilla function if you're on python<3.12 and you install argilla yourself.

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>
@MthwRobinson
Copy link
Contributor Author

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'

@MthwRobinson
Copy link
Contributor Author

Looks like the Mongo failures are related to this. The Mongo client ships with its own version of bson, and the bson installed with astra causes a failure.

@MthwRobinson
Copy link
Contributor Author

Captured the issue related to bson in #3049.

Copy link
Collaborator

@scanny scanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@MthwRobinson MthwRobinson added this pull request to the merge queue May 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 19, 2024
@MthwRobinson MthwRobinson added this pull request to the merge queue May 19, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 19, 2024
@MthwRobinson MthwRobinson added this pull request to the merge queue May 19, 2024
Merged via the queue into main with commit d760801 May 19, 2024
46 checks passed
@MthwRobinson MthwRobinson deleted the 2959/py32-support branch May 19, 2024 23:35
github-merge-queue bot pushed a commit that referenced this pull request May 28, 2024
### 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore/Allow python 3.12
3 participants