backrefs 5.6.post1__tar.gz → 5.8__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 (72) hide show
  1. {backrefs-5.6.post1 → backrefs-5.8}/PKG-INFO +4 -4
  2. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/__meta__.py +1 -1
  3. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/_bre_parse.py +1 -1
  4. backrefs-5.8/backrefs/_bregex_typing.py +6 -0
  5. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/bre.py +19 -26
  6. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/about/changelog.md +12 -3
  7. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/refs.md +2 -2
  8. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/usage.md +1 -1
  9. {backrefs-5.6.post1 → backrefs-5.8}/hatch_build.py +1 -1
  10. {backrefs-5.6.post1 → backrefs-5.8}/mkdocs.yml +34 -3
  11. {backrefs-5.6.post1 → backrefs-5.8}/pyproject.toml +6 -4
  12. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_bre.py +6 -6
  13. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_bregex.py +10 -6
  14. backrefs-5.8/tools/unicodedata/15.1.0.zip +0 -0
  15. backrefs-5.8/tools/unicodedata/16.0.0.zip +0 -0
  16. {backrefs-5.6.post1 → backrefs-5.8}/tools/unipropgen.py +3 -3
  17. backrefs-5.6.post1/backrefs/_bregex_typing.py +0 -13
  18. backrefs-5.6.post1/tools/unicodedata/12.1.0.zip +0 -0
  19. {backrefs-5.6.post1 → backrefs-5.8}/.coveragerc +0 -0
  20. {backrefs-5.6.post1 → backrefs-5.8}/.gitignore +0 -0
  21. {backrefs-5.6.post1 → backrefs-5.8}/.pyspelling.yml +0 -0
  22. {backrefs-5.6.post1 → backrefs-5.8}/LICENSE.md +0 -0
  23. {backrefs-5.6.post1 → backrefs-5.8}/README.md +0 -0
  24. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/__init__.py +0 -0
  25. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/_bregex_parse.py +0 -0
  26. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/bregex.py +0 -0
  27. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/py.typed +0 -0
  28. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/uniprops/__init__.py +0 -0
  29. {backrefs-5.6.post1 → backrefs-5.8}/backrefs/util.py +0 -0
  30. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/.snippets/links.md +0 -0
  31. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/about/contributing.md +0 -0
  32. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/about/license.md +0 -0
  33. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/about/security.md +0 -0
  34. {backrefs-5.6.post1 → backrefs-5.8}/docs/src/markdown/index.md +0 -0
  35. {backrefs-5.6.post1 → backrefs-5.8}/docs/theme/announce.html +0 -0
  36. {backrefs-5.6.post1 → backrefs-5.8}/requirements/docs.txt +0 -0
  37. {backrefs-5.6.post1 → backrefs-5.8}/requirements/lint.txt +0 -0
  38. {backrefs-5.6.post1 → backrefs-5.8}/requirements/test.txt +0 -0
  39. {backrefs-5.6.post1 → backrefs-5.8}/tests/__init__.py +0 -0
  40. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_age.py +0 -0
  41. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_bidiclass.py +0 -0
  42. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_bidipairedbrackettype.py +0 -0
  43. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_binary.py +0 -0
  44. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_block.py +0 -0
  45. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_canonicalcombiningclass.py +0 -0
  46. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_decompositiontype.py +0 -0
  47. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_eastasianwidth.py +0 -0
  48. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_generalcategory.py +0 -0
  49. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_graphemeclusterbreak.py +0 -0
  50. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_hangulsyllabletype.py +0 -0
  51. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_indicpositionalcategory.py +0 -0
  52. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_indicsylabiccategory.py +0 -0
  53. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_joininggroup.py +0 -0
  54. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_joiningtype.py +0 -0
  55. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_linebreak.py +0 -0
  56. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_numerictype.py +0 -0
  57. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_numericvalue.py +0 -0
  58. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_quickcheck.py +0 -0
  59. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_script.py +0 -0
  60. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_scriptextensions.py +0 -0
  61. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_sentencebreak.py +0 -0
  62. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_uniprops.py +0 -0
  63. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_versions.py +0 -0
  64. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_verticalorientation.py +0 -0
  65. {backrefs-5.6.post1 → backrefs-5.8}/tests/test_wordbreak.py +0 -0
  66. {backrefs-5.6.post1 → backrefs-5.8}/tools/__init__.py +0 -0
  67. {backrefs-5.6.post1 → backrefs-5.8}/tools/unicodedata/11.0.0.zip +0 -0
  68. {backrefs-5.6.post1 → backrefs-5.8}/tools/unicodedata/13.0.0.zip +0 -0
  69. {backrefs-5.6.post1 → backrefs-5.8}/tools/unicodedata/14.0.0.zip +0 -0
  70. {backrefs-5.6.post1 → backrefs-5.8}/tools/unicodedata/15.0.0.zip +0 -0
  71. {backrefs-5.6.post1 → backrefs-5.8}/tools/unicodedata/LICENSE +0 -0
  72. {backrefs-5.6.post1 → backrefs-5.8}/tools/unidatadownload.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: backrefs
3
- Version: 5.6.post1
3
+ Version: 5.8
4
4
  Summary: A wrapper around re and regex that adds additional back references.
5
5
  Project-URL: Homepage, https://github.com/facelessuser/backrefs
6
6
  Author-email: Isaac Muse <Isaac.Muse@gmail.com>
@@ -13,14 +13,14 @@ Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.8
17
16
  Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
22
  Classifier: Typing :: Typed
23
- Requires-Python: >=3.8
23
+ Requires-Python: >=3.9
24
24
  Provides-Extra: extras
25
25
  Requires-Dist: regex; extra == 'extras'
26
26
  Description-Content-Type: text/markdown
@@ -193,5 +193,5 @@ def parse_version(ver: str) -> Version:
193
193
  return Version(major, minor, micro, release, pre, post, dev)
194
194
 
195
195
 
196
- __version_info__ = Version(5, 6, 0, "final", post=1)
196
+ __version_info__ = Version(5, 8, 0, "final")
197
197
  __version__ = __version_info__._get_canonical()
@@ -204,7 +204,7 @@ class _SearchParser(Generic[AnyStr]):
204
204
  c = next(i)
205
205
  if c.upper() in _ASCII_LETTERS:
206
206
  prop.append(c)
207
- elif not brackets and c != '{' or brackets and c != ':':
207
+ elif (not brackets and c != '{') or (brackets and c != ':'):
208
208
  raise SyntaxError(f"Unicode property missing '{{' at {i.index - 1}!")
209
209
  else:
210
210
  c = next(i)
@@ -0,0 +1,6 @@
1
+ """Typing objects for the Regex library."""
2
+ import regex # type: ignore[import]
3
+ from typing import _alias # type: ignore[attr-defined]
4
+
5
+ Pattern = _alias(type(regex.compile('')), 1)
6
+ Match = _alias(type(regex.compile('').match('')), 1)
@@ -481,24 +481,22 @@ def match(
481
481
  pattern: AnyStr | Pattern[AnyStr] | Bre[AnyStr],
482
482
  string: AnyStr,
483
483
  flags: int | _re.RegexFlag = 0,
484
- *args: Any,
485
484
  **kwargs: Any
486
485
  ) -> Match[AnyStr] | None:
487
486
  """Apply `match` after applying backrefs."""
488
487
 
489
- return _re.match(_apply_search_backrefs(pattern, flags), string, flags, *args, **kwargs)
488
+ return _re.match(_apply_search_backrefs(pattern, flags), string, flags=flags, **kwargs)
490
489
 
491
490
 
492
491
  def fullmatch(
493
492
  pattern: AnyStr | Pattern[AnyStr] | Bre[AnyStr],
494
493
  string: AnyStr,
495
494
  flags: int | _re.RegexFlag = 0,
496
- *args: Any,
497
495
  **kwargs: Any
498
496
  ) -> Match[AnyStr] | None:
499
497
  """Apply `fullmatch` after applying backrefs."""
500
498
 
501
- return _re.fullmatch(_apply_search_backrefs(pattern, flags), string, flags, *args, **kwargs)
499
+ return _re.fullmatch(_apply_search_backrefs(pattern, flags), string, flags=flags, **kwargs)
502
500
 
503
501
 
504
502
  def split(
@@ -506,36 +504,39 @@ def split(
506
504
  string: AnyStr,
507
505
  maxsplit: int = 0,
508
506
  flags: int | _re.RegexFlag = 0,
509
- *args: Any,
510
507
  **kwargs: Any
511
508
  ) -> list[AnyStr]:
512
509
  """Apply `split` after applying backrefs."""
513
510
 
514
- return _re.split(_apply_search_backrefs(pattern, flags), string, maxsplit, flags, *args, **kwargs)
511
+ return _re.split(
512
+ _apply_search_backrefs(pattern, flags),
513
+ string,
514
+ maxsplit=maxsplit,
515
+ flags=flags,
516
+ **kwargs
517
+ )
515
518
 
516
519
 
517
520
  def findall(
518
521
  pattern: AnyStr | Pattern[AnyStr] | Bre[AnyStr],
519
522
  string: AnyStr,
520
523
  flags: int | _re.RegexFlag = 0,
521
- *args: Any,
522
524
  **kwargs: Any
523
525
  ) -> list[AnyStr] | list[tuple[AnyStr, ...]]:
524
526
  """Apply `findall` after applying backrefs."""
525
527
 
526
- return _re.findall(_apply_search_backrefs(pattern, flags), string, flags, *args, **kwargs)
528
+ return _re.findall(_apply_search_backrefs(pattern, flags), string, flags=flags, **kwargs)
527
529
 
528
530
 
529
531
  def finditer(
530
532
  pattern: AnyStr | Pattern[AnyStr] | Bre[AnyStr],
531
533
  string: AnyStr,
532
534
  flags: int | _re.RegexFlag = 0,
533
- *args: Any,
534
535
  **kwargs: Any
535
536
  ) -> Iterator[Match[AnyStr]]:
536
537
  """Apply `finditer` after applying backrefs."""
537
538
 
538
- return _re.finditer(_apply_search_backrefs(pattern, flags), string, flags, *args, **kwargs)
539
+ return _re.finditer(_apply_search_backrefs(pattern, flags), string, flags=flags, **kwargs)
539
540
 
540
541
 
541
542
  def sub(
@@ -544,7 +545,6 @@ def sub(
544
545
  string: AnyStr,
545
546
  count: int = 0,
546
547
  flags: int | _re.RegexFlag = 0,
547
- *args: Any,
548
548
  **kwargs: Any
549
549
  ) -> AnyStr:
550
550
  """Apply `sub` after applying backrefs."""
@@ -559,9 +559,8 @@ def sub(
559
559
  pattern,
560
560
  (compile_replace(pattern, repl) if is_replace or is_string else repl),
561
561
  string,
562
- count,
563
- 0,
564
- *args,
562
+ count=count,
563
+ flags=0,
565
564
  **kwargs
566
565
  )
567
566
 
@@ -572,7 +571,6 @@ def subf(
572
571
  string: AnyStr,
573
572
  count: int = 0,
574
573
  flags: int | _re.RegexFlag = 0,
575
- *args: Any,
576
574
  **kwargs: Any
577
575
  ) -> AnyStr:
578
576
  """Apply `sub` with format style replace."""
@@ -588,9 +586,8 @@ def subf(
588
586
  pattern,
589
587
  (compile_replace(pattern, repl, flags=rflags) if is_replace or is_string else repl),
590
588
  string,
591
- count,
592
- 0,
593
- *args,
589
+ count=count,
590
+ flags=0,
594
591
  **kwargs
595
592
  )
596
593
 
@@ -601,7 +598,6 @@ def subn(
601
598
  string: AnyStr,
602
599
  count: int = 0,
603
600
  flags: int | _re.RegexFlag = 0,
604
- *args: Any,
605
601
  **kwargs: Any
606
602
  ) -> tuple[AnyStr, int]:
607
603
  """Apply `subn` with format style replace."""
@@ -616,9 +612,8 @@ def subn(
616
612
  pattern,
617
613
  (compile_replace(pattern, repl) if is_replace or is_string else repl),
618
614
  string,
619
- count,
620
- 0,
621
- *args,
615
+ count=count,
616
+ flags=0,
622
617
  **kwargs
623
618
  )
624
619
 
@@ -629,7 +624,6 @@ def subfn(
629
624
  string: AnyStr,
630
625
  count: int = 0,
631
626
  flags: int | _re.RegexFlag = 0,
632
- *args: Any,
633
627
  **kwargs: Any
634
628
  ) -> tuple[AnyStr, int]:
635
629
  """Apply `subn` after applying backrefs."""
@@ -645,9 +639,8 @@ def subfn(
645
639
  pattern,
646
640
  (compile_replace(pattern, repl, flags=rflags) if is_replace or is_string else repl),
647
641
  string,
648
- count,
649
- 0,
650
- *args,
642
+ count=count,
643
+ flags=0,
651
644
  **kwargs
652
645
  )
653
646
 
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.8
4
+
5
+ - **NEW**: Drop Python 3.8.
6
+ - **FIX**: Deprecation warnings.
7
+
8
+ ## 5.7
9
+
10
+ - **NEW**: Add support for Python 3.13 beta.
11
+
3
12
  ## 5.6.post1
4
13
 
5
14
  - **Fix**: Update project metadata to indicate Python 3.12 support.
@@ -42,9 +51,9 @@
42
51
  - **FIX**: Match Re and Regex handling when doing a non-format replacement that references a group that is present in
43
52
  the search pattern but has no actual captures. Such a case should not fail, but simply return an empty string for
44
53
  the group.
45
- - **FIX**: Format replacements that that have groups with no captures will yield an empty string as the only capture
46
- as long as the user does not try to index into any captures as there are no actual captures. This behavior was a bug
47
- in Regex that we duplicated and should now be fixed in the latest Regex (mrabarnett/mrab-regex#439) as well as in
54
+ - **FIX**: Format replacements that have groups with no captures will yield an empty string as the only capture as
55
+ long as the user does not try to index into any captures as there are no actual captures. This behavior was a bug in
56
+ Regex that we duplicated and should now be fixed in the latest Regex (mrabarnett/mrab-regex#439) as well as in
48
57
  Backrefs.
49
58
 
50
59
  ## 5.1
@@ -23,7 +23,7 @@ Back\ References | Description
23
23
  `\P{UnicodeProperty}` | Inverse Unicode property character class. Can be used in character classes `[]`. See [Unicode Properties](#unicode-properties) for more info.
24
24
  `\PX` | Inverse Unicode property character class where `X` is the uppercase letter that represents the General Category property. For instance, `\PL` would be equivalent to `\P{L}` or `\P{Letter}`.
25
25
  `[[:alnum:]]` | Though not really a back reference, support for POSIX style character classes is available. See [POSIX Style Properties](#posix-style-properties) for more info.
26
- `\N{UnicodeName}` | Named characters are are normally ignored in Re, but Backrefs adds support for them.
26
+ `\N{UnicodeName}` | Named characters are normally ignored in Re, but Backrefs adds support for them.
27
27
  `\m` | Start word boundary. Translates to `\b(?=\w)`.
28
28
  `\M` | End word boundary. Translates to `\b(?<=\w)`.
29
29
  `\h` | **Deprecated: Use `\p{Horiz_Space}` instead.** Horizontal whitespace. Equivalent to using `[[:blank:]]` or `[\t\p{Zs}]`.
@@ -73,7 +73,7 @@ Back\ References | Description
73
73
  `\U` | Wide Unicode character `\U00000057`. Re doesn't translate this notation in raw strings (`#!py3 r"..."`), and Regex doesn't in format templates in raw strings (`#!py3 r"{} {}"`). This adds support for them.
74
74
  `\u` | Narrow Unicode character `\u0057`. Re doesn't translate this notation in raw strings (`#!py3 r"..."`), and Regex doesn't in format templates in raw strings (`#!py3 r"{} {}"`). This adds support for them.
75
75
  `\x` | Byte character `\x57`. Re doesn't translate this notation in raw strings (`#!py3 r"..."`), and Regex doesn't in format templates in raw strings (`#!py3 r"{} {}"`). This adds support for them.
76
- `\N{UnicodeName}` | Named characters are are normally ignored in Re, but Backrefs adds support for them.
76
+ `\N{UnicodeName}` | Named characters are normally ignored in Re, but Backrefs adds support for them.
77
77
 
78
78
  /// tip
79
79
  Complex configurations of casing should work fine.
@@ -135,7 +135,7 @@ why.
135
135
  1. Regex's original implementation is very much like it's non-format style replacement accept for two differences: you
136
136
  can access individual captures and you cannot use Python string back references such as specifying Unicode via
137
137
  `\u<code>`, etc. In Backrefs, we've enhanced the syntax -- for both Re and Regex -- to allow back references to work
138
- along side brace replacements. This means you can use string back references and and built-in Backrefs features like
138
+ along side brace replacements. This means you can use string back references and built-in Backrefs features like
139
139
  `\C...\E` or `\L...\E`.
140
140
 
141
141
  ```pycon3
@@ -74,11 +74,11 @@ class CustomMetadataHook(MetadataHookInterface):
74
74
  'License :: OSI Approved :: MIT License',
75
75
  'Operating System :: OS Independent',
76
76
  'Programming Language :: Python :: 3',
77
- 'Programming Language :: Python :: 3.8',
78
77
  'Programming Language :: Python :: 3.9',
79
78
  'Programming Language :: Python :: 3.10',
80
79
  'Programming Language :: Python :: 3.11',
81
80
  'Programming Language :: Python :: 3.12',
81
+ 'Programming Language :: Python :: 3.13',
82
82
  'Topic :: Software Development :: Libraries :: Python Modules',
83
83
  'Typing :: Typed'
84
84
  ]
@@ -77,8 +77,8 @@ markdown_extensions:
77
77
  - pymdownx.caret:
78
78
  - pymdownx.smartsymbols:
79
79
  - pymdownx.emoji:
80
- emoji_index: !!python/name:materialx.emoji.twemoji
81
- emoji_generator: !!python/name:materialx.emoji.to_svg
80
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
81
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
82
82
  - pymdownx.escapeall:
83
83
  hardbreak: True
84
84
  nbsp: True
@@ -114,6 +114,35 @@ markdown_extensions:
114
114
  - example
115
115
  - quote
116
116
  - pymdownx.blocks.details:
117
+ types:
118
+ - name: details-new
119
+ class: new
120
+ - name: details-settings
121
+ class: settings
122
+ - name: details-note
123
+ class: note
124
+ - name: details-abstract
125
+ class: abstract
126
+ - name: details-info
127
+ class: info
128
+ - name: details-tip
129
+ class: tip
130
+ - name: details-success
131
+ class: success
132
+ - name: details-question
133
+ class: question
134
+ - name: details-warning
135
+ class: warning
136
+ - name: details-failure
137
+ class: failure
138
+ - name: details-danger
139
+ class: danger
140
+ - name: details-bug
141
+ class: bug
142
+ - name: details-example
143
+ class: example
144
+ - name: details-quote
145
+ class: quote
117
146
  - pymdownx.blocks.html:
118
147
  - pymdownx.blocks.definition:
119
148
  - pymdownx.blocks.tab:
@@ -128,7 +157,9 @@ extra:
128
157
 
129
158
  plugins:
130
159
  - search
131
- - git-revision-date-localized
160
+ - git-revision-date-localized:
161
+ fallback_to_build_date: true
162
+ strict: false
132
163
  - minify:
133
164
  minify_html: true
134
165
  - mkdocs_pymdownx_material_extras
@@ -9,7 +9,7 @@ name = "backrefs"
9
9
  description = "A wrapper around re and regex that adds additional back references."
10
10
  readme = "README.md"
11
11
  license = "MIT"
12
- requires-python = ">=3.8"
12
+ requires-python = ">=3.9"
13
13
  authors = [
14
14
  { name = "Isaac Muse", email = "Isaac.Muse@gmail.com" },
15
15
  ]
@@ -94,7 +94,7 @@ extend-exclude = [
94
94
  "backrefs/uniprops/unidata/*"
95
95
  ]
96
96
 
97
- select = [
97
+ lint.select = [
98
98
  "A", # flake8-builtins
99
99
  "B", # flake8-bugbear
100
100
  "D", # pydocstyle
@@ -110,7 +110,7 @@ select = [
110
110
  "PERF" # Perflint
111
111
  ]
112
112
 
113
- ignore = [
113
+ lint.ignore = [
114
114
  "B034",
115
115
  "E741",
116
116
  "D202",
@@ -125,6 +125,8 @@ ignore = [
125
125
  "RUF012",
126
126
  "RUF005",
127
127
  "PGH004",
128
+ "RUF022",
129
+ "RUF023",
128
130
  "RUF100"
129
131
  ]
130
132
 
@@ -133,7 +135,7 @@ legacy_tox_ini = """
133
135
  [tox]
134
136
  isolated_build = true
135
137
  envlist =
136
- py38,py39,py310,py311,py312,
138
+ py39,py310,py311,py312,py313,
137
139
  lint
138
140
 
139
141
  [testenv]
@@ -947,17 +947,17 @@ class TestReplaceTemplate(unittest.TestCase):
947
947
  def test_format_conversions(self):
948
948
  """Test string format conversion paths."""
949
949
 
950
- self.assertTrue(bre.subf('test', r'{0.index}', 'test').startswith('<built-in method'))
950
+ self.assertTrue(bre.subf('test', r'{0.index}', 'test').startswith(('<built-in method', '<bound method')))
951
951
  self.assertEqual(bre.subf('test', r'{0.__class__.__name__}', 'test'), 'str')
952
- self.assertTrue(bre.subf('test', r'{0.index!s}', 'test').startswith('<built-in method'))
952
+ self.assertTrue(bre.subf('test', r'{0.index!s}', 'test').startswith(('<built-in method', '<bound method')))
953
953
  self.assertEqual(bre.subf('test', r'{0.__class__.__name__!s}', 'test'), 'str')
954
- self.assertTrue(bre.subf('test', r'{0.index!a}', 'test').startswith('<built-in method'))
954
+ self.assertTrue(bre.subf('test', r'{0.index!a}', 'test').startswith(('<built-in method', '<bound method')))
955
955
 
956
- self.assertTrue(bre.subf(b'test', br'{0.index}', b'test').startswith(b'<built-in method'))
956
+ self.assertTrue(bre.subf(b'test', br'{0.index}', b'test').startswith((b'<built-in method', b'<bound method')))
957
957
  self.assertEqual(bre.subf(b'test', br'{0.__class__.__name__}', b'test'), b'bytes')
958
- self.assertTrue(bre.subf(b'test', br'{0.index!s}', b'test').startswith(b'<built-in method'))
958
+ self.assertTrue(bre.subf(b'test', br'{0.index!s}', b'test').startswith((b'<built-in method', b'<bound method')))
959
959
  self.assertEqual(bre.subf(b'test', br'{0.__class__.__name__!s}', b'test'), b'bytes')
960
- self.assertTrue(bre.subf('test', r'{0.index!a}', 'test').startswith('<built-in method'))
960
+ self.assertTrue(bre.subf('test', r'{0.index!a}', 'test').startswith(('<built-in method', '<bound method')))
961
961
 
962
962
  def test_incompatible_strings(self):
963
963
  """Test incompatible string types."""
@@ -693,17 +693,21 @@ class TestReplaceTemplate(unittest.TestCase):
693
693
  def test_format_conversions(self):
694
694
  """Test string format conversion paths."""
695
695
 
696
- self.assertTrue(bregex.subf('test', r'{0.index}', 'test').startswith('<built-in method'))
696
+ self.assertTrue(bregex.subf('test', r'{0.index}', 'test').startswith(('<built-in method', '<bound method')))
697
697
  self.assertEqual(bregex.subf('test', r'{0.__class__.__name__}', 'test'), 'str')
698
- self.assertTrue(bregex.subf('test', r'{0.index!s}', 'test').startswith('<built-in method'))
698
+ self.assertTrue(bregex.subf('test', r'{0.index!s}', 'test').startswith(('<built-in method', '<bound method')))
699
699
  self.assertEqual(bregex.subf('test', r'{0.__class__.__name__!s}', 'test'), 'str')
700
- self.assertTrue(bregex.subf('test', r'{0.index!a}', 'test').startswith('<built-in method'))
700
+ self.assertTrue(bregex.subf('test', r'{0.index!a}', 'test').startswith(('<built-in method', '<bound method')))
701
701
 
702
- self.assertTrue(bregex.subf(b'test', br'{0.index}', b'test').startswith(b'<built-in method'))
702
+ self.assertTrue(bregex.subf(
703
+ b'test', br'{0.index}', b'test').startswith((b'<built-in method', b'<bound method'))
704
+ )
703
705
  self.assertEqual(bregex.subf(b'test', br'{0.__class__.__name__}', b'test'), b'bytes')
704
- self.assertTrue(bregex.subf(b'test', br'{0.index!s}', b'test').startswith(b'<built-in method'))
706
+ self.assertTrue(
707
+ bregex.subf(b'test', br'{0.index!s}', b'test').startswith((b'<built-in method', b'<bound method'))
708
+ )
705
709
  self.assertEqual(bregex.subf(b'test', br'{0.__class__.__name__!s}', b'test'), b'bytes')
706
- self.assertTrue(bregex.subf('test', r'{0.index!a}', 'test').startswith('<built-in method'))
710
+ self.assertTrue(bregex.subf('test', r'{0.index!a}', 'test').startswith(('<built-in method', '<bound method')))
707
711
 
708
712
  def test_incompatible_strings(self):
709
713
  """Test incompatible string types."""
@@ -744,9 +744,9 @@ def gen_binary(table, output, ascii_props=False, append=False, prefix="", aliase
744
744
  # One off Unicode property found under https://unicode.org/reports/tr18/#Compatibility_Properties
745
745
  # `Word: [\p{alnum}\p{M}\p{Pc}\p{JoinControl}]`
746
746
  s = set(binary["alnum"])
747
- s |= set(table['m']['c'])
748
- s |= set(table['m']['e'])
749
- s |= set(table['m']['n'])
747
+ for k, v in table['m'].items():
748
+ if not k.startswith('^'):
749
+ s |= set(v)
750
750
  s |= set(table["p"]["c"])
751
751
  s |= set(binary["joincontrol"])
752
752
  binary["word"] = list(s)
@@ -1,13 +0,0 @@
1
- """Typing objects for the Regex library."""
2
- from typing import AnyStr
3
- import regex # type: ignore[import]
4
- import sys
5
-
6
- from typing import _alias # type: ignore[attr-defined]
7
-
8
- if sys.version_info >= (3, 9):
9
- Pattern = _alias(type(regex.compile('')), 1)
10
- Match = _alias(type(regex.compile('').match('')), 1)
11
- else:
12
- Pattern = _alias(type(regex.compile('')), AnyStr)
13
- Match = _alias(type(regex.compile('').match('')), AnyStr)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes