fix: relax docstring-parser constraint to support Python 3.14#319
Open
umutonuryasar wants to merge 1 commit into
Open
fix: relax docstring-parser constraint to support Python 3.14#319umutonuryasar wants to merge 1 commit into
umutonuryasar wants to merge 1 commit into
Conversation
aisuite fails on import on Python 3.14 with:
AttributeError: module 'ast' has no attribute 'NameConstant'
This is caused by the docstring-parser dependency. Version 0.15 relies
on ast.NameConstant, ast.Str, and ast.Num, which were deprecated since
Python 3.8 and removed entirely in Python 3.14.
pyproject.toml pinned docstring-parser with a caret constraint:
docstring-parser = { version = "^0.15.0" }
Under Poetry's semantics for 0.x versions, ^0.15.0 resolves to
>=0.15.0,<0.16.0, so the resolver could never pick up a release with
the fix (the deprecated ast classes were removed in a later 0.x
release; current latest is 0.18.0).
Relax the constraint to >=0.16,<1.0, allowing resolution to 0.18.0,
which removes the deprecated ast usage. poetry.lock regenerated
accordingly (docstring-parser 0.15 -> 0.18.0).
Verified:
- `import aisuite as ai` succeeds with no AttributeError or
DeprecationWarning.
- Full test suite: 348 passed, 1 skipped (pre-existing failures from
missing optional extras such as mcp/cohere/deepgram are unaffected
and identical with/without this change).
Fixes andrewyng#265
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aisuitefails on import on Python 3.14 with:AttributeError: module 'ast' has no attribute 'NameConstant'
This is caused by the
docstring-parserdependency. Version 0.15 relies onast.NameConstant,ast.Str, andast.Num, which were deprecated since Python 3.8 and removed entirely in Python 3.14.pyproject.tomlpinneddocstring-parserwith a caret constraint:Under Poetry's semantics for 0.x versions,
^0.15.0resolves to>=0.15.0,<0.16.0, so the resolver could never pick up a release with the fix (the deprecatedastclasses were removed in a later 0.x release; current latest is0.18.0).Relax the constraint to
>=0.16,<1.0, allowing resolution to0.18.0, which removes the deprecatedastusage.poetry.lockregenerated accordingly (docstring-parser0.15 → 0.18.0).Verified:
import aisuite as aisucceeds with noAttributeErrororDeprecationWarning.mcp/cohere/deepgramare unaffected and identical with/without this change).Fixes #265