codeset 0.1.0a9__py3-none-any.whl → 0.1.0a10__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.

Potentially problematic release.


This version of codeset might be problematic. Click here for more details.

codeset/_base_client.py CHANGED
@@ -529,6 +529,15 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
529
529
  # work around https://github.com/encode/httpx/discussions/2880
530
530
  kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
531
531
 
532
+ is_body_allowed = options.method.lower() != "get"
533
+
534
+ if is_body_allowed:
535
+ kwargs["json"] = json_data if is_given(json_data) else None
536
+ kwargs["files"] = files
537
+ else:
538
+ headers.pop("Content-Type", None)
539
+ kwargs.pop("data", None)
540
+
532
541
  # TODO: report this error to httpx
533
542
  return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
534
543
  headers=headers,
@@ -540,8 +549,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
540
549
  # so that passing a `TypedDict` doesn't cause an error.
541
550
  # https://github.com/microsoft/pyright/issues/3526#event-6715453066
542
551
  params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
543
- json=json_data if is_given(json_data) else None,
544
- files=files,
545
552
  **kwargs,
546
553
  )
547
554
 
codeset/_models.py CHANGED
@@ -2,9 +2,10 @@ from __future__ import annotations
2
2
 
3
3
  import os
4
4
  import inspect
5
- from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
5
+ from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
6
6
  from datetime import date, datetime
7
7
  from typing_extensions import (
8
+ List,
8
9
  Unpack,
9
10
  Literal,
10
11
  ClassVar,
@@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
366
367
  if type_ is None:
367
368
  raise RuntimeError(f"Unexpected field type is None for {key}")
368
369
 
369
- return construct_type(value=value, type_=type_)
370
+ return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
370
371
 
371
372
 
372
373
  def is_basemodel(type_: type) -> bool:
@@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
420
421
  return cast(_T, construct_type(value=value, type_=type_))
421
422
 
422
423
 
423
- def construct_type(*, value: object, type_: object) -> object:
424
+ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object:
424
425
  """Loose coercion to the expected type with construction of nested values.
425
426
 
426
427
  If the given value does not match the expected type then it is returned as-is.
@@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object:
438
439
  type_ = type_.__value__ # type: ignore[unreachable]
439
440
 
440
441
  # unwrap `Annotated[T, ...]` -> `T`
441
- if is_annotated_type(type_):
442
- meta: tuple[Any, ...] = get_args(type_)[1:]
442
+ if metadata is not None:
443
+ meta: tuple[Any, ...] = tuple(metadata)
444
+ elif is_annotated_type(type_):
445
+ meta = get_args(type_)[1:]
443
446
  type_ = extract_type_arg(type_, 0)
444
447
  else:
445
448
  meta = tuple()
codeset/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "codeset"
4
- __version__ = "0.1.0-alpha.9" # x-release-please-version
4
+ __version__ = "0.1.0-alpha.10" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- from typing import Optional
3
+ from typing import List, Optional
4
4
  from datetime import datetime
5
5
  from typing_extensions import Literal
6
6
 
@@ -31,6 +31,15 @@ class Result(BaseModel):
31
31
  total: int
32
32
  """Total number of tests executed."""
33
33
 
34
+ failures: Optional[List[object]] = None
35
+ """A list of failed tests with their details."""
36
+
37
+ stderr: Optional[str] = None
38
+ """Standard error from the verifier."""
39
+
40
+ stdout: Optional[str] = None
41
+ """Standard output from the verifier."""
42
+
34
43
  tool: Optional[Literal["test_suite"]] = None
35
44
 
36
45
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: codeset
3
- Version: 0.1.0a9
3
+ Version: 0.1.0a10
4
4
  Summary: The official Python library for the codeset API
5
5
  Project-URL: Homepage, https://github.com/codeset-ai/codeset-sdk
6
6
  Project-URL: Repository, https://github.com/codeset-ai/codeset-sdk
@@ -30,12 +30,13 @@ Requires-Dist: sniffio
30
30
  Requires-Dist: typing-extensions<5,>=4.10
31
31
  Provides-Extra: aiohttp
32
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
33
- Requires-Dist: httpx-aiohttp>=0.1.6; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
34
34
  Description-Content-Type: text/markdown
35
35
 
36
36
  # Codeset Python API library
37
37
 
38
- [![PyPI version](https://github.com/codeset-ai/codeset-sdk/tree/main/<https://img.shields.io/pypi/v/codeset.svg?label=pypi%20(stable)>)](https://pypi.org/project/codeset/)
38
+ <!-- prettier-ignore -->
39
+ [![PyPI version](https://img.shields.io/pypi/v/codeset.svg?label=pypi%20(stable))](https://pypi.org/project/codeset/)
39
40
 
40
41
  The Codeset Python library provides convenient access to the Codeset REST API from any Python 3.8+
41
42
  application. The library includes type definitions for all request params and response fields,
@@ -113,7 +114,6 @@ pip install --pre codeset[aiohttp]
113
114
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
114
115
 
115
116
  ```python
116
- import os
117
117
  import asyncio
118
118
  from codeset import DefaultAioHttpClient
119
119
  from codeset import AsyncCodeset
@@ -121,7 +121,7 @@ from codeset import AsyncCodeset
121
121
 
122
122
  async def main() -> None:
123
123
  async with AsyncCodeset(
124
- api_key=os.environ.get("CODESET_API_KEY"), # This is the default and can be omitted
124
+ api_key="My API Key",
125
125
  http_client=DefaultAioHttpClient(),
126
126
  ) as client:
127
127
  response = await client.health.check()
@@ -1,17 +1,17 @@
1
1
  codeset/__init__.py,sha256=EsK759s1z8FPFqxjNIVx1WaqbYYHOpI2xeHcSNyW30U,2587
2
- codeset/_base_client.py,sha256=AY78tq7Tul-Hwl1Lmw3MCuSJ9WeWTA6UikYi8NSPW4Q,66716
2
+ codeset/_base_client.py,sha256=Vqhki7gPokDLWa_XJl7836E0A1WTG81xTEIWu8KiIdE,66923
3
3
  codeset/_client.py,sha256=bjUU8sUoVdWxTXNrpLaijL-JwucihqzfeEglN_nmH_g,16585
4
4
  codeset/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  codeset/_constants.py,sha256=SiR7F9XqRp2zFGI5kXnK7smZu4Ek80R8bg6EGeH0SqI,464
6
6
  codeset/_exceptions.py,sha256=b6V9pgGqb8KEwAif3Qw9PuGjOr3eCJo25n89ZWBKZlw,3222
7
7
  codeset/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- codeset/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
8
+ codeset/_models.py,sha256=viD5E6aDMhxslcFHDYvkHaKzE8YLcNmsPsMe8STixvs,29294
9
9
  codeset/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  codeset/_resource.py,sha256=MhmvrwixEq6echG2IFv1gO_nE_zfFTNw65s0JjsMee0,1106
11
11
  codeset/_response.py,sha256=lC6V1z6Az0X_Rk9MgwN8hOzYUSEwtp6_py_H3agR04A,28794
12
12
  codeset/_streaming.py,sha256=HqkgFE-gv9S7T4QfGa5pD4suEOvQ8BHZRxJR_NQcXak,10104
13
13
  codeset/_types.py,sha256=vWg2CtlXHiPre02gXyJkXvCkxVygqATc07iCsEZmceA,6198
14
- codeset/_version.py,sha256=3IWEHPhLlSFnm8Zps_QfJqoiYi-kHmnAFYXJM5immdQ,167
14
+ codeset/_version.py,sha256=XWS_h3UKY7sdShxfPzFQBzC6Syei3ehmOjrEKHJCtE0,168
15
15
  codeset/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  codeset/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  codeset/_utils/_logs.py,sha256=3sgppSduJj3mlW7qLTrVdtoy3NXJnuu7MFZrpGzamJQ,777
@@ -49,8 +49,8 @@ codeset/types/session_status.py,sha256=4CueysO0OhBDKgAiVUqnOHIG5VVtbVxFWxaYTLJuX
49
49
  codeset/types/sessions/__init__.py,sha256=hRiBeT3umo01iicnTjI3UOh_Q6AspqzyyG-OEtUiAck,329
50
50
  codeset/types/sessions/job_status.py,sha256=-BwrXSe6dZJaofc2J08HVu1croIV9-C3cURHR947PF4,279
51
51
  codeset/types/sessions/verify_start_response.py,sha256=Dk1iyafuj1IAL39VQji_znUUMxDXI8QXn2QKB-ME4uw,482
52
- codeset/types/sessions/verify_status_response.py,sha256=WI1QkwnsBAYvqjRzD4ewZ0685SwIhTjX6Hber3AadxY,1722
53
- codeset-0.1.0a9.dist-info/METADATA,sha256=BjTP7ahee2FD96eUYnpx2MZinwjruUgk64bGNzx5msA,13483
54
- codeset-0.1.0a9.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
55
- codeset-0.1.0a9.dist-info/licenses/LICENSE,sha256=SzrebAd3MnL58zf3dEBLJvstQvQe33mCCY2TmzKEmY8,11337
56
- codeset-0.1.0a9.dist-info/RECORD,,
52
+ codeset/types/sessions/verify_status_response.py,sha256=hjYWo5nJdsznnPWmfVF0T5Hw9WfB8b06VtkYqhCMX0k,1983
53
+ codeset-0.1.0a10.dist-info/METADATA,sha256=hQAeBzWyx9Wuu2uaWxb8Kni9drUNeOakAfCYRbjdwAs,13382
54
+ codeset-0.1.0a10.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
55
+ codeset-0.1.0a10.dist-info/licenses/LICENSE,sha256=SzrebAd3MnL58zf3dEBLJvstQvQe33mCCY2TmzKEmY8,11337
56
+ codeset-0.1.0a10.dist-info/RECORD,,