strawberry-graphql 0.274.2__py3-none-any.whl → 0.274.3__py3-none-any.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.
@@ -7,7 +7,6 @@ from multiprocessing import Pool, cpu_count
7
7
  from typing import TYPE_CHECKING, Any, Union
8
8
 
9
9
  from libcst.codemod._cli import ExecutionConfig, ExecutionResult, _execute_transform
10
- from libcst.codemod._dummy_pool import DummyPool
11
10
  from rich.progress import Progress
12
11
 
13
12
  from ._fake_progress import FakeProgress
@@ -18,7 +17,6 @@ if TYPE_CHECKING:
18
17
  from libcst.codemod import Codemod
19
18
 
20
19
  ProgressType = Union[type[Progress], type[FakeProgress]]
21
- PoolType = Union[type[Pool], type[DummyPool]] # type: ignore
22
20
 
23
21
 
24
22
  def _get_libcst_version() -> tuple[int, int, int]:
@@ -37,29 +35,21 @@ def _execute_transform_wrap(
37
35
  ) -> ExecutionResult:
38
36
  additional_kwargs: dict[str, Any] = {}
39
37
 
40
- if _get_libcst_version() >= (1, 4, 0):
38
+ libcst_version = _get_libcst_version()
39
+
40
+ if (1, 4, 0) <= libcst_version < (1, 8, 0):
41
41
  additional_kwargs["scratch"] = {}
42
42
 
43
+ if libcst_version >= (1, 8, 0):
44
+ additional_kwargs["original_scratch"] = {}
45
+ additional_kwargs["codemod_args"] = {}
46
+ additional_kwargs["repo_manager"] = None
47
+
43
48
  # TODO: maybe capture warnings?
44
49
  with open(os.devnull, "w") as null, contextlib.redirect_stderr(null): # noqa: PTH123
45
50
  return _execute_transform(**job, **additional_kwargs)
46
51
 
47
52
 
48
- def _get_progress_and_pool(
49
- total_files: int, jobs: int
50
- ) -> tuple[PoolType, ProgressType]:
51
- poll_impl: PoolType = Pool # type: ignore
52
- progress_impl: ProgressType = Progress
53
-
54
- if total_files == 1 or jobs == 1:
55
- poll_impl = DummyPool
56
-
57
- if total_files == 1:
58
- progress_impl = FakeProgress
59
-
60
- return poll_impl, progress_impl
61
-
62
-
63
53
  def run_codemod(
64
54
  codemod: Codemod,
65
55
  files: Sequence[str],
@@ -70,8 +60,6 @@ def run_codemod(
70
60
 
71
61
  config = ExecutionConfig()
72
62
 
73
- pool_impl, progress_impl = _get_progress_and_pool(total, jobs)
74
-
75
63
  tasks = [
76
64
  {
77
65
  "transformer": codemod,
@@ -81,7 +69,7 @@ def run_codemod(
81
69
  for filename in files
82
70
  ]
83
71
 
84
- with pool_impl(processes=jobs) as p, progress_impl() as progress: # type: ignore
72
+ with Pool(processes=jobs) as p, Progress() as progress:
85
73
  task_id = progress.add_task("[cyan]Updating...", total=len(tasks))
86
74
 
87
75
  for result in p.imap_unordered(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: strawberry-graphql
3
- Version: 0.274.2
3
+ Version: 0.274.3
4
4
  Summary: A library for creating GraphQL APIs
5
5
  License: MIT
6
6
  Keywords: graphql,api,rest,starlette,async
@@ -37,9 +37,9 @@ Requires-Dist: channels (>=3.0.5) ; extra == "channels"
37
37
  Requires-Dist: fastapi (>=0.65.2) ; extra == "fastapi"
38
38
  Requires-Dist: flask (>=1.1) ; extra == "flask"
39
39
  Requires-Dist: graphql-core (>=3.2.0,<3.4.0)
40
- Requires-Dist: libcst (>=0.4.7,<1.8.0) ; extra == "cli"
41
- Requires-Dist: libcst (>=0.4.7,<1.8.0) ; extra == "debug"
42
- Requires-Dist: libcst (>=0.4.7,<1.8.0) ; extra == "debug-server"
40
+ Requires-Dist: libcst ; extra == "cli"
41
+ Requires-Dist: libcst ; extra == "debug"
42
+ Requires-Dist: libcst ; extra == "debug-server"
43
43
  Requires-Dist: litestar (>=2) ; (python_version ~= "3.10") and (extra == "litestar")
44
44
  Requires-Dist: opentelemetry-api (<2) ; extra == "opentelemetry"
45
45
  Requires-Dist: opentelemetry-sdk (<2) ; extra == "opentelemetry"
@@ -26,7 +26,7 @@ strawberry/cli/commands/schema_codegen.py,sha256=G6eV08a51sjVxCm3jn75oPn9hC8YarK
26
26
  strawberry/cli/commands/server.py,sha256=qj5wn22HvyJDzwnWzduIWRnS912XvD7GRhPGJkbLaz4,2217
27
27
  strawberry/cli/commands/upgrade/__init__.py,sha256=nY_Cj4yOj3CVdzEPWMAgof-dIr804sEJ-cCVOfI6UWo,2480
28
28
  strawberry/cli/commands/upgrade/_fake_progress.py,sha256=fefLgJwTXe4kG9RntdEJdzkPPRBK_pZqnmMH-pxD85Y,484
29
- strawberry/cli/commands/upgrade/_run_codemod.py,sha256=5xGGaqQZZagiKGyO3mrM1jKaVeTBojW8ktAlpEI4Dfw,2497
29
+ strawberry/cli/commands/upgrade/_run_codemod.py,sha256=LZd5D1PP65bwVZjBvPPVrZ9t-bfvrafZ__HPBrW2WYA,2168
30
30
  strawberry/cli/constants.py,sha256=GhhDZOl9lN4glq50OI1oSbPSGqQXEarZ6r_Grq8pcpI,138
31
31
  strawberry/cli/debug_server.py,sha256=mKxJZf_-SbWWusoFMzT8-E5qTshIx3IuciG6xlC21kI,999
32
32
  strawberry/cli/utils/__init__.py,sha256=5h6QMXbY4zbWVGg8xpsKlgWSEsNgn1fcjbRrJjgzdEc,987
@@ -232,8 +232,8 @@ strawberry/utils/logging.py,sha256=U1cseHGquN09YFhFmRkiphfASKCyK0HUZREImPgVb0c,7
232
232
  strawberry/utils/operation.py,sha256=ZgVOw3K2jQuLjNOYUHauF7itJD0QDNoPw9PBi0IYf6k,1234
233
233
  strawberry/utils/str_converters.py,sha256=-eH1Cl16IO_wrBlsGM-km4IY0IKsjhjnSNGRGOwQjVM,897
234
234
  strawberry/utils/typing.py,sha256=SDvX-Du-9HAV3-XXjqi7Q5f5qPDDFd_gASIITiwBQT4,14073
235
- strawberry_graphql-0.274.2.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
236
- strawberry_graphql-0.274.2.dist-info/METADATA,sha256=wiQIHSo_eBtZMKje2nrJOi6pDCfyovgEXL8bECIeefI,7444
237
- strawberry_graphql-0.274.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
238
- strawberry_graphql-0.274.2.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
239
- strawberry_graphql-0.274.2.dist-info/RECORD,,
235
+ strawberry_graphql-0.274.3.dist-info/LICENSE,sha256=m-XnIVUKqlG_AWnfi9NReh9JfKhYOB-gJfKE45WM1W8,1072
236
+ strawberry_graphql-0.274.3.dist-info/METADATA,sha256=MKO1coLJGJVdouLUvLOLladnxYZbB4SITr4gBdsoTM0,7393
237
+ strawberry_graphql-0.274.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
238
+ strawberry_graphql-0.274.3.dist-info/entry_points.txt,sha256=Nk7-aT3_uEwCgyqtHESV9H6Mc31cK-VAvhnQNTzTb4k,49
239
+ strawberry_graphql-0.274.3.dist-info/RECORD,,