codeset 0.1.0a8__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 +9 -2
- codeset/_models.py +8 -5
- codeset/_version.py +1 -1
- codeset/types/sessions/verify_status_response.py +10 -1
- {codeset-0.1.0a8.dist-info → codeset-0.1.0a10.dist-info}/METADATA +6 -6
- {codeset-0.1.0a8.dist-info → codeset-0.1.0a10.dist-info}/RECORD +8 -8
- {codeset-0.1.0a8.dist-info → codeset-0.1.0a10.dist-info}/WHEEL +0 -0
- {codeset-0.1.0a8.dist-info → codeset-0.1.0a10.dist-info}/licenses/LICENSE +0 -0
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
|
|
442
|
-
meta: tuple[Any, ...] =
|
|
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,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.
|
|
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.
|
|
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
|
-
|
|
38
|
+
<!-- prettier-ignore -->
|
|
39
|
+
[)](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,
|
|
@@ -45,7 +46,7 @@ It is generated with [Stainless](https://www.stainless.com/).
|
|
|
45
46
|
|
|
46
47
|
## Documentation
|
|
47
48
|
|
|
48
|
-
The full API of this library can be found in [api.md](https://github.com/codeset-ai/codeset-sdk/tree/main/api.md).
|
|
49
|
+
The REST API documentation can be found on [docs.codeset.ai](https://docs.codeset.ai). The full API of this library can be found in [api.md](https://github.com/codeset-ai/codeset-sdk/tree/main/api.md).
|
|
49
50
|
|
|
50
51
|
## Installation
|
|
51
52
|
|
|
@@ -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=
|
|
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=
|
|
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=
|
|
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=
|
|
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=
|
|
53
|
-
codeset-0.1.
|
|
54
|
-
codeset-0.1.
|
|
55
|
-
codeset-0.1.
|
|
56
|
-
codeset-0.1.
|
|
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,,
|
|
File without changes
|
|
File without changes
|