Skip to content

Replace deprecated pyparsing oneOf with one_of#12

Merged
rfrenchseti merged 2 commits intomainfrom
fix-pyparsing-oneof-deprecation
Apr 10, 2026
Merged

Replace deprecated pyparsing oneOf with one_of#12
rfrenchseti merged 2 commits intomainfrom
fix-pyparsing-oneof-deprecation

Conversation

@rfrenchseti
Copy link
Copy Markdown
Collaborator

@rfrenchseti rfrenchseti commented Apr 10, 2026

Summary

Test plan

  • All 11 existing tests pass (pytest tests/ -v)
  • Ran with -W error::DeprecationWarning to confirm no deprecation warnings remain
  • Updated venv packages to latest versions (pyparsing 3.3.2, pytest 9.0.3, etc.)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated internal grammar parsing components to use current library APIs across data and name parsing modules.

Fixes #11. Replaces all uses of the deprecated `oneOf` with the
current `one_of` API in _DATA_GRAMMAR.py and _NAME_GRAMMAR.py to
eliminate PyparsingDeprecationWarning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Warning

Rate limit exceeded

@rfrenchseti has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 25 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 25 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a937bc16-190c-43d1-9707-6c3152c331d1

📥 Commits

Reviewing files that changed from the base of the PR and between 7073ba2 and a22aee9.

📒 Files selected for processing (2)
  • pyproject.toml
  • requirements.txt

Walkthrough

The PR replaces the deprecated pyparsing.oneOf() function with pyparsing.one_of() across two grammar definition files (_DATA_GRAMMAR.py and _NAME_GRAMMAR.py) to eliminate PyparsingDeprecationWarning on recent pyparsing versions. No functional logic changes.

Changes

Cohort / File(s) Summary
Data Grammar Deprecation
textkernel/_DATA_GRAMMAR.py
Replaced oneOf() with one_of() in three locations: SIGN token definition, EXPONENT expression, and STATEMENT operator parsing.
Name Grammar Deprecation
textkernel/_NAME_GRAMMAR.py
Replaced oneOf() with one_of() in two locations: INDEXED_NAME and TKFRAME_SUFFIX grammar components.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

  • Issue #11 (already linked): This PR directly addresses the deprecation warning objective stated in the linked issue by replacing all five identified instances of oneOf with one_of across the specified files.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: replacing deprecated pyparsing oneOf with one_of.
Description check ✅ Passed The description includes issue reference (#11), clear summary of changes (5 uses replaced), and comprehensive test plan verifying functionality and deprecation warnings.
Linked Issues check ✅ Passed All 5 oneOf-to-one_of replacements across both files match the requirements in issue #11, eliminating PyparsingDeprecationWarning with no API behavior changes.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #11 requirements: only pyparsing API replacements in grammar definitions, no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bfc8607) to head (a22aee9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #12   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          326       326           
  Branches        67        67           
=========================================
  Hits           326       326           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@textkernel/_DATA_GRAMMAR.py`:
- Line 12: The project uses pyparsing.one_of() (imported as one_of) which
requires pyparsing>=3.0.0; update the dependency constraints by adding a minimum
version specifier "pyparsing>=3.0.0" to both pyproject.toml (dependencies) and
requirements.txt so installations cannot pick pre-3.0 releases, and run your
dependency install/lock step to propagate the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 75b27e8d-807f-421d-b7d6-70419f669c8c

📥 Commits

Reviewing files that changed from the base of the PR and between bfc8607 and 7073ba2.

📒 Files selected for processing (2)
  • textkernel/_DATA_GRAMMAR.py
  • textkernel/_NAME_GRAMMAR.py

one_of() was introduced in pyparsing 3.0.0; without this floor an
install of pyparsing<3.0 would fail at import time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rfrenchseti rfrenchseti merged commit 8a5eee0 into main Apr 10, 2026
19 checks passed
@rfrenchseti rfrenchseti deleted the fix-pyparsing-oneof-deprecation branch April 10, 2026 18:54
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.

Replace deprecated pyparsing oneOf with one_of (PyparsingDeprecationWarning)

1 participant