unicode-segmentation-rs 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/workflows/ci.yml +16 -16
  2. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/workflows/pre-commit.yml +3 -3
  3. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.pre-commit-config.yaml +3 -3
  4. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/Cargo.lock +15 -15
  5. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/Cargo.toml +1 -1
  6. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/PKG-INFO +1 -1
  7. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/pyproject.toml +1 -1
  8. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/src/lib.rs +3 -0
  9. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/tests/test_gettext_wrap.py +8 -0
  10. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/FUNDING.yml +0 -0
  11. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  12. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  14. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  15. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/PULL_REQUEST_TEMPLATE.md.license +0 -0
  16. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/renovate.json +0 -0
  17. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.github/renovate.json.license +0 -0
  18. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.gitignore +0 -0
  19. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.markdownlint.yml +0 -0
  20. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/.yamllint.yml +0 -0
  21. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/LICENSE +0 -0
  22. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/LICENSES/CC0-1.0.txt +0 -0
  23. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/LICENSES/MIT.txt +0 -0
  24. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/README.md +0 -0
  25. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/REUSE.toml +0 -0
  26. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/tests/test_unicode_segmentation.py +0 -0
  27. {unicode_segmentation_rs-0.2.0 → unicode_segmentation_rs-0.2.1}/unicode_segmentation_rs.pyi +0 -0
@@ -38,7 +38,7 @@ jobs:
38
38
  python-version: '3.14'
39
39
  name: Tests, Python ${{ matrix.python-version }}, ${{ matrix.os }}
40
40
  steps:
41
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
41
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
42
42
  with:
43
43
  persist-credentials: false
44
44
  - name: Set up Python ${{ matrix.python-version }}
@@ -46,12 +46,12 @@ jobs:
46
46
  id: setup_python
47
47
  with:
48
48
  python-version: ${{ matrix.python-version }}
49
- - uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 # zizmor: ignore[cache-poisoning]
49
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 # zizmor: ignore[cache-poisoning]
50
50
  # The cache is stored only on main branch and not used for publishing
51
51
  with:
52
52
  save-cache: ${{ github.ref == 'refs/heads/main' }}
53
53
  cache-suffix: ${{ steps.setup_python.outputs.python-version }}
54
- version: 0.9.13
54
+ version: 0.9.17
55
55
  activate-environment: 'true'
56
56
  - run: uv sync
57
57
  - run: pytest
@@ -76,7 +76,7 @@ jobs:
76
76
  - runner: ubuntu-latest
77
77
  target: ppc64le
78
78
  steps:
79
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
79
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
80
80
  with:
81
81
  persist-credentials: false
82
82
  - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -104,7 +104,7 @@ jobs:
104
104
  sccache: false
105
105
  manylinux: auto
106
106
  - name: Upload wheels
107
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
107
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
108
108
  with:
109
109
  name: wheels-linux-${{ matrix.platform.target }}
110
110
  path: dist
@@ -124,7 +124,7 @@ jobs:
124
124
  - runner: ubuntu-latest
125
125
  target: armv7
126
126
  steps:
127
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
127
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
128
128
  with:
129
129
  persist-credentials: false
130
130
  - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -154,7 +154,7 @@ jobs:
154
154
  sccache: false
155
155
  manylinux: musllinux_1_2
156
156
  - name: Upload wheels
157
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
157
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
158
158
  with:
159
159
  name: wheels-musllinux-${{ matrix.platform.target }}
160
160
  path: dist
@@ -170,7 +170,7 @@ jobs:
170
170
  - runner: windows-latest
171
171
  target: x86
172
172
  steps:
173
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
173
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
174
174
  with:
175
175
  persist-credentials: false
176
176
  - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -200,7 +200,7 @@ jobs:
200
200
  args: --release --out dist -i python3.14t
201
201
  sccache: false
202
202
  - name: Upload wheels
203
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
203
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
204
204
  with:
205
205
  name: wheels-windows-${{ matrix.platform.target }}
206
206
  path: dist
@@ -216,7 +216,7 @@ jobs:
216
216
  - runner: macos-15
217
217
  target: aarch64
218
218
  steps:
219
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
219
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
220
220
  with:
221
221
  persist-credentials: false
222
222
  - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
@@ -243,7 +243,7 @@ jobs:
243
243
 
244
244
  sccache: false
245
245
  - name: Upload wheels
246
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
246
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
247
247
  with:
248
248
  name: wheels-macos-${{ matrix.platform.target }}
249
249
  path: dist
@@ -252,7 +252,7 @@ jobs:
252
252
  runs-on: ubuntu-latest
253
253
  name: Package sdist
254
254
  steps:
255
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
255
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
256
256
  with:
257
257
  persist-credentials: false
258
258
  - name: Build sdist
@@ -261,7 +261,7 @@ jobs:
261
261
  command: sdist
262
262
  args: --out dist
263
263
  - name: Upload sdist
264
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
264
+ uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
265
265
  with:
266
266
  name: wheels-sdist
267
267
  path: dist
@@ -292,10 +292,10 @@ jobs:
292
292
  # Used to generate artifact attestation
293
293
  attestations: write
294
294
  steps:
295
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
295
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
296
296
  with:
297
297
  persist-credentials: false
298
- - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
298
+ - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
299
299
  - name: Generate artifact attestation
300
300
  uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
301
301
  with:
@@ -315,7 +315,7 @@ jobs:
315
315
  needs: all-tests
316
316
  if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
317
317
  steps:
318
- - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
318
+ - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
319
319
  - uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
320
320
  with:
321
321
  generateReleaseNotes: true
@@ -20,7 +20,7 @@ jobs:
20
20
  runs-on: ubuntu-24.04
21
21
 
22
22
  steps:
23
- - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
23
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24
24
  with:
25
25
  persist-credentials: false
26
26
  - name: Get cache tag
@@ -29,7 +29,7 @@ jobs:
29
29
  echo "cache_tag=$(/bin/date --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
30
30
  echo "previous_cache_tag=$(/bin/date --date='1 month ago' --utc '+%Y%m')" >> "$GITHUB_OUTPUT"
31
31
  shell: bash
32
- - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
32
+ - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
33
33
  id: pre-commit-cache
34
34
  with:
35
35
  path: ~/.cache/pre-commit
@@ -42,7 +42,7 @@ jobs:
42
42
  uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
43
43
  with:
44
44
  python-version: '3.14'
45
- - uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
45
+ - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
46
46
  with:
47
47
  enable-cache: false
48
48
  - name: detect method
@@ -20,7 +20,7 @@ repos:
20
20
  hooks:
21
21
  - id: yamllint
22
22
  - repo: https://github.com/astral-sh/ruff-pre-commit
23
- rev: v0.14.6
23
+ rev: v0.14.9
24
24
  hooks:
25
25
  - id: ruff-check
26
26
  args:
@@ -45,7 +45,7 @@ repos:
45
45
  additional_dependencies:
46
46
  - mdformat-gfm==1.0.0
47
47
  - repo: https://github.com/igorshubovych/markdownlint-cli
48
- rev: v0.46.0
48
+ rev: v0.47.0
49
49
  hooks:
50
50
  - id: markdownlint
51
51
  - repo: https://github.com/fsfe/reuse-tool
@@ -57,7 +57,7 @@ repos:
57
57
  hooks:
58
58
  - id: actionlint
59
59
  - repo: https://github.com/zizmorcore/zizmor-pre-commit
60
- rev: v1.17.0
60
+ rev: v1.18.0
61
61
  hooks:
62
62
  - id: zizmor
63
63
  - repo: https://github.com/gitleaks/gitleaks
@@ -10,9 +10,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
10
10
 
11
11
  [[package]]
12
12
  name = "cc"
13
- version = "1.2.48"
13
+ version = "1.2.49"
14
14
  source = "registry+https://github.com/rust-lang/crates.io-index"
15
- checksum = "c481bdbf0ed3b892f6f806287d72acd515b352a4ec27a208489b8c1bc839633a"
15
+ checksum = "90583009037521a116abf44494efecd645ba48b6622457080f080b85544e2215"
16
16
  dependencies = [
17
17
  "find-msvc-tools",
18
18
  "shlex",
@@ -41,9 +41,9 @@ dependencies = [
41
41
 
42
42
  [[package]]
43
43
  name = "libc"
44
- version = "0.2.177"
44
+ version = "0.2.178"
45
45
  source = "registry+https://github.com/rust-lang/crates.io-index"
46
- checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
46
+ checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
47
47
 
48
48
  [[package]]
49
49
  name = "memoffset"
@@ -77,9 +77,9 @@ dependencies = [
77
77
 
78
78
  [[package]]
79
79
  name = "pyo3"
80
- version = "0.27.1"
80
+ version = "0.27.2"
81
81
  source = "registry+https://github.com/rust-lang/crates.io-index"
82
- checksum = "37a6df7eab65fc7bee654a421404947e10a0f7085b6951bf2ea395f4659fb0cf"
82
+ checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d"
83
83
  dependencies = [
84
84
  "indoc",
85
85
  "libc",
@@ -94,9 +94,9 @@ dependencies = [
94
94
 
95
95
  [[package]]
96
96
  name = "pyo3-build-config"
97
- version = "0.27.1"
97
+ version = "0.27.2"
98
98
  source = "registry+https://github.com/rust-lang/crates.io-index"
99
- checksum = "f77d387774f6f6eec64a004eac0ed525aab7fa1966d94b42f743797b3e395afb"
99
+ checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6"
100
100
  dependencies = [
101
101
  "python3-dll-a",
102
102
  "target-lexicon",
@@ -104,9 +104,9 @@ dependencies = [
104
104
 
105
105
  [[package]]
106
106
  name = "pyo3-ffi"
107
- version = "0.27.1"
107
+ version = "0.27.2"
108
108
  source = "registry+https://github.com/rust-lang/crates.io-index"
109
- checksum = "2dd13844a4242793e02df3e2ec093f540d948299a6a77ea9ce7afd8623f542be"
109
+ checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089"
110
110
  dependencies = [
111
111
  "libc",
112
112
  "pyo3-build-config",
@@ -114,9 +114,9 @@ dependencies = [
114
114
 
115
115
  [[package]]
116
116
  name = "pyo3-macros"
117
- version = "0.27.1"
117
+ version = "0.27.2"
118
118
  source = "registry+https://github.com/rust-lang/crates.io-index"
119
- checksum = "eaf8f9f1108270b90d3676b8679586385430e5c0bb78bb5f043f95499c821a71"
119
+ checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02"
120
120
  dependencies = [
121
121
  "proc-macro2",
122
122
  "pyo3-macros-backend",
@@ -126,9 +126,9 @@ dependencies = [
126
126
 
127
127
  [[package]]
128
128
  name = "pyo3-macros-backend"
129
- version = "0.27.1"
129
+ version = "0.27.2"
130
130
  source = "registry+https://github.com/rust-lang/crates.io-index"
131
- checksum = "70a3b2274450ba5288bc9b8c1b69ff569d1d61189d4bff38f8d22e03d17f932b"
131
+ checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9"
132
132
  dependencies = [
133
133
  "heck",
134
134
  "proc-macro2",
@@ -198,7 +198,7 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
198
198
 
199
199
  [[package]]
200
200
  name = "unicode-segmentation-rs"
201
- version = "0.2.0"
201
+ version = "0.2.1"
202
202
  dependencies = [
203
203
  "pyo3",
204
204
  "unicode-segmentation",
@@ -15,4 +15,4 @@ license = "MIT"
15
15
  name = "unicode-segmentation-rs"
16
16
  readme = "README.md"
17
17
  repository = "https://github.com/WeblateOrg/unicode-segmentation-rs"
18
- version = "0.2.0"
18
+ version = "0.2.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unicode-segmentation-rs
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -16,7 +16,7 @@ pre-commit = [
16
16
  ]
17
17
  test = [
18
18
  "pytest-github-actions-annotate-failures==0.3.0",
19
- "pytest==9.0.1"
19
+ "pytest==9.0.2"
20
20
  ]
21
21
 
22
22
  [project]
@@ -96,6 +96,9 @@ mod unicode_segmentation_rs {
96
96
  last_chunk.push(chunk_str.remove(0));
97
97
  chunks.push(last_chunk.clone());
98
98
  last_chunk.clear();
99
+ if chunk_str.len() == 0 {
100
+ continue;
101
+ }
99
102
  }
100
103
 
101
104
  let should_merge = last_char.is_some()
@@ -235,3 +235,11 @@ class TestGettextWrap:
235
235
  "\\n",
236
236
  "obhucabhuca ukudibanisa kwakho.</b>",
237
237
  ]
238
+
239
+ def test_wrap_escape_cjk(self):
240
+ text = "在 C# 中,请注意 ``_Process()`` 所采用的 ``delta`` 参数类型是 ``double``\\\\ 。 故当我们将其应用于旋转时,需要将其转换为 ``float`` \\\\。"
241
+ result = unicode_segmentation_rs.gettext_wrap(text, 77)
242
+ assert result == [
243
+ "在 C# 中,请注意 ``_Process()`` 所采用的 ``delta`` 参数类型是 ``double``\\\\ ",
244
+ "。 故当我们将其应用于旋转时,需要将其转换为 ``float`` \\\\。",
245
+ ]