Skip to content

Commit 9821993

Browse files
committed
Fix circular import: use submodule import for C extension
core.py and simple.py used which triggered re-execution of __init__.py during package initialization. Changed to which imports the C extension submodule directly without requiring full parent package resolution. This fixes the ImportError seen in build-sdist CI when running after installation.
1 parent b0d6db9 commit 9821993

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tinybpe/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import regex as re
1313

14-
from tinybpe import bpe
14+
import tinybpe.bpe as bpe
1515
from tinybpe._model_io import BPEParam, save_bpe_model, save_bpe_vocab
1616

1717

tinybpe/simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from typing import Callable
1010

11-
from tinybpe import bpe
11+
import tinybpe.bpe as bpe
1212
from tinybpe._model_io import save_bpe_model
1313

1414

0 commit comments

Comments
 (0)