codex-python 0.2.7__tar.gz → 0.2.10__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-python
3
- Version: 0.2.7
3
+ Version: 0.2.10
4
4
  Classifier: Programming Language :: Python :: 3
5
5
  Classifier: Programming Language :: Python :: 3 :: Only
6
6
  Classifier: Programming Language :: Python :: 3.13
@@ -31,4 +31,4 @@ __all__ = [
31
31
  ]
32
32
 
33
33
  # Package version. Kept in sync with Cargo.toml via CI before builds.
34
- __version__ = "0.2.7"
34
+ __version__ = "0.2.10"
@@ -0,0 +1,35 @@
1
+ from typing import Any, cast
2
+
3
+ from codex_native import preview_config as _preview_config
4
+ from codex_native import run_exec_collect as _run_exec_collect
5
+ from codex_native import start_exec_stream as _start_exec_stream
6
+
7
+
8
+ def run_exec_collect(
9
+ prompt: str,
10
+ *,
11
+ config_overrides: dict[str, Any] | None = None,
12
+ load_default_config: bool = True,
13
+ ) -> list[dict]:
14
+ """Run Codex natively (in‑process) and return a list of events as dicts."""
15
+ return cast(list[dict], _run_exec_collect(prompt, config_overrides, load_default_config))
16
+
17
+
18
+ def start_exec_stream(
19
+ prompt: str,
20
+ *,
21
+ config_overrides: dict[str, Any] | None = None,
22
+ load_default_config: bool = True,
23
+ ) -> Any:
24
+ """Return a native streaming iterator over Codex events (dicts)."""
25
+ return _start_exec_stream(prompt, config_overrides, load_default_config)
26
+
27
+
28
+ def preview_config(
29
+ *, config_overrides: dict[str, Any] | None = None, load_default_config: bool = True
30
+ ) -> dict:
31
+ """Return an effective config snapshot (selected fields) from native.
32
+
33
+ Useful for tests to validate override mapping without running Codex.
34
+ """
35
+ return cast(dict, _preview_config(config_overrides, load_default_config))
@@ -121,9 +121,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
121
121
 
122
122
  [[package]]
123
123
  name = "cc"
124
- version = "1.2.36"
124
+ version = "1.2.37"
125
125
  source = "registry+https://github.com/rust-lang/crates.io-index"
126
- checksum = "5252b3d2648e5eedbc1a6f501e3c795e07025c1e93bbf8bbdd6eef7f447a6d54"
126
+ checksum = "65193589c6404eb80b450d618eaf9a2cafaaafd57ecce47370519ef674a7bd44"
127
127
  dependencies = [
128
128
  "find-msvc-tools",
129
129
  "shlex",
@@ -253,15 +253,17 @@ dependencies = [
253
253
 
254
254
  [[package]]
255
255
  name = "codex_native"
256
- version = "0.2.7"
256
+ version = "0.2.10"
257
257
  dependencies = [
258
258
  "anyhow",
259
259
  "codex-core",
260
260
  "codex-protocol",
261
+ "openssl-sys",
261
262
  "pyo3",
262
263
  "serde",
263
264
  "serde_json",
264
265
  "tokio",
266
+ "toml",
265
267
  "tracing",
266
268
  ]
267
269
 
@@ -388,7 +390,7 @@ dependencies = [
388
390
  "libc",
389
391
  "option-ext",
390
392
  "redox_users",
391
- "windows-sys 0.59.0",
393
+ "windows-sys 0.61.0",
392
394
  ]
393
395
 
394
396
  [[package]]
@@ -468,7 +470,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
468
470
  checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
469
471
  dependencies = [
470
472
  "libc",
471
- "windows-sys 0.59.0",
473
+ "windows-sys 0.61.0",
472
474
  ]
473
475
 
474
476
  [[package]]
@@ -869,9 +871,9 @@ dependencies = [
869
871
 
870
872
  [[package]]
871
873
  name = "iana-time-zone"
872
- version = "0.1.63"
874
+ version = "0.1.64"
873
875
  source = "registry+https://github.com/rust-lang/crates.io-index"
874
- checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8"
876
+ checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb"
875
877
  dependencies = [
876
878
  "android_system_properties",
877
879
  "core-foundation-sys",
@@ -1122,9 +1124,9 @@ dependencies = [
1122
1124
 
1123
1125
  [[package]]
1124
1126
  name = "landlock"
1125
- version = "0.4.2"
1127
+ version = "0.4.3"
1126
1128
  source = "registry+https://github.com/rust-lang/crates.io-index"
1127
- checksum = "b3d2ef408b88e913bfc6594f5e693d57676f6463ded7d8bf994175364320c706"
1129
+ checksum = "affe8b77dce5b172f8e290bd801b12832a77cd1942d1ea98259916e89d5829d6"
1128
1130
  dependencies = [
1129
1131
  "enumflags2",
1130
1132
  "libc",
@@ -1145,9 +1147,9 @@ checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
1145
1147
 
1146
1148
  [[package]]
1147
1149
  name = "libredox"
1148
- version = "0.1.9"
1150
+ version = "0.1.10"
1149
1151
  source = "registry+https://github.com/rust-lang/crates.io-index"
1150
- checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3"
1152
+ checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb"
1151
1153
  dependencies = [
1152
1154
  "bitflags 2.9.4",
1153
1155
  "libc",
@@ -1782,7 +1784,7 @@ dependencies = [
1782
1784
  "errno",
1783
1785
  "libc",
1784
1786
  "linux-raw-sys 0.11.0",
1785
- "windows-sys 0.59.0",
1787
+ "windows-sys 0.61.0",
1786
1788
  ]
1787
1789
 
1788
1790
  [[package]]
@@ -1809,9 +1811,9 @@ dependencies = [
1809
1811
 
1810
1812
  [[package]]
1811
1813
  name = "rustls-webpki"
1812
- version = "0.103.4"
1814
+ version = "0.103.5"
1813
1815
  source = "registry+https://github.com/rust-lang/crates.io-index"
1814
- checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc"
1816
+ checksum = "b5a37813727b78798e53c2bec3f5e8fe12a6d6f8389bf9ca7802add4c9905ad8"
1815
1817
  dependencies = [
1816
1818
  "ring",
1817
1819
  "rustls-pki-types",
@@ -1897,18 +1899,28 @@ dependencies = [
1897
1899
 
1898
1900
  [[package]]
1899
1901
  name = "serde"
1900
- version = "1.0.219"
1902
+ version = "1.0.221"
1901
1903
  source = "registry+https://github.com/rust-lang/crates.io-index"
1902
- checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
1904
+ checksum = "341877e04a22458705eb4e131a1508483c877dca2792b3781d4e5d8a6019ec43"
1905
+ dependencies = [
1906
+ "serde_core",
1907
+ "serde_derive",
1908
+ ]
1909
+
1910
+ [[package]]
1911
+ name = "serde_core"
1912
+ version = "1.0.221"
1913
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1914
+ checksum = "0c459bc0a14c840cb403fc14b148620de1e0778c96ecd6e0c8c3cacb6d8d00fe"
1903
1915
  dependencies = [
1904
1916
  "serde_derive",
1905
1917
  ]
1906
1918
 
1907
1919
  [[package]]
1908
1920
  name = "serde_derive"
1909
- version = "1.0.219"
1921
+ version = "1.0.221"
1910
1922
  source = "registry+https://github.com/rust-lang/crates.io-index"
1911
- checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
1923
+ checksum = "d6185cf75117e20e62b1ff867b9518577271e58abe0037c40bb4794969355ab0"
1912
1924
  dependencies = [
1913
1925
  "proc-macro2",
1914
1926
  "quote",
@@ -1917,15 +1929,15 @@ dependencies = [
1917
1929
 
1918
1930
  [[package]]
1919
1931
  name = "serde_json"
1920
- version = "1.0.143"
1932
+ version = "1.0.144"
1921
1933
  source = "registry+https://github.com/rust-lang/crates.io-index"
1922
- checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
1934
+ checksum = "56177480b00303e689183f110b4e727bb4211d692c62d4fcd16d02be93077d40"
1923
1935
  dependencies = [
1924
1936
  "indexmap 2.11.1",
1925
1937
  "itoa",
1926
1938
  "memchr",
1927
1939
  "ryu",
1928
- "serde",
1940
+ "serde_core",
1929
1941
  ]
1930
1942
 
1931
1943
  [[package]]
@@ -1983,9 +1995,9 @@ dependencies = [
1983
1995
 
1984
1996
  [[package]]
1985
1997
  name = "serial2"
1986
- version = "0.2.31"
1998
+ version = "0.2.32"
1987
1999
  source = "registry+https://github.com/rust-lang/crates.io-index"
1988
- checksum = "26e1e5956803a69ddd72ce2de337b577898801528749565def03515f82bad5bb"
2000
+ checksum = "349bb79c63bd2690fe4ca8ef7072a6d9ca36b3a1687a08393e733ea56d573911"
1989
2001
  dependencies = [
1990
2002
  "cfg-if",
1991
2003
  "libc",
@@ -2190,7 +2202,7 @@ dependencies = [
2190
2202
  "getrandom 0.3.3",
2191
2203
  "once_cell",
2192
2204
  "rustix 1.1.2",
2193
- "windows-sys 0.59.0",
2205
+ "windows-sys 0.61.0",
2194
2206
  ]
2195
2207
 
2196
2208
  [[package]]
@@ -2795,9 +2807,9 @@ dependencies = [
2795
2807
 
2796
2808
  [[package]]
2797
2809
  name = "wildmatch"
2798
- version = "2.4.0"
2810
+ version = "2.5.0"
2799
2811
  source = "registry+https://github.com/rust-lang/crates.io-index"
2800
- checksum = "68ce1ab1f8c62655ebe1350f589c61e505cf94d385bc6a12899442d9081e71fd"
2812
+ checksum = "39b7d07a236abaef6607536ccfaf19b396dbe3f5110ddb73d39f4562902ed382"
2801
2813
 
2802
2814
  [[package]]
2803
2815
  name = "winapi"
@@ -2821,7 +2833,7 @@ version = "0.1.11"
2821
2833
  source = "registry+https://github.com/rust-lang/crates.io-index"
2822
2834
  checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
2823
2835
  dependencies = [
2824
- "windows-sys 0.59.0",
2836
+ "windows-sys 0.61.0",
2825
2837
  ]
2826
2838
 
2827
2839
  [[package]]
@@ -2832,15 +2844,15 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
2832
2844
 
2833
2845
  [[package]]
2834
2846
  name = "windows-core"
2835
- version = "0.61.2"
2847
+ version = "0.62.0"
2836
2848
  source = "registry+https://github.com/rust-lang/crates.io-index"
2837
- checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
2849
+ checksum = "57fe7168f7de578d2d8a05b07fd61870d2e73b4020e9f49aa00da8471723497c"
2838
2850
  dependencies = [
2839
2851
  "windows-implement",
2840
2852
  "windows-interface",
2841
- "windows-link 0.1.3",
2842
- "windows-result",
2843
- "windows-strings",
2853
+ "windows-link 0.2.0",
2854
+ "windows-result 0.4.0",
2855
+ "windows-strings 0.5.0",
2844
2856
  ]
2845
2857
 
2846
2858
  [[package]]
@@ -2884,8 +2896,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
2884
2896
  checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
2885
2897
  dependencies = [
2886
2898
  "windows-link 0.1.3",
2887
- "windows-result",
2888
- "windows-strings",
2899
+ "windows-result 0.3.4",
2900
+ "windows-strings 0.4.2",
2889
2901
  ]
2890
2902
 
2891
2903
  [[package]]
@@ -2897,6 +2909,15 @@ dependencies = [
2897
2909
  "windows-link 0.1.3",
2898
2910
  ]
2899
2911
 
2912
+ [[package]]
2913
+ name = "windows-result"
2914
+ version = "0.4.0"
2915
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2916
+ checksum = "7084dcc306f89883455a206237404d3eaf961e5bd7e0f312f7c91f57eb44167f"
2917
+ dependencies = [
2918
+ "windows-link 0.2.0",
2919
+ ]
2920
+
2900
2921
  [[package]]
2901
2922
  name = "windows-strings"
2902
2923
  version = "0.4.2"
@@ -2906,6 +2927,15 @@ dependencies = [
2906
2927
  "windows-link 0.1.3",
2907
2928
  ]
2908
2929
 
2930
+ [[package]]
2931
+ name = "windows-strings"
2932
+ version = "0.5.0"
2933
+ source = "registry+https://github.com/rust-lang/crates.io-index"
2934
+ checksum = "7218c655a553b0bed4426cf54b20d7ba363ef543b52d515b3e48d7fd55318dda"
2935
+ dependencies = [
2936
+ "windows-link 0.2.0",
2937
+ ]
2938
+
2909
2939
  [[package]]
2910
2940
  name = "windows-sys"
2911
2941
  version = "0.52.0"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "codex_native"
3
- version = "0.2.7"
3
+ version = "0.2.10"
4
4
  edition = "2021"
5
5
 
6
6
  [lib]
@@ -8,10 +8,11 @@ name = "codex_native"
8
8
  crate-type = ["cdylib"]
9
9
 
10
10
  [dependencies]
11
- pyo3 = { version = "0.26", features = ["extension-module"] }
11
+ pyo3 = { version = "0.26", features = ["extension-module", "abi3-py312"] }
12
12
  anyhow = "1"
13
13
  serde = { version = "1", features = ["derive"] }
14
14
  serde_json = "1"
15
+ toml = "0.9"
15
16
  tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal", "process", "time"] }
16
17
  tracing = "0.1"
17
18
 
@@ -24,3 +25,16 @@ codex-protocol = { git = "https://github.com/openai/codex", package = "codex-pro
24
25
  [package.metadata.maturin]
25
26
  python-source = "../../"
26
27
  name = "codex-python"
28
+
29
+ # Ensure OpenSSL is available during manylinux (glibc) builds by vendoring it.
30
+ # Upstream codex-core vendors OpenSSL for musl targets; extend that to glibc
31
+ # so Docker images don't need system openssl-devel. This avoids the
32
+ # "Could not find directory of OpenSSL installation" error from openssl-sys.
33
+ [target.x86_64-unknown-linux-gnu.dependencies]
34
+ openssl-sys = { version = "*", features = ["vendored"] }
35
+
36
+ [target.aarch64-unknown-linux-gnu.dependencies]
37
+ openssl-sys = { version = "*", features = ["vendored"] }
38
+
39
+ # Prefer rustls over native-tls/openssl across the dependency graph
40
+ # to avoid OpenSSL toolchain requirements inside manylinux containers.
@@ -1,56 +0,0 @@
1
- from typing import Any, cast
2
-
3
- try:
4
- from codex_native import preview_config as _preview_config
5
- from codex_native import run_exec_collect as _run_exec_collect
6
- from codex_native import start_exec_stream as _start_exec_stream
7
- except Exception as _e: # pragma: no cover - optional native path
8
- _run_exec_collect = None
9
- _start_exec_stream = None
10
- _preview_config = None
11
-
12
-
13
- def run_exec_collect(
14
- prompt: str,
15
- *,
16
- config_overrides: dict[str, Any] | None = None,
17
- load_default_config: bool = True,
18
- ) -> list[dict]:
19
- """Run Codex natively (in‑process) and return a list of events as dicts.
20
-
21
- Requires the native extension to be built/installed (see `make dev-native`).
22
- Falls back to raising if the extension is not available.
23
- """
24
- if _run_exec_collect is None:
25
- raise RuntimeError(
26
- "codex_native extension not installed. Run `make dev-native` or build wheels via maturin."
27
- )
28
- return cast(list[dict], _run_exec_collect(prompt, config_overrides, load_default_config))
29
-
30
-
31
- def start_exec_stream(
32
- prompt: str,
33
- *,
34
- config_overrides: dict[str, Any] | None = None,
35
- load_default_config: bool = True,
36
- ) -> Any:
37
- """Return a native streaming iterator over Codex events (dicts)."""
38
- if _start_exec_stream is None:
39
- raise RuntimeError(
40
- "codex_native extension not installed. Run `make dev-native` or build wheels via maturin."
41
- )
42
- return _start_exec_stream(prompt, config_overrides, load_default_config)
43
-
44
-
45
- def preview_config(
46
- *, config_overrides: dict[str, Any] | None = None, load_default_config: bool = True
47
- ) -> dict:
48
- """Return an effective config snapshot (selected fields) from native.
49
-
50
- Useful for tests to validate override mapping without running Codex.
51
- """
52
- if _preview_config is None: # pragma: no cover
53
- raise RuntimeError(
54
- "codex_native extension not installed. Run `make dev-native` or build wheels via maturin."
55
- )
56
- return cast(dict, _preview_config(config_overrides, load_default_config))
File without changes
File without changes
File without changes