Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
13 changes: 4 additions & 9 deletions jieba/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import sys
import importlib.resources

log_console = logging.StreamHandler(sys.stderr)
default_logger = logging.getLogger(__name__)
Expand All @@ -14,15 +15,9 @@ def setLogLevel(log_level):

check_paddle_install = {'is_paddle_installed': False}

try:
import pkg_resources

get_module_res = lambda *res: pkg_resources.resource_stream(__name__,
os.path.join(*res))
except ImportError:
get_module_res = lambda *res: open(os.path.normpath(os.path.join(
os.getcwd(), os.path.dirname(__file__), *res)), 'rb')

def get_module_res(*res):
return importlib.resources.open_binary(__name__,
os.path.join(*res))

def enable_paddle():
try:
Expand Down
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[project]
name = "jieba"
version = "0.42.2"
description = '"Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best Python Chinese word segmentation module.'
requires-python = ">=3.13"
dependencies = [
"paddlepaddle>=3.2.0",
"setuptools>=80.9.0",
"whoosh>=2.7.4",
]

[tool.uv.sources]
paddlepaddle = [
{ index = "paddlepaddle-cpu" },
]

[[tool.uv.index]]
name = "paddlepaddle-cpu"
url = "https://www.paddlepaddle.org.cn/packages/stable/cpu/"
explicit = true
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import setup
LONGDOC = """
jieba
=====
Expand Down
Loading