Skip to content
Draft
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: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,3 @@ workflows:
- python3.5
- python3.4
- python2.7
- pypy2
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,31 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Set up uv
uses: astral-sh/setup-uv@v7

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install -r requirements_dev.txt
uv pip install --system -r requirements_dev.txt
uv pip install --system .

- name: Run tests
run: |
py.test tests/ pypinyin/
python -m pytest tests/ pypinyin/

- name: test cli
if: startsWith(matrix.os,'ubuntu')
run: |
set -xe
python setup.py sdist
python -m pip install dist/*.gz
uv build
uv pip install --system dist/*.tar.gz
python -m pypinyin test
python -m pypinyin.tools.toneconvert to-tone 'zhong4 xin1'

Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ doctest:
.PHONY: publish
publish: clean
@echo "publish to pypi"
python setup.py sdist
python setup.py bdist_wheel
uv build
twine upload dist/*

.PHONY: publish_test
publish_test: clean
@echo "publish to test pypi"
python setup.py sdist
python setup.py bdist_wheel
uv build
twine upload --repository test dist/*

.PHONY: docs_html
Expand Down
8 changes: 7 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* GitHub: https://github.com/mozillazg/python-pinyin
* License: MIT license
* PyPI: https://pypi.org/project/pypinyin
* Python version: 2.7, pypy, pypy3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
* Python version: 2.7, pypy3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13

.. contents::

Expand All @@ -33,6 +33,12 @@
pip install pypinyin
使用 `uv` 安装:

.. code-block:: bash
uv add pypinyin
使用示例
--------
Expand Down
6 changes: 6 additions & 0 deletions README_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ Install

$ pip install pypinyin

Install with `uv`:

.. code-block:: bash

$ uv add pypinyin


Usage cases
--------
Expand Down
4 changes: 4 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ API

.. autofunction:: pypinyin.pinyin

.. autofunction:: pypinyin.pinyin_group

.. autofunction:: pypinyin.lazy_pinyin

.. autofunction:: pypinyin.lazy_pinyin_group

.. autofunction:: pypinyin.load_single_dict

.. autofunction:: pypinyin.load_phrases_dict
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* GitHub: https://github.com/mozillazg/python-pinyin
* License: MIT license
* PyPI: https://pypi.org/project/pypinyin
* Python version: 2.7, pypy, pypy3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9
* Python version: 2.7, pypy3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13


特性
Expand Down
5 changes: 3 additions & 2 deletions pypinyin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
STYLE_CYRILLIC_FIRST, CYRILLIC_FIRST
)
from pypinyin.core import ( # noqa
pinyin, lazy_pinyin, slug, load_single_dict, load_phrases_dict
pinyin, lazy_pinyin, slug, pinyin_group, lazy_pinyin_group,
load_single_dict, load_phrases_dict
)

__title__ = 'pypinyin'
Expand All @@ -33,7 +34,7 @@
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2016 mozillazg, 闲耘'
__all__ = [
'pinyin', 'lazy_pinyin', 'slug',
'pinyin', 'lazy_pinyin', 'slug', 'pinyin_group', 'lazy_pinyin_group',
'load_single_dict', 'load_phrases_dict',
'Style',
'STYLE_NORMAL', 'NORMAL',
Expand Down
2 changes: 2 additions & 0 deletions pypinyin/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ CYRILLIC_FIRST = constants.CYRILLIC_FIRST
pinyin = core.pinyin
lazy_pinyin = core.lazy_pinyin
slug = core.slug
pinyin_group = core.pinyin_group
lazy_pinyin_group = core.lazy_pinyin_group
load_single_dict = core.load_single_dict
load_phrases_dict = core.load_phrases_dict
Loading