Skip to content

Fix transformers dependency constraint#236

Open
HumanBean17 wants to merge 1 commit into
masterfrom
fix-transformers-dependency
Open

Fix transformers dependency constraint#236
HumanBean17 wants to merge 1 commit into
masterfrom
fix-transformers-dependency

Conversation

@HumanBean17
Copy link
Copy Markdown
Owner

Problem

Users installing java-codebase-rag via pip got transformers 5.9.0, which has a bug:

NameError: name 'nn' is not defined

in transformers/integrations/accelerate.py due to type annotations using nn.Module without proper imports.

Root Cause

  • pyproject.toml specified sentence-transformers>=5.4.0,<6
  • sentence-transformers requires transformers>=4.41.0,<6.0.0
  • Pip resolved to latest transformers (5.9.0) instead of the tested range (4.48.3-5.5.3)

Fix

  • Add explicit transformers>=4.48.3,<=5.5.3 to pyproject.toml dependencies
  • Bump version to 0.2.2
  • Add tests/bank-chat-system/.venv to .gitignore

Verification

  • Package published as java-codebase-rag==0.2.2 to PyPI
  • Contains correct transformers constraint in metadata
  • New installs will get transformers 4.48.3-5.5.3 range

- Add explicit transformers>=4.48.3,<=5.5.3 to pyproject.toml
- Bump version to 0.2.2
- Add tests/bank-chat-system/.venv to .gitignore

Fixes bug where pip install java-codebase-rag would install
transformers 5.9.0 via sentence-transformers, causing:
NameError: name 'nn' is not defined in transformers/integrations/accelerate.py

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant