polyglot-piranha 0.3.24__cp311-cp311-manylinux_2_28_x86_64.whl → 0.3.26__cp311-cp311-manylinux_2_28_x86_64.whl

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.
@@ -9,7 +9,12 @@
9
9
  # express or implied. See the License for the specific language governing permissions and
10
10
  # limitations under the License.
11
11
 
12
- from typing import List, Optional
12
+ from __future__ import annotations
13
+ from typing import List, Optional, Literal
14
+
15
+ # Languages that Piranha supports (see ./src/models/language.rs)
16
+ PiranhaLanguage = Literal["java", "kt", "kotlin", "go", "py", "swift", "ts", "tsx", "thrift", "strings", "scm", "scala", "rb", "yaml", "yml"]
17
+
13
18
 
14
19
  def execute_piranha(piranha_argument: PiranhaArguments) -> list[PiranhaOutputSummary]:
15
20
  """
@@ -31,11 +36,11 @@ class PiranhaArguments:
31
36
 
32
37
  def __init__(
33
38
  self,
34
- language: str,
39
+ language: PiranhaLanguage,
35
40
  paths_to_codebase: Optional[List[str]] = None,
36
41
  include: Optional[List[str]] = None,
37
42
  exclude: Optional[List[str]] = None,
38
- substitutions: Optional[dict] = None,
43
+ substitutions: Optional[dict[str, str]] = None,
39
44
  path_to_configurations: Optional[str] = None,
40
45
  rule_graph: Optional[RuleGraph] = None,
41
46
  code_snippet: Optional[str] = None,
@@ -56,7 +61,7 @@ class PiranhaArguments:
56
61
 
57
62
  Parameters
58
63
  ------------
59
- language: str
64
+ language: PiranhaLanguage
60
65
  the target language
61
66
  paths_to_codebase: List[str]
62
67
  Paths to source code folder or file
@@ -141,7 +146,7 @@ class Match:
141
146
  range: Range
142
147
  "Range of the entire AST node captured by the match"
143
148
 
144
- matches: dict
149
+ matches: dict[str, str]
145
150
  "The mapping between tags and string representation of the AST captured"
146
151
  ""
147
152
 
@@ -289,7 +294,7 @@ class RuleGraph:
289
294
  "The rules in the graph"
290
295
  edges: list[OutgoingEdges]
291
296
  "The edges in the graph"
292
- graph: dict
297
+ graph: dict[str, list[tuple[str, str]]]
293
298
  "The graph itself (as an adjacency list)"
294
299
 
295
300
  def __init__(
@@ -1,14 +1,13 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: polyglot_piranha
3
- Version: 0.3.24
3
+ Version: 0.3.26
4
4
  License-File: LICENSE
5
5
  License-File: NOTICE
6
6
  Summary: Polyglot Piranha is a library for performing structural find and replace with deep cleanup.
7
7
  Keywords: refactoring,code update,structural find-replace,structural search and replace,structural search
8
8
  Author: Uber Technologies Inc.
9
- Author-email: Ameya Ketkar <ketkara@uber.com>, Lazaro Clapp <lazaro@uber.com>
10
9
  License: Apache-2.0
11
- Requires-Python: >=3.7
10
+ Requires-Python: >=3.8
12
11
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
13
12
  Project-URL: homepage, https://github.com/uber/piranha
14
13
  Project-URL: documentation, https://github.com/uber/piranha
@@ -37,6 +36,7 @@ To use/build each version, look under the corresponding [lang]/ directory and fo
37
36
 
38
37
  A few additional links on Piranha:
39
38
 
39
+ - Research paper published at [PLDI 2024](https://dl.acm.org/doi/10.1145/3656429) on PolyglotPiranha.
40
40
  - A technical [report](report.pdf) detailing our experiences with using Piranha at Uber.
41
41
  - A [blogpost](https://eng.uber.com/piranha/) presenting more information on Piranha.
42
42
  - 6 minute [video](https://www.youtube.com/watch?v=V5XirDs6LX8&feature=emb_logo) overview of Piranha.
@@ -0,0 +1,9 @@
1
+ polyglot_piranha-0.3.26.dist-info/METADATA,sha256=CK4_803kwj5FxAVXLQ8rboUqlldjHwihK_2rNvGTZmo,3820
2
+ polyglot_piranha-0.3.26.dist-info/WHEEL,sha256=BxjYi4CAn067nWt_tqRI8CdFizpWfxNbIF1H-X2a3_w,108
3
+ polyglot_piranha-0.3.26.dist-info/license_files/LICENSE,sha256=7qqytxojDvLpt8CphcCVvEQilegiJ0x_oDkwHJU-1z4,11359
4
+ polyglot_piranha-0.3.26.dist-info/license_files/NOTICE,sha256=9bEJKCdL0MABjEknpMHXbYBZSkGVGRXYcSxSXS293X0,147
5
+ polyglot_piranha/__init__.py,sha256=pghVgChf0-NgAG_zd7CzKtvFuBDxg5Wh-GcHx2PoTzg,147
6
+ polyglot_piranha/__init__.pyi,sha256=_NdXsm4tmLFvzZYWPdouiH71gJRqKkEU0sezaeoLaG0,10490
7
+ polyglot_piranha/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ polyglot_piranha/polyglot_piranha.cpython-311-x86_64-linux-gnu.so,sha256=7VRD0lDCFL_bnfRarIvXhQJ38q35SzG0o0MZ9C3B3OA,80932264
9
+ polyglot_piranha-0.3.26.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: maturin (1.5.1)
2
+ Generator: maturin (1.7.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-manylinux_2_28_x86_64
@@ -1,9 +0,0 @@
1
- polyglot_piranha-0.3.24.dist-info/METADATA,sha256=T4QXKevqTGiU6ViskgF2JlnLZEU0vCt3JEPhXVDlAgM,3796
2
- polyglot_piranha-0.3.24.dist-info/WHEEL,sha256=gvNBuIBqz-0P3RODYjJHyNMzfoSqPnc825iOCIK9UC0,108
3
- polyglot_piranha-0.3.24.dist-info/license_files/LICENSE,sha256=7qqytxojDvLpt8CphcCVvEQilegiJ0x_oDkwHJU-1z4,11359
4
- polyglot_piranha-0.3.24.dist-info/license_files/NOTICE,sha256=9bEJKCdL0MABjEknpMHXbYBZSkGVGRXYcSxSXS293X0,147
5
- polyglot_piranha/__init__.py,sha256=pghVgChf0-NgAG_zd7CzKtvFuBDxg5Wh-GcHx2PoTzg,147
6
- polyglot_piranha/__init__.pyi,sha256=IFIJFOZatXjQiqIpUY9FsXXeQ2MjoDWAd6MIAGoxyMM,10165
7
- polyglot_piranha/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- polyglot_piranha/polyglot_piranha.cpython-311-x86_64-linux-gnu.so,sha256=YAabfBc-u-nQIDZOU5naShq6FKnvyln-IJBCP9-YOS4,31803280
9
- polyglot_piranha-0.3.24.dist-info/RECORD,,