Skip to content

Support bibtexparser 2.x - #77

Merged
dave3d merged 3 commits into
SimpleITK:mainfrom
dave3d:fix/bibtexparser-v2-compat
Nov 19, 2026
Merged

dave3d merged 3 commits into
SimpleITK:mainfrom
dave3d:fix/bibtexparser-v2-compat

Conversation

@dave3d

@dave3d dave3d commented Nov 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Use bibtexparser 2's parse_file API and entry keys when available.
  • Retain compatibility with the v1 load/get_entry_dict API.

Validation

  • uv run python -m unittest discover -s tests -v (5 tests passed)
  • Pre-commit hooks: large-file check, Black, and flake8 passed.

dave3d and others added 2 commits November 18, 2026 14:45
Use parse_file and entry keys when the v2 API is available, while retaining the v1 loader path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the bibtexparser compatibility and Python 3.12 updates.

No open issues 🎉

What changed in this PR

Adds bibtexparser 2.x support to bibliography word loading while retaining compatibility with the v1 API. The PR also raises the minimum supported Python version to 3.12 and aligns CI and environment setup.

Changes:

  • Uses parse_file and entry keys when available, falling back to load and get_entry_dict.
  • Requires Python 3.12 and updates CI and publishing workflows accordingly.
  • Replaces the pinned Conda environment with a minimal Python/pip specification and pip installation instructions.
File Description
pyproject.toml Raises the Python minimum to 3.12 and adds its classifier.
conda-env.txt Simplifies environment setup around Python 3.12.
comment_spell_check/​utils/​bibtex_loader.py Supports both bibtexparser v1 and v2 APIs.
.github/​workflows/​python-app.yml Updates both CI jobs to Python 3.12.
.github/​workflows/​publish.yml Updates package publishing to Python 3.12.

Review effort: Balanced

@dave3d
dave3d requested a review from zivy November 19, 2026 14:33

@zivy zivy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why wasn't the code only modified to use bibtexparser 2.x and the requirements.txt changed to require 2.0 as a minimal version? Is there a need to support both bibtexparser 1.x and 2.x versions?

@dave3d

dave3d commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

Yeah, I'll change it to v2 only

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread requirements.txt
comment_parser
pyspellchecker
bibtexparser
bibtexparser>=2.0,<3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a roundabout way to say bibtexparser~=2.0 which means any version from the 2.x family. Was there a reason for specifying it this way?

@dave3d
dave3d merged commit 4c65945 into SimpleITK:main Nov 19, 2026
2 checks passed
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.

3 participants