Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ outlines_core == 0.2.11
# required for outlines backend disk cache
diskcache == 5.6.3
lark == 1.2.2
xgrammar == 0.1.29; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64" or platform_machine == "s390x" or platform_machine == "ppc64le"
xgrammar >= 0.1.32, < 1.0.0; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64" or platform_machine == "s390x" or platform_machine == "ppc64le"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

While upgrading xgrammar to fix the security vulnerability is a good move, the version constraint < 1.0.0 is too permissive for a pre-1.0 library and introduces a risk of future build failures.

According to Semantic Versioning, versions below 1.0.0 can introduce breaking changes even in minor releases (e.g., from 0.1.x to 0.2.0). The current constraint allows such upgrades automatically, which could lead to unexpected build or runtime errors if xgrammar releases a backward-incompatible 0.2.0 version.

To ensure stability and prevent future breakages, it's safer to restrict the allowed versions to the same minor series. This allows for patch releases (which should contain bug and security fixes) while preventing potentially breaking minor releases.

A more robust constraint would be >= 0.1.32, < 0.2.0.

xgrammar >= 0.1.32, < 0.2.0; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64" or platform_machine == "s390x" or platform_machine == "ppc64le"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was based on a conversation with @Ubospica

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This changes look good to me. XGrammar is planning a v0.2 release, but it is compatible with the prior API.

typing_extensions >= 4.10
filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317
partial-json-parser # used for parsing partial JSON outputs
Expand Down
Loading