Skip to content

[BUG] Remove nltk hardlink workaround once upstream (nltk/llama-index) resolves it #471

Description

@oussamahansal

Package version

3.18.5

Package

lexical-graph

Python version

3.10, 3.11, 3.12 (CI)

Operating System

Linux

Description

As a stopgap for #468, we worked around nltk 3.10.3's pathsec hardlink check (CWE-59), which refuses to open uv-hardlinked NLTK data files and breaks sentence splitting. The workaround(s) currently in the codebase:

  • UV_LINK_MODE: copy in .github/workflows/lexical-graph-tests.yml
  • UV_LINK_MODE: copy in .github/workflows/byokg-rag-tests.yml
  • nltk<3.10.3 pin in lexical-graph/src/graphrag_toolkit/lexical_graph/requirements.txt,

These are intentional temporary measures. The proper fix belongs upstream, not in our code.

Revisit and remove the workarounds once upstream fix lands.

  • Remove the nltk pin from requirements.txt (if present), or widen it to allow the fixed nltk range.
  • Remove UV_LINK_MODE: copy from both test workflows (verify CI still green).
  • Confirm test_chunking.py::TestChunkingBasicBehavior tests pass with the fixed nltk on a uv-based Linux install.

Steps to reproduce

On Linux, in a uv-created venv (uv hardlinks from its cache):

uv venv --seed .venv
uv pip install --python .venv/bin/python -e '.[test]'   # resolves nltk 3.10.3
PYTHONPATH=src .venv/bin/python -m pytest tests/unit/indexing/extract/test_chunking.py

Error output / stack trace

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions