Skip to content

build(deps): add typing extensions dep#1835

Merged
qued merged 13 commits intomainfrom
build(deps)/add-typing-extensions-dep
Oct 24, 2023
Merged

build(deps): add typing extensions dep#1835
qued merged 13 commits intomainfrom
build(deps)/add-typing-extensions-dep

Conversation

@qued
Copy link
Contributor

@qued qued commented Oct 21, 2023

Closes #1330.

Added typing-extensions as an explicit dependency (it was previously an implicit dependency via dataclasses-json).

This dependency should be explicit, since we import from it directly in unstructured.documents.elements. This has the added benefit that TypedDict will be available for Python 3.7 users.

Other changes:

  • Ran pip-compile
  • Fixed a bug in version-sync.sh that caused an error when using the sync functionality when syncing to a dev version from a release version.

Testing:

To test the Python 3.7 functionality, in a Python 3.7 environment install the base requirements and run

from unstructured.documents.elements import Element

This also works on main as typing_extensions is a requirement. However if you pip uninstall typing-extensions, and run the above code, it should fail. So this update makes sure typing-extensions doesn't get lost if the other dependencies move around.

To reproduce the version-sync.sh bug that was fixed, in main, increment the most recent version in CHANGELOG.md while leaving the version in __version__.py. Then add the following lines to version-sync.sh to simulate a particular set of circumstances, starting on line 114:

MAIN_IS_RELEASE=true
CURRENT_BRANCH="something-not-main"

Then run make version-sync.

The expected behavior is that the version in __version__.py is changed to the new version to match CHANGELOG.md, but instead it exits with an error.

The fix was to only do the version incrementation check when the script is running in -c or "check" mode.

@qued qued requested a review from yuming-long October 24, 2023 16:56
Copy link
Contributor

@shreyanid shreyanid left a comment

Choose a reason for hiding this comment

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

worked in 3.7 for me!

@qued qued enabled auto-merge October 24, 2023 18:23
@qued qued added this pull request to the merge queue Oct 24, 2023
Merged via the queue into main with commit d79f633 Oct 24, 2023
@qued qued deleted the build(deps)/add-typing-extensions-dep branch October 24, 2023 20:10
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.

TypedDict not available in python < 3.8

2 participants