Skip to content
Merged
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
3 changes: 1 addition & 2 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install jieba six
python -m pip install jieba
- name: run unittest
run: |
python -m unittest discover tests
4 changes: 1 addition & 3 deletions pinyin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
from io import open

import jieba
Expand All @@ -10,12 +9,11 @@

from pinyin.config import FILE_WORDS, FILE_WORD, FILE_TERM, FILE_USER_DICT, CHINESE_RE
from pinyin.utils import Singleton
from six import with_metaclass

__all__ = ["Pinyin"]


class Pinyin(with_metaclass(Singleton, object)):
class Pinyin(metaclass=Singleton):

def __init__(self):

Expand Down
1 change: 0 additions & 1 deletion pinyin/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
import re
from os.path import join, abspath, dirname

Expand Down
1 change: 0 additions & 1 deletion pinyin/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-


from __future__ import unicode_literals
class Singleton(type):

_instances = {}
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers = [

dependencies = [
"jieba",
"six",
]

readme = "README.md"
Expand All @@ -30,4 +29,7 @@ Homepage = "https://github.com/xospc/python-smart-pinyin"
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[tool.requires-python]
version = ">=3.10"

[tool.setuptools_scm]
1 change: 0 additions & 1 deletion tests/test_pinyin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import unicode_literals
import unittest

from pinyin import Pinyin
Expand Down