diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 6f33075..1e8412e 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -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 diff --git a/pinyin/__init__.py b/pinyin/__init__.py index 3b9331a..8925423 100644 --- a/pinyin/__init__.py +++ b/pinyin/__init__.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals from io import open import jieba @@ -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): diff --git a/pinyin/config.py b/pinyin/config.py index 6f798b1..3a96b01 100644 --- a/pinyin/config.py +++ b/pinyin/config.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import re from os.path import join, abspath, dirname diff --git a/pinyin/utils.py b/pinyin/utils.py index 7371001..281fba7 100644 --- a/pinyin/utils.py +++ b/pinyin/utils.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals class Singleton(type): _instances = {} diff --git a/pyproject.toml b/pyproject.toml index 5b25692..b7d8191 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,6 @@ classifiers = [ dependencies = [ "jieba", - "six", ] readme = "README.md" @@ -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] diff --git a/tests/test_pinyin.py b/tests/test_pinyin.py index d9e5b69..385f443 100644 --- a/tests/test_pinyin.py +++ b/tests/test_pinyin.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import unittest from pinyin import Pinyin