Skip to content

Commit a1df919

Browse files
committedJul 30, 2022
Update ocamlformat
1 parent 748e836 commit a1df919

File tree

30 files changed

+15
-234
lines changed

30 files changed

+15
-234
lines changed
 

‎.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎dune-project

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
(>= "v0.15"))
3636
(ocamlformat
3737
(and
38-
(>= "0.21")
39-
(< "0.22")))
38+
(>= "0.23")
39+
(< "0.24")))
4040
(ocaml-lsp-server
4141
(>= "1.13"))
4242
pyml))
@@ -75,8 +75,8 @@
7575
:with-test))
7676
(ocamlformat
7777
(and
78-
(>= "0.21.0")
79-
(< "0.22.0")
78+
(>= "0.23")
79+
(< "0.24")
8080
:with-test))
8181
(ppx_assert
8282
(and

‎examples/attributes/lib/examples_attributes_lib.ml

-8
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@ module Cat : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val create : name:string -> unit -> t
9-
107
val to_string : t -> unit -> string
11-
128
val eat : t -> num_mice:int -> unit -> unit
13-
149
val eat_part : t -> num_mice:float -> unit -> unit
15-
1610
val jump : t -> how_high:int -> unit -> unit
17-
1811
val climb : t -> how_high:int -> unit -> unit
1912

2013
val say_this :
@@ -58,7 +51,6 @@ end = struct
5851
type t = Pytypes.pyobject
5952

6053
let of_pyobject pyo = pyo
61-
6254
let to_pyobject x = x
6355

6456
let create ~name () =

‎examples/embedding_python_source/lib/math.ml

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ module Adder : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t option
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val add : x:int -> y:int -> unit -> int
97
end = struct
108
let filter_opt l = List.filter_map Fun.id l
@@ -35,7 +33,6 @@ end = struct
3533
Py.Object.is_instance pyo py_class
3634

3735
let of_pyobject pyo = if is_instance pyo then Some pyo else None
38-
3936
let to_pyobject x = x
4037

4138
let add ~x ~y () =

‎examples/gen_ml_and_mli/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎examples/gen_ml_and_mli/lib/orange.mli

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ open! Base
33
type t
44

55
val of_pyobject : Pytypes.pyobject -> t Or_error.t
6-
76
val to_pyobject : t -> Pytypes.pyobject
8-
97
val create : flavor:string -> unit -> t Or_error.t
10-
118
val flavor : t -> string

‎examples/gen_ml_and_mli/lib/thing.mli

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ open! Base
33
type t
44

55
val of_pyobject : Pytypes.pyobject -> t Or_error.t
6-
76
val to_pyobject : t -> Pytypes.pyobject
8-
97
val create : name:string -> unit -> t Or_error.t
10-
118
val name : t -> string

‎examples/importing_modules/lib/magic_dust.ml

-10
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ module Hearts : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t option
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val hearts : unit -> string
97
end = struct
108
let filter_opt l = List.filter_map Fun.id l
11-
129
let py_module = lazy (Py.Import.import_module "magic_dust.hearts")
13-
1410
let import_module () = Lazy.force py_module
1511

1612
type t = Pytypes.pyobject
@@ -20,7 +16,6 @@ end = struct
2016
Py.Object.is_instance pyo py_class
2117

2218
let of_pyobject pyo = if is_instance pyo then Some pyo else None
23-
2419
let to_pyobject x = x
2520

2621
let hearts () =
@@ -34,15 +29,11 @@ module Sparkles : sig
3429
type t
3530

3631
val of_pyobject : Pytypes.pyobject -> t option
37-
3832
val to_pyobject : t -> Pytypes.pyobject
39-
4033
val sparkles : unit -> string
4134
end = struct
4235
let filter_opt l = List.filter_map Fun.id l
43-
4436
let py_module = lazy (Py.Import.import_module "magic_dust.sparkles")
45-
4637
let import_module () = Lazy.force py_module
4738

4839
type t = Pytypes.pyobject
@@ -52,7 +43,6 @@ end = struct
5243
Py.Object.is_instance pyo py_class
5344

5445
let of_pyobject pyo = if is_instance pyo then Some pyo else None
55-
5646
let to_pyobject x = x
5747

5848
let sparkles () =

‎examples/importing_modules/lib/silly_math.ml

-8
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ module Add : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t option
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val add : x:int -> y:int -> unit -> int
97
end = struct
108
let filter_opt l = List.filter_map Fun.id l
11-
129
let py_module = lazy (Py.Import.import_module "silly_math.adder.add")
13-
1410
let import_module () = Lazy.force py_module
1511

1612
type t = Pytypes.pyobject
@@ -20,7 +16,6 @@ end = struct
2016
Py.Object.is_instance pyo py_class
2117

2218
let of_pyobject pyo = if is_instance pyo then Some pyo else None
23-
2419
let to_pyobject x = x
2520

2621
let add ~x ~y () =
@@ -35,9 +30,7 @@ module Subtract : sig
3530
type t
3631

3732
val of_pyobject : Pytypes.pyobject -> t option
38-
3933
val to_pyobject : t -> Pytypes.pyobject
40-
4134
val subtract : x:int -> y:int -> unit -> int
4235
end = struct
4336
let filter_opt l = List.filter_map Fun.id l
@@ -54,7 +47,6 @@ end = struct
5447
Py.Object.is_instance pyo py_class
5548

5649
let of_pyobject pyo = if is_instance pyo then Some pyo else None
57-
5850
let to_pyobject x = x
5951

6052
let subtract ~x ~y () =

‎examples/quick_start/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎examples/quick_start/lib.ml

-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ module Adder : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t option
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val add : x:int -> y:int -> unit -> int
97
end = struct
108
let filter_opt l = List.filter_map Fun.id l
11-
129
let py_module = lazy (Py.Import.import_module "adder")
13-
1410
let import_module () = Lazy.force py_module
1511

1612
type t = Pytypes.pyobject
@@ -20,7 +16,6 @@ end = struct
2016
Py.Object.is_instance pyo py_class
2117

2218
let of_pyobject pyo = if is_instance pyo then Some pyo else None
23-
2419
let to_pyobject x = x
2520

2621
let add ~x ~y () =
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎examples/recursive_modules/lib/lib.ml

-16
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ module rec Human : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val create : name:string -> unit -> t
9-
107
val to_string : t -> unit -> string
11-
128
val adopt_cat : t -> cat:Cat.t -> unit -> unit
13-
149
val name : t -> string
15-
1610
val cat : t -> Cat.t
1711
end = struct
1812
let filter_opt l = List.filter_map Fun.id l
@@ -51,7 +45,6 @@ end = struct
5145
type t = Pytypes.pyobject
5246

5347
let of_pyobject pyo = pyo
54-
5548
let to_pyobject x = x
5649

5750
let create ~name () =
@@ -71,25 +64,18 @@ end = struct
7164
ignore @@ Py.Callable.to_function_with_keywords callable [||] kwargs
7265

7366
let name t = Py.String.to_string @@ Py.Object.find_attr_string t "name"
74-
7567
let cat t = Cat.of_pyobject @@ Py.Object.find_attr_string t "cat"
7668
end
7769

7870
and Cat : sig
7971
type t
8072

8173
val of_pyobject : Pytypes.pyobject -> t
82-
8374
val to_pyobject : t -> Pytypes.pyobject
84-
8575
val create : name:string -> unit -> t
86-
8776
val to_string : t -> unit -> string
88-
8977
val adopt_human : t -> human:Human.t -> unit -> unit
90-
9178
val name : t -> string
92-
9379
val human : t -> Human.t
9480
end = struct
9581
let filter_opt l = List.filter_map Fun.id l
@@ -127,7 +113,6 @@ end = struct
127113
type t = Pytypes.pyobject
128114

129115
let of_pyobject pyo = pyo
130-
131116
let to_pyobject x = x
132117

133118
let create ~name () =
@@ -147,6 +132,5 @@ end = struct
147132
ignore @@ Py.Callable.to_function_with_keywords callable [||] kwargs
148133

149134
let name t = Py.String.to_string @@ Py.Object.find_attr_string t "name"
150-
151135
let human t = Human.of_pyobject @@ Py.Object.find_attr_string t "human"
152136
end

‎examples/tuples/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎examples/tuples/lib.ml

-19
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,17 @@ module Tuples : sig
22
type t
33

44
val of_pyobject : Pytypes.pyobject -> t option
5-
65
val to_pyobject : t -> Pytypes.pyobject
7-
86
val pair : x:int -> y:string -> unit -> int * string
9-
107
val identity : x:int * int -> unit -> int * int
11-
128
val first : x:int * int -> unit -> int
13-
149
val make : ?x:int * int -> unit -> int * int
15-
1610
val apple : x:int list -> unit -> int list
17-
1811
val pie_list : x:(int * int) list -> unit -> (int * int) list
19-
2012
val pie_array : x:(int * int) array -> unit -> (int * int) array
21-
2213
val pie_seq : x:(int * int) Seq.t -> unit -> (int * int) Seq.t
23-
2414
val t2 : x:int * string -> unit -> int * string
25-
2615
val t3 : x:int * string * float -> unit -> int * string * float
27-
2816
val t4 : x:int * string * float * bool -> unit -> int * string * float * bool
2917

3018
val t5 :
@@ -60,17 +48,11 @@ module Tuples : sig
6048
(int * int) list
6149
end = struct
6250
let filter_opt l = List.filter_map Fun.id l
63-
6451
let t2_map (a, b) ~fa ~fb = (fa a, fb b)
65-
6652
let t3_map (a, b, c) ~fa ~fb ~fc = (fa a, fb b, fc c)
67-
6853
let t4_map (a, b, c, d) ~fa ~fb ~fc ~fd = (fa a, fb b, fc c, fd d)
69-
7054
let t5_map (a, b, c, d, e) ~fa ~fb ~fc ~fd ~fe = (fa a, fb b, fc c, fd d, fe e)
71-
7255
let py_module = lazy (Py.Import.import_module "tuples")
73-
7456
let import_module () = Lazy.force py_module
7557

7658
type t = Pytypes.pyobject
@@ -80,7 +62,6 @@ end = struct
8062
Py.Object.is_instance pyo py_class
8163

8264
let of_pyobject pyo = if is_instance pyo then Some pyo else None
83-
8465
let to_pyobject x = x
8566

8667
let pair ~x ~y () =

‎pyml_bindgen-dev.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ depends: [
1414
"core" {>= "v0.15"}
1515
"core_bench" {>= "v0.15"}
1616
"core_unix" {>= "v0.15"}
17-
"ocamlformat" {>= "0.21" & < "0.22"}
17+
"ocamlformat" {>= "0.23" & < "0.24"}
1818
"ocaml-lsp-server" {>= "1.13"}
1919
"pyml"
2020
"odoc" {with-doc}

‎pyml_bindgen.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ depends: [
2020
"ocaml" {>= "4.08.0"}
2121
"conf-python-3-dev" {>= "1" & with-test}
2222
"base_quickcheck" {>= "v0.12" & with-test}
23-
"ocamlformat" {>= "0.21.0" & < "0.22.0" & with-test}
23+
"ocamlformat" {>= "0.23" & < "0.24" & with-test}
2424
"ppx_assert" {>= "v0.12" & with-test}
2525
"ppx_inline_test" {>= "v0.12" & with-test}
2626
"ppx_expect" {>= "v0.12" & with-test}

‎test/basic_class_binding.t/run.t

-59
Original file line numberDiff line numberDiff line change
@@ -13,56 +13,38 @@ of_pyobject with no check
1313
$ ocamlformat --enable-outside-detected-project lib.ml
1414
module Silly : sig
1515
type 'a todo = unit -> 'a
16-
1716
type 'a not_implemented = unit -> 'a
18-
1917
type t
2018

2119
val of_pyobject : Pytypes.pyobject -> t
22-
2320
val to_pyobject : t -> Pytypes.pyobject
24-
2521
val __init__ : x:int -> y:int -> unit -> t
26-
2722
val x : t -> int
28-
2923
val y : t -> int
30-
3124
val foo : t -> a:int -> b:int -> unit -> int
32-
3325
val do_nothing : t -> unit -> unit
34-
3526
val return_list : t -> l:string list -> unit -> string list
36-
3727
val return_opt_list : t -> l:string option list -> unit -> string option list
38-
3928
val return_array : t -> a:string array -> unit -> string array
4029

4130
val return_opt_array :
4231
t -> a:string option array -> unit -> string option array
4332

4433
val bar : a:int -> b:int -> unit -> int
45-
4634
val do_nothing2 : unit -> unit
47-
4835
val hello : 'a todo
49-
5036
val world : 'a not_implemented
5137
end = struct
5238
type 'a todo = unit -> 'a
53-
5439
type 'a not_implemented = unit -> 'a
5540

5641
let filter_opt l = List.filter_map Fun.id l
57-
5842
let py_module = lazy (Py.Import.import_module "silly")
59-
6043
let import_module () = Lazy.force py_module
6144

6245
type t = Pytypes.pyobject
6346

6447
let of_pyobject pyo = pyo
65-
6648
let to_pyobject x = x
6749

6850
let __init__ ~x ~y () =
@@ -73,7 +55,6 @@ of_pyobject with no check
7355
of_pyobject @@ Py.Callable.to_function_with_keywords callable [||] kwargs
7456

7557
let x t = Py.Int.to_int @@ Py.Object.find_attr_string t "x"
76-
7758
let y t = Py.Int.to_int @@ Py.Object.find_attr_string t "y"
7859

7960
let foo t ~a ~b () =
@@ -151,7 +132,6 @@ of_pyobject with no check
151132
ignore @@ Py.Callable.to_function_with_keywords callable [||] kwargs
152133

153134
let hello () = failwith "todo: hello"
154-
155135
let world () = failwith "not implemented: world"
156136
end
157137
$ dune exec ./run_no_check.exe 2> /dev/null
@@ -171,50 +151,33 @@ of_pyobject returning option
171151
$ ocamlformat --enable-outside-detected-project lib.ml
172152
module Silly : sig
173153
type 'a todo = unit -> 'a
174-
175154
type 'a not_implemented = unit -> 'a
176-
177155
type t
178156

179157
val of_pyobject : Pytypes.pyobject -> t option
180-
181158
val to_pyobject : t -> Pytypes.pyobject
182-
183159
val __init__ : x:int -> y:int -> unit -> t option
184-
185160
val x : t -> int
186-
187161
val y : t -> int
188-
189162
val foo : t -> a:int -> b:int -> unit -> int
190-
191163
val do_nothing : t -> unit -> unit
192-
193164
val return_list : t -> l:string list -> unit -> string list
194-
195165
val return_opt_list : t -> l:string option list -> unit -> string option list
196-
197166
val return_array : t -> a:string array -> unit -> string array
198167

199168
val return_opt_array :
200169
t -> a:string option array -> unit -> string option array
201170

202171
val bar : a:int -> b:int -> unit -> int
203-
204172
val do_nothing2 : unit -> unit
205-
206173
val hello : 'a todo
207-
208174
val world : 'a not_implemented
209175
end = struct
210176
type 'a todo = unit -> 'a
211-
212177
type 'a not_implemented = unit -> 'a
213178

214179
let filter_opt l = List.filter_map Fun.id l
215-
216180
let py_module = lazy (Py.Import.import_module "silly")
217-
218181
let import_module () = Lazy.force py_module
219182

220183
type t = Pytypes.pyobject
@@ -224,7 +187,6 @@ of_pyobject returning option
224187
Py.Object.is_instance pyo py_class
225188

226189
let of_pyobject pyo = if is_instance pyo then Some pyo else None
227-
228190
let to_pyobject x = x
229191

230192
let __init__ ~x ~y () =
@@ -235,7 +197,6 @@ of_pyobject returning option
235197
of_pyobject @@ Py.Callable.to_function_with_keywords callable [||] kwargs
236198

237199
let x t = Py.Int.to_int @@ Py.Object.find_attr_string t "x"
238-
239200
let y t = Py.Int.to_int @@ Py.Object.find_attr_string t "y"
240201

241202
let foo t ~a ~b () =
@@ -313,7 +274,6 @@ of_pyobject returning option
313274
ignore @@ Py.Callable.to_function_with_keywords callable [||] kwargs
314275

315276
let hello () = failwith "todo: hello"
316-
317277
let world () = failwith "not implemented: world"
318278
end
319279
$ dune exec ./run_option.exe 2> /dev/null
@@ -335,50 +295,33 @@ of_pyobject returning Or_error
335295

336296
module Silly : sig
337297
type 'a todo = unit -> 'a
338-
339298
type 'a not_implemented = unit -> 'a
340-
341299
type t
342300

343301
val of_pyobject : Pytypes.pyobject -> t Or_error.t
344-
345302
val to_pyobject : t -> Pytypes.pyobject
346-
347303
val __init__ : x:int -> y:int -> unit -> t Or_error.t
348-
349304
val x : t -> int
350-
351305
val y : t -> int
352-
353306
val foo : t -> a:int -> b:int -> unit -> int
354-
355307
val do_nothing : t -> unit -> unit
356-
357308
val return_list : t -> l:string list -> unit -> string list
358-
359309
val return_opt_list : t -> l:string option list -> unit -> string option list
360-
361310
val return_array : t -> a:string array -> unit -> string array
362311

363312
val return_opt_array :
364313
t -> a:string option array -> unit -> string option array
365314

366315
val bar : a:int -> b:int -> unit -> int
367-
368316
val do_nothing2 : unit -> unit
369-
370317
val hello : 'a todo
371-
372318
val world : 'a not_implemented
373319
end = struct
374320
type 'a todo = unit -> 'a
375-
376321
type 'a not_implemented = unit -> 'a
377322

378323
let filter_opt = List.filter_opt
379-
380324
let py_module = lazy (Py.Import.import_module "silly")
381-
382325
let import_module () = Lazy.force py_module
383326

384327
type t = Pytypes.pyobject
@@ -401,7 +344,6 @@ of_pyobject returning Or_error
401344
of_pyobject @@ Py.Callable.to_function_with_keywords callable [||] kwargs
402345

403346
let x t = Py.Int.to_int @@ Py.Object.find_attr_string t "x"
404-
405347
let y t = Py.Int.to_int @@ Py.Object.find_attr_string t "y"
406348

407349
let foo t ~a ~b () =
@@ -479,7 +421,6 @@ of_pyobject returning Or_error
479421
ignore @@ Py.Callable.to_function_with_keywords callable [||] kwargs
480422

481423
let hello () = failwith "todo: hello"
482-
483424
let world () = failwith "not implemented: world"
484425
end
485426
$ dune exec ./run_or_error.exe

‎test/binding_tuples.t/run.t

-8
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ Cat the files and run.
2121
type t
2222

2323
val make : int -> string -> t
24-
2524
val to_pyobject : t -> Pytypes.pyobject
26-
2725
val of_pyobject : Pytypes.pyobject -> t
28-
2926
val print_endline : t -> unit
3027
end = struct
3128
type t = int * string
@@ -46,21 +43,16 @@ Cat the files and run.
4643
type t
4744

4845
val of_pyobject : Pytypes.pyobject -> t
49-
5046
val to_pyobject : t -> Pytypes.pyobject
51-
5247
val foo : x:Tuple_int_string.t -> unit -> Tuple_int_string.t
5348
end = struct
5449
let filter_opt l = List.filter_map Fun.id l
55-
5650
let py_module = lazy (Py.Import.import_module "silly")
57-
5851
let import_module () = Lazy.force py_module
5952

6053
type t = Pytypes.pyobject
6154

6255
let of_pyobject pyo = pyo
63-
6456
let to_pyobject x = x
6557

6658
let foo ~x () =

‎test/embed_source.t/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎test/embed_source.t/run.t

-12
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Check the generated source.
4747
type t = Pytypes.pyobject
4848
4949
let of_pyobject pyo = pyo
50-
5150
let to_pyobject x = x
5251
5352
let __init__ ~name ~age () =
@@ -104,7 +103,6 @@ Now try a module inside a package.
104103
type t = Pytypes.pyobject
105104
106105
let of_pyobject pyo = pyo
107-
108106
let to_pyobject x = x
109107
110108
let __init__ ~name ~age () =
@@ -155,23 +153,17 @@ And run it.
155153
type t
156154

157155
val of_pyobject : Pytypes.pyobject -> t
158-
159156
val to_pyobject : t -> Pytypes.pyobject
160-
161157
val __init__ : name:string -> age:int -> unit -> t
162-
163158
val __str__ : t -> unit -> string
164159
end = struct
165160
let filter_opt l = List.filter_map Fun.id l
166-
167161
let py_module = lazy (Py.Import.import_module "person")
168-
169162
let import_module () = Lazy.force py_module
170163

171164
type t = Pytypes.pyobject
172165

173166
let of_pyobject pyo = pyo
174-
175167
let to_pyobject x = x
176168

177169
let __init__ ~name ~age () =
@@ -196,11 +188,8 @@ And run it.
196188
type t
197189

198190
val of_pyobject : Pytypes.pyobject -> t
199-
200191
val to_pyobject : t -> Pytypes.pyobject
201-
202192
val __init__ : color:string -> unit -> t
203-
204193
val __str__ : t -> unit -> string
205194
end = struct
206195
let filter_opt l = List.filter_map Fun.id l
@@ -232,7 +221,6 @@ And run it.
232221
type t = Pytypes.pyobject
233222
234223
let of_pyobject pyo = pyo
235-
236224
let to_pyobject x = x
237225
238226
let __init__ ~color () =

‎test/error_messages.t/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎test/gen_multi.t/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎test/module_function_binding.t/run.t

-9
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ Run
1212
$ pyml_bindgen sigs_no_check.txt silly Silly -r no_check -a module > lib.ml
1313
$ ocamlformat --enable-outside-detected-project lib.ml
1414
let filter_opt l = List.filter_map Fun.id l
15-
1615
let py_module = lazy (Py.Import.import_module "silly")
17-
1816
let import_module () = Lazy.force py_module
1917

2018
type t = Pytypes.pyobject
2119

2220
let of_pyobject pyo = pyo
23-
2421
let to_pyobject x = x
2522

2623
let add ~a ~b () =
@@ -46,23 +43,17 @@ Run
4643
type t
4744

4845
val of_pyobject : Pytypes.pyobject -> t
49-
5046
val to_pyobject : t -> Pytypes.pyobject
51-
5247
val add : a:int -> b:int -> unit -> int
53-
5448
val do_nothing : unit -> unit
5549
end = struct
5650
let filter_opt l = List.filter_map Fun.id l
57-
5851
let py_module = lazy (Py.Import.import_module "silly")
59-
6052
let import_module () = Lazy.force py_module
6153

6254
type t = Pytypes.pyobject
6355

6456
let of_pyobject pyo = pyo
65-
6657
let to_pyobject x = x
6758

6859
let add ~a ~b () =

‎test/nested_submodules.t/run.t

-20
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,18 @@ of_pyobject with no check
1515
type t
1616

1717
val of_pyobject : Pytypes.pyobject -> t
18-
1918
val to_pyobject : t -> Pytypes.pyobject
20-
2119
val __init__ : name:string -> unit -> t
22-
2320
val eat : t -> fly:Creature.Bug.Fly.t -> unit -> unit
24-
2521
val hunger : t -> int
2622
end = struct
2723
let filter_opt l = List.filter_map Fun.id l
28-
2924
let py_module = lazy (Py.Import.import_module "silly")
30-
3125
let import_module () = Lazy.force py_module
3226

3327
type t = Pytypes.pyobject
3428

3529
let of_pyobject pyo = pyo
36-
3730
let to_pyobject x = x
3831

3932
let __init__ ~name () =
@@ -64,19 +57,13 @@ of_pyobject returning option
6457
type t
6558

6659
val of_pyobject : Pytypes.pyobject -> t option
67-
6860
val to_pyobject : t -> Pytypes.pyobject
69-
7061
val __init__ : name:string -> unit -> t option
71-
7262
val eat : t -> fly:Creature.Bug.Fly.t -> unit -> unit
73-
7463
val hunger : t -> int
7564
end = struct
7665
let filter_opt l = List.filter_map Fun.id l
77-
7866
let py_module = lazy (Py.Import.import_module "silly")
79-
8067
let import_module () = Lazy.force py_module
8168

8269
type t = Pytypes.pyobject
@@ -86,7 +73,6 @@ of_pyobject returning option
8673
Py.Object.is_instance pyo py_class
8774

8875
let of_pyobject pyo = if is_instance pyo then Some pyo else None
89-
9076
let to_pyobject x = x
9177

9278
let __init__ ~name () =
@@ -119,19 +105,13 @@ of_pyobject returning Or_error
119105
type t
120106

121107
val of_pyobject : Pytypes.pyobject -> t Or_error.t
122-
123108
val to_pyobject : t -> Pytypes.pyobject
124-
125109
val __init__ : name:string -> unit -> t Or_error.t
126-
127110
val eat : t -> fly:Creature.Bug.Fly.t -> unit -> unit
128-
129111
val hunger : t -> int
130112
end = struct
131113
let filter_opt = List.filter_opt
132-
133114
let py_module = lazy (Py.Import.import_module "silly")
134-
135115
let import_module () = Lazy.force py_module
136116

137117
type t = Pytypes.pyobject

‎test/old_bugs.t/run.t

-7
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,18 @@ Basic usage.
1111
type t
1212

1313
val of_pyobject : Pytypes.pyobject -> t
14-
1514
val to_pyobject : t -> Pytypes.pyobject
16-
1715
val add_feature : t -> pr_name:string -> pr_value:string -> unit -> unit
18-
1916
val add_feature2 : t -> pr_name:string -> pr_value:string -> unit -> unit
20-
2117
val add_feature3 : t -> pr_name:string -> pr_value:string -> unit -> unit
2218
end = struct
2319
let filter_opt l = List.filter_map Fun.id l
24-
2520
let py_module = lazy (Py.Import.import_module "silly_mod")
26-
2721
let import_module () = Lazy.force py_module
2822

2923
type t = Pytypes.pyobject
3024

3125
let of_pyobject pyo = pyo
32-
3326
let to_pyobject x = x
3427

3528
let add_feature t ~pr_name ~pr_value () =

‎test/py_fun_name_attr.t/run.t

-9
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,20 @@ of_pyobject with no check
1515
type t
1616

1717
val of_pyobject : Pytypes.pyobject -> t
18-
1918
val to_pyobject : t -> Pytypes.pyobject
20-
2119
val create : name:string -> unit -> t
22-
2320
val to_string : t -> unit -> string
24-
2521
val eat : t -> num_mice:int -> unit -> unit
26-
2722
val eat_part : t -> num_mice:float -> unit -> unit
28-
2923
val climb : t -> how_high:int -> unit -> unit
3024
end = struct
3125
let filter_opt l = List.filter_map Fun.id l
32-
3326
let py_module = lazy (Py.Import.import_module "silly")
34-
3527
let import_module () = Lazy.force py_module
3628

3729
type t = Pytypes.pyobject
3830

3931
let of_pyobject pyo = pyo
40-
4132
let to_pyobject x = x
4233

4334
let create ~name () =

‎test/raw_pyobjects.t/run.t

-5
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,21 @@ of_pyobject with no check
1515
type t
1616

1717
val of_pyobject : Pytypes.pyobject -> t
18-
1918
val to_pyobject : t -> Pytypes.pyobject
2019

2120
val concat1 :
2221
x:Pytypes.pyobject -> y:Pytypes.pyobject -> unit -> Pytypes.pyobject
2322

2423
val concat2 : x:Py.Object.t -> y:Py.Object.t -> unit -> Py.Object.t
25-
2624
val concat3 : x:int -> y:Py.Object.t -> unit -> int
2725
end = struct
2826
let filter_opt l = List.filter_map Fun.id l
29-
3027
let py_module = lazy (Py.Import.import_module "silly")
31-
3228
let import_module () = Lazy.force py_module
3329

3430
type t = Pytypes.pyobject
3531

3632
let of_pyobject pyo = pyo
37-
3833
let to_pyobject x = x
3934

4035
let concat1 ~x ~y () =

‎test/split_caml_module.t/.ocamlformat

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
profile = default
2-
version = 0.21.0
3-
module-item-spacing = sparse
2+
version = 0.23.0
43
parse-docstrings = true
54
wrap-comments = true

‎test/split_caml_module.t/run.t

-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ With trailing / at end of path.
33
$ pyml_bindgen specs.txt thing Thing --caml-module Thing --split-caml-module a/b/c/
44
$ ocamlformat a/b/c/thing.ml
55
let filter_opt l = List.filter_map Fun.id l
6-
76
let py_module = lazy (Py.Import.import_module "thing")
8-
97
let import_module () = Lazy.force py_module
108

119
type t = Pytypes.pyobject
@@ -15,7 +13,6 @@ With trailing / at end of path.
1513
Py.Object.is_instance pyo py_class
1614

1715
let of_pyobject pyo = if is_instance pyo then Some pyo else None
18-
1916
let to_pyobject x = x
2017

2118
let create ~name () =
@@ -28,11 +25,8 @@ With trailing / at end of path.
2825
type t
2926

3027
val of_pyobject : Pytypes.pyobject -> t option
31-
3228
val to_pyobject : t -> Pytypes.pyobject
33-
3429
val create : name:string -> unit -> t option
35-
3630
val name : t -> string
3731

3832

0 commit comments

Comments
 (0)
Please sign in to comment.