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

Merged
merged 6 commits into from
May 17, 2024

Conversation

nicoloboschi
Copy link
Contributor

Draft: currently blocked by argilla not supporting 3.12
Waiting for this PR to be released: argilla-io/argilla#4837

Fixes #2959

@MthwRobinson
Copy link
Contributor

Thanks for this @nicoloboschi ! Just turned on the CI pipeline. If I recall correctly, it was onnx that was blocking 3.12 support before, but that should be resolved now.

@MthwRobinson
Copy link
Contributor

CI failure was due to this. We may be able to work around that though.

ERROR: Cannot install argilla==1.28.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    argilla 1.28.0 depends on numpy<1.24.0
    The user requested (constraint) numpy>=1.26.0
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

@MthwRobinson
Copy link
Contributor

Ahh disregard, I see you have a PR open for 3.12 support in Argilla as well.

@gokturkDev
Copy link

gokturkDev commented May 17, 2024

@MthwRobinson hi I experience the below error with onnx when trying to use python 3.12 with unstructured
ImportError: dlopen(/Users/gokturkdev/PycharmProjects/hekades-backend/venv/lib/python3.12/site-packages/onnx/onnx_cpp2py_export.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '__ZN6google8protobuf2io16CodedInputStream24default_recursion_limit_E'

I reckon its due to python support then. When can I expect this PR to be released? I really don't want to downgrade my entire app for this

@gokturkDev
Copy link

Meanwhile are there any hotfixes I can apply?

@MthwRobinson
Copy link
Contributor

@gokturkDev - In the meantime, I'd try manually running make install on the branch for this PR. The version updates @nicoloboschi added to contraints.txt are what you need to enable 3.12. As long as you aren't using the Argilla integration I don't think it should be an issue, though I haven't tested it myself yet.

@gokturkDev
Copy link

Hey thanks for the response. I ended up installing the latest onnx manually instead of using the one installed as an unstructured dependency and its working so far 👍

@MthwRobinson
Copy link
Contributor

@nicoloboschi - Going to merge this into a feature branch and then get it into main from there. Failing tests are because env vars are missing on the fork. Thank you for this contribution!

@MthwRobinson MthwRobinson marked this pull request as ready for review May 17, 2024 16:59
@MthwRobinson MthwRobinson merged commit 5d74bea into Unstructured-IO:2959/py32-support May 17, 2024
37 of 46 checks passed
@MthwRobinson
Copy link
Contributor

New PR is #3047

github-merge-queue bot pushed a commit that referenced this pull request May 19, 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](https://github.com/Unstructured-IO/unstructured/actions/runs/9133383127/job/25116767333)
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](https://pymongo.readthedocs.io/en/stable/installation.html). 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.
- argilla-io/argilla#4837

---------

Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
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