promql-parser 0.4.1__tar.gz → 0.4.2__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.
@@ -5,7 +5,7 @@ on:
5
5
  branches:
6
6
  - main
7
7
  tags:
8
- - 'v*'
8
+ - "v*"
9
9
  pull_request:
10
10
  workflow_dispatch:
11
11
 
@@ -17,16 +17,29 @@ jobs:
17
17
  linux:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
- - uses: actions/checkout@v3
21
- - uses: PyO3/maturin-action@v1
22
- with:
23
- manylinux: auto
24
- args: --release --sdist -o dist --find-interpreter
25
- - name: Upload wheels
26
- uses: actions/upload-artifact@v3
27
- with:
28
- name: wheels
29
- path: dist
20
+ - uses: actions/checkout@v3
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: |
24
+ 3.8
25
+ 3.9
26
+ 3.10
27
+ 3.11
28
+ 3.12
29
+ 3.13
30
+ - uses: PyO3/maturin-action@v1
31
+ with:
32
+ manylinux: auto
33
+ args: --release --sdist -o dist --find-interpreter
34
+ - uses: PyO3/maturin-action@v1
35
+ with:
36
+ manylinux: auto
37
+ args: --release -o dist -i python3.13t
38
+ - name: Upload wheels
39
+ uses: actions/upload-artifact@v3
40
+ with:
41
+ name: wheels
42
+ path: dist
30
43
 
31
44
  musllinux:
32
45
  runs-on: ubuntu-latest
@@ -46,7 +59,7 @@ jobs:
46
59
  with:
47
60
  target: ${{ matrix.target }}
48
61
  manylinux: musllinux_1_2
49
- args: --release --out dist -i 3.7 3.8 3.9 3.10 3.11 3.12
62
+ args: --release --out dist --find-interpreter
50
63
  sccache: true
51
64
  - name: Install built wheel
52
65
  if: matrix.target == 'x86_64-unknown-linux-musl'
@@ -86,7 +99,7 @@ jobs:
86
99
  manylinux: musllinux_1_2
87
100
  args: --release --out dist --find-interpreter
88
101
  sccache: true
89
- - uses: uraimo/run-on-arch-action@v2.3.0
102
+ - uses: uraimo/run-on-arch-action@v2.8.1
90
103
  name: Install built wheel
91
104
  with:
92
105
  arch: ${{ matrix.platform.arch }}
@@ -107,29 +120,53 @@ jobs:
107
120
  windows:
108
121
  runs-on: windows-latest
109
122
  steps:
110
- - uses: actions/checkout@v3
111
- - uses: PyO3/maturin-action@v1
112
- with:
113
- args: --release -o dist --find-interpreter
114
- - name: Upload wheels
115
- uses: actions/upload-artifact@v3
116
- with:
117
- name: wheels
118
- path: dist
123
+ - uses: actions/checkout@v3
124
+ - uses: actions/setup-python@v5
125
+ with:
126
+ python-version: |
127
+ 3.8
128
+ 3.9
129
+ 3.10
130
+ 3.11
131
+ 3.12
132
+ 3.13
133
+ - uses: PyO3/maturin-action@v1
134
+ with:
135
+ args: --release -o dist --find-interpreter
136
+ - uses: PyO3/maturin-action@v1
137
+ with:
138
+ args: --release -o dist -i python3.13t
139
+ - name: Upload wheels
140
+ uses: actions/upload-artifact@v3
141
+ with:
142
+ name: wheels
143
+ path: dist
119
144
 
120
145
  macos:
121
146
  runs-on: macos-latest
122
147
  steps:
123
- - uses: actions/checkout@v3
124
- - uses: PyO3/maturin-action@v1
125
- with:
126
- target: universal2-apple-darwin
127
- args: --release -o dist --find-interpreter
128
- - name: Upload wheels
129
- uses: actions/upload-artifact@v3
130
- with:
131
- name: wheels
132
- path: dist
148
+ - uses: actions/checkout@v3
149
+ - uses: actions/setup-python@v5
150
+ with:
151
+ python-version: |
152
+ 3.8
153
+ 3.9
154
+ 3.10
155
+ 3.11
156
+ 3.12
157
+ 3.13
158
+ - uses: PyO3/maturin-action@v1
159
+ with:
160
+ target: universal2-apple-darwin
161
+ args: --release -o dist --find-interpreter
162
+ - uses: PyO3/maturin-action@v1
163
+ with:
164
+ args: --release -o dist -i python3.13t
165
+ - name: Upload wheels
166
+ uses: actions/upload-artifact@v3
167
+ with:
168
+ name: wheels
169
+ path: dist
133
170
 
134
171
  release:
135
172
  name: Release
@@ -1,6 +1,6 @@
1
1
  # This file is automatically @generated by Cargo.
2
2
  # It is not intended for manual editing.
3
- version = 3
3
+ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "aho-corasick"
@@ -11,17 +11,32 @@ dependencies = [
11
11
  "memchr",
12
12
  ]
13
13
 
14
+ [[package]]
15
+ name = "android-tzdata"
16
+ version = "0.1.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
19
+
20
+ [[package]]
21
+ name = "android_system_properties"
22
+ version = "0.1.5"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
25
+ dependencies = [
26
+ "libc",
27
+ ]
28
+
14
29
  [[package]]
15
30
  name = "anyhow"
16
- version = "1.0.86"
31
+ version = "1.0.94"
17
32
  source = "registry+https://github.com/rust-lang/crates.io-index"
18
- checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
33
+ checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7"
19
34
 
20
35
  [[package]]
21
36
  name = "autocfg"
22
- version = "1.3.0"
37
+ version = "1.4.0"
23
38
  source = "registry+https://github.com/rust-lang/crates.io-index"
24
- checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
39
+ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
25
40
 
26
41
  [[package]]
27
42
  name = "bincode"
@@ -34,15 +49,15 @@ dependencies = [
34
49
 
35
50
  [[package]]
36
51
  name = "bitflags"
37
- version = "1.3.2"
52
+ version = "2.6.0"
38
53
  source = "registry+https://github.com/rust-lang/crates.io-index"
39
- checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
54
+ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
40
55
 
41
56
  [[package]]
42
- name = "bitflags"
43
- version = "2.5.0"
57
+ name = "bumpalo"
58
+ version = "3.16.0"
44
59
  source = "registry+https://github.com/rust-lang/crates.io-index"
45
- checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
60
+ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
46
61
 
47
62
  [[package]]
48
63
  name = "cactus"
@@ -50,6 +65,15 @@ version = "1.0.7"
50
65
  source = "registry+https://github.com/rust-lang/crates.io-index"
51
66
  checksum = "acbc26382d871df4b7442e3df10a9402bf3cf5e55cbd66f12be38861425f0564"
52
67
 
68
+ [[package]]
69
+ name = "cc"
70
+ version = "1.2.2"
71
+ source = "registry+https://github.com/rust-lang/crates.io-index"
72
+ checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc"
73
+ dependencies = [
74
+ "shlex",
75
+ ]
76
+
53
77
  [[package]]
54
78
  name = "cfg-if"
55
79
  version = "1.0.0"
@@ -58,9 +82,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
58
82
 
59
83
  [[package]]
60
84
  name = "cfgrammar"
61
- version = "0.13.7"
85
+ version = "0.13.8"
62
86
  source = "registry+https://github.com/rust-lang/crates.io-index"
63
- checksum = "6026d8cd82ada8bbcfe337805dd1eb6afdc9e80fa4d57e977b3a36315e0c5525"
87
+ checksum = "6d621f687a04efa1f269f1cd13d8cfea9660852bdb3d1cd2c3c9fb6fdd34daf2"
64
88
  dependencies = [
65
89
  "indexmap",
66
90
  "lazy_static",
@@ -76,9 +100,20 @@ version = "0.4.38"
76
100
  source = "registry+https://github.com/rust-lang/crates.io-index"
77
101
  checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
78
102
  dependencies = [
103
+ "android-tzdata",
104
+ "iana-time-zone",
105
+ "js-sys",
79
106
  "num-traits",
107
+ "wasm-bindgen",
108
+ "windows-targets",
80
109
  ]
81
110
 
111
+ [[package]]
112
+ name = "core-foundation-sys"
113
+ version = "0.8.7"
114
+ source = "registry+https://github.com/rust-lang/crates.io-index"
115
+ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
116
+
82
117
  [[package]]
83
118
  name = "deranged"
84
119
  version = "0.3.11"
@@ -96,13 +131,13 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
96
131
 
97
132
  [[package]]
98
133
  name = "filetime"
99
- version = "0.2.23"
134
+ version = "0.2.25"
100
135
  source = "registry+https://github.com/rust-lang/crates.io-index"
101
- checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd"
136
+ checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586"
102
137
  dependencies = [
103
138
  "cfg-if",
104
139
  "libc",
105
- "redox_syscall 0.4.1",
140
+ "libredox",
106
141
  "windows-sys",
107
142
  ]
108
143
 
@@ -123,21 +158,44 @@ dependencies = [
123
158
 
124
159
  [[package]]
125
160
  name = "hashbrown"
126
- version = "0.14.5"
161
+ version = "0.15.2"
127
162
  source = "registry+https://github.com/rust-lang/crates.io-index"
128
- checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
163
+ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
129
164
 
130
165
  [[package]]
131
166
  name = "heck"
132
- version = "0.4.1"
167
+ version = "0.5.0"
168
+ source = "registry+https://github.com/rust-lang/crates.io-index"
169
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
170
+
171
+ [[package]]
172
+ name = "iana-time-zone"
173
+ version = "0.1.61"
174
+ source = "registry+https://github.com/rust-lang/crates.io-index"
175
+ checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220"
176
+ dependencies = [
177
+ "android_system_properties",
178
+ "core-foundation-sys",
179
+ "iana-time-zone-haiku",
180
+ "js-sys",
181
+ "wasm-bindgen",
182
+ "windows-core",
183
+ ]
184
+
185
+ [[package]]
186
+ name = "iana-time-zone-haiku"
187
+ version = "0.1.2"
133
188
  source = "registry+https://github.com/rust-lang/crates.io-index"
134
- checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
189
+ checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
190
+ dependencies = [
191
+ "cc",
192
+ ]
135
193
 
136
194
  [[package]]
137
195
  name = "indexmap"
138
- version = "2.2.6"
196
+ version = "2.7.0"
139
197
  source = "registry+https://github.com/rust-lang/crates.io-index"
140
- checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
198
+ checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f"
141
199
  dependencies = [
142
200
  "equivalent",
143
201
  "hashbrown",
@@ -151,37 +209,54 @@ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
151
209
 
152
210
  [[package]]
153
211
  name = "itoa"
154
- version = "1.0.11"
212
+ version = "1.0.14"
155
213
  source = "registry+https://github.com/rust-lang/crates.io-index"
156
- checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
214
+ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
215
+
216
+ [[package]]
217
+ name = "js-sys"
218
+ version = "0.3.74"
219
+ source = "registry+https://github.com/rust-lang/crates.io-index"
220
+ checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705"
221
+ dependencies = [
222
+ "once_cell",
223
+ "wasm-bindgen",
224
+ ]
157
225
 
158
226
  [[package]]
159
227
  name = "lazy_static"
160
- version = "1.4.0"
228
+ version = "1.5.0"
161
229
  source = "registry+https://github.com/rust-lang/crates.io-index"
162
- checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
230
+ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
163
231
 
164
232
  [[package]]
165
233
  name = "libc"
166
- version = "0.2.155"
234
+ version = "0.2.167"
167
235
  source = "registry+https://github.com/rust-lang/crates.io-index"
168
- checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
236
+ checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc"
169
237
 
170
238
  [[package]]
171
- name = "lock_api"
172
- version = "0.4.12"
239
+ name = "libredox"
240
+ version = "0.1.3"
173
241
  source = "registry+https://github.com/rust-lang/crates.io-index"
174
- checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
242
+ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
175
243
  dependencies = [
176
- "autocfg",
177
- "scopeguard",
244
+ "bitflags",
245
+ "libc",
246
+ "redox_syscall",
178
247
  ]
179
248
 
249
+ [[package]]
250
+ name = "log"
251
+ version = "0.4.22"
252
+ source = "registry+https://github.com/rust-lang/crates.io-index"
253
+ checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
254
+
180
255
  [[package]]
181
256
  name = "lrlex"
182
- version = "0.13.7"
257
+ version = "0.13.8"
183
258
  source = "registry+https://github.com/rust-lang/crates.io-index"
184
- checksum = "05863fdac293d1bc74f0cd91512933a5ab67e0cb607dc78ac4984be089456b49"
259
+ checksum = "6fe1e8741f737ba4b6d781f716051df6375ff0488d57ee23822a2cdba1c3dc7a"
185
260
  dependencies = [
186
261
  "cfgrammar",
187
262
  "getopts",
@@ -197,9 +272,9 @@ dependencies = [
197
272
 
198
273
  [[package]]
199
274
  name = "lrpar"
200
- version = "0.13.7"
275
+ version = "0.13.8"
201
276
  source = "registry+https://github.com/rust-lang/crates.io-index"
202
- checksum = "3b1ecae55cf667db308d3555e22b20bcc28eaeca0c95a09b37171673be157c71"
277
+ checksum = "19c61bcff4c1dd2deb9567ea868237828a8cd179c3f64106f6726656e372421d"
203
278
  dependencies = [
204
279
  "bincode",
205
280
  "cactus",
@@ -219,9 +294,9 @@ dependencies = [
219
294
 
220
295
  [[package]]
221
296
  name = "lrtable"
222
- version = "0.13.7"
297
+ version = "0.13.8"
223
298
  source = "registry+https://github.com/rust-lang/crates.io-index"
224
- checksum = "d42d2752cb50a171efadda0cb6fa97432e8bf05accfff3eed320b87e80a2f69e"
299
+ checksum = "49e35162de3a5d91b380f8ebb31fc6c5e9a4618276465df4725ff1f88613312b"
225
300
  dependencies = [
226
301
  "cfgrammar",
227
302
  "fnv",
@@ -272,9 +347,9 @@ dependencies = [
272
347
 
273
348
  [[package]]
274
349
  name = "once_cell"
275
- version = "1.19.0"
350
+ version = "1.20.2"
276
351
  source = "registry+https://github.com/rust-lang/crates.io-index"
277
- checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
352
+ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
278
353
 
279
354
  [[package]]
280
355
  name = "packedvec"
@@ -286,34 +361,11 @@ dependencies = [
286
361
  "serde",
287
362
  ]
288
363
 
289
- [[package]]
290
- name = "parking_lot"
291
- version = "0.12.3"
292
- source = "registry+https://github.com/rust-lang/crates.io-index"
293
- checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
294
- dependencies = [
295
- "lock_api",
296
- "parking_lot_core",
297
- ]
298
-
299
- [[package]]
300
- name = "parking_lot_core"
301
- version = "0.9.10"
302
- source = "registry+https://github.com/rust-lang/crates.io-index"
303
- checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
304
- dependencies = [
305
- "cfg-if",
306
- "libc",
307
- "redox_syscall 0.5.2",
308
- "smallvec",
309
- "windows-targets",
310
- ]
311
-
312
364
  [[package]]
313
365
  name = "portable-atomic"
314
- version = "1.6.0"
366
+ version = "1.10.0"
315
367
  source = "registry+https://github.com/rust-lang/crates.io-index"
316
- checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
368
+ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
317
369
 
318
370
  [[package]]
319
371
  name = "powerfmt"
@@ -323,20 +375,21 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
323
375
 
324
376
  [[package]]
325
377
  name = "proc-macro2"
326
- version = "1.0.85"
378
+ version = "1.0.92"
327
379
  source = "registry+https://github.com/rust-lang/crates.io-index"
328
- checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23"
380
+ checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
329
381
  dependencies = [
330
382
  "unicode-ident",
331
383
  ]
332
384
 
333
385
  [[package]]
334
386
  name = "promql-parser"
335
- version = "0.4.0"
387
+ version = "0.4.3"
336
388
  source = "registry+https://github.com/rust-lang/crates.io-index"
337
- checksum = "007a331efb31f6ddb644590ef22359c9469784931162aad92599e34bcfa66583"
389
+ checksum = "7fe99e6f80a79abccf1e8fb48dd63473a36057e600cc6ea36147c8318698ae6f"
338
390
  dependencies = [
339
391
  "cfgrammar",
392
+ "chrono",
340
393
  "lazy_static",
341
394
  "lrlex",
342
395
  "lrpar",
@@ -345,7 +398,7 @@ dependencies = [
345
398
 
346
399
  [[package]]
347
400
  name = "py-promql-parser"
348
- version = "0.4.1"
401
+ version = "0.4.2"
349
402
  dependencies = [
350
403
  "chrono",
351
404
  "promql-parser",
@@ -354,16 +407,16 @@ dependencies = [
354
407
 
355
408
  [[package]]
356
409
  name = "pyo3"
357
- version = "0.21.2"
410
+ version = "0.23.3"
358
411
  source = "registry+https://github.com/rust-lang/crates.io-index"
359
- checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
412
+ checksum = "e484fd2c8b4cb67ab05a318f1fd6fa8f199fcc30819f08f07d200809dba26c15"
360
413
  dependencies = [
361
414
  "cfg-if",
362
415
  "chrono",
363
416
  "indoc",
364
417
  "libc",
365
418
  "memoffset",
366
- "parking_lot",
419
+ "once_cell",
367
420
  "portable-atomic",
368
421
  "pyo3-build-config",
369
422
  "pyo3-ffi",
@@ -373,19 +426,20 @@ dependencies = [
373
426
 
374
427
  [[package]]
375
428
  name = "pyo3-build-config"
376
- version = "0.21.2"
429
+ version = "0.23.3"
377
430
  source = "registry+https://github.com/rust-lang/crates.io-index"
378
- checksum = "7883df5835fafdad87c0d888b266c8ec0f4c9ca48a5bed6bbb592e8dedee1b50"
431
+ checksum = "dc0e0469a84f208e20044b98965e1561028180219e35352a2afaf2b942beff3b"
379
432
  dependencies = [
380
433
  "once_cell",
434
+ "python3-dll-a",
381
435
  "target-lexicon",
382
436
  ]
383
437
 
384
438
  [[package]]
385
439
  name = "pyo3-ffi"
386
- version = "0.21.2"
440
+ version = "0.23.3"
387
441
  source = "registry+https://github.com/rust-lang/crates.io-index"
388
- checksum = "01be5843dc60b916ab4dad1dca6d20b9b4e6ddc8e15f50c47fe6d85f1fb97403"
442
+ checksum = "eb1547a7f9966f6f1a0f0227564a9945fe36b90da5a93b3933fc3dc03fae372d"
389
443
  dependencies = [
390
444
  "libc",
391
445
  "pyo3-build-config",
@@ -393,9 +447,9 @@ dependencies = [
393
447
 
394
448
  [[package]]
395
449
  name = "pyo3-macros"
396
- version = "0.21.2"
450
+ version = "0.23.3"
397
451
  source = "registry+https://github.com/rust-lang/crates.io-index"
398
- checksum = "77b34069fc0682e11b31dbd10321cbf94808394c56fd996796ce45217dfac53c"
452
+ checksum = "fdb6da8ec6fa5cedd1626c886fc8749bdcbb09424a86461eb8cdf096b7c33257"
399
453
  dependencies = [
400
454
  "proc-macro2",
401
455
  "pyo3-macros-backend",
@@ -405,9 +459,9 @@ dependencies = [
405
459
 
406
460
  [[package]]
407
461
  name = "pyo3-macros-backend"
408
- version = "0.21.2"
462
+ version = "0.23.3"
409
463
  source = "registry+https://github.com/rust-lang/crates.io-index"
410
- checksum = "08260721f32db5e1a5beae69a55553f56b99bd0e1c3e6e0a5e8851a9d0f5a85c"
464
+ checksum = "38a385202ff5a92791168b1136afae5059d3ac118457bb7bc304c197c2d33e7d"
411
465
  dependencies = [
412
466
  "heck",
413
467
  "proc-macro2",
@@ -417,37 +471,37 @@ dependencies = [
417
471
  ]
418
472
 
419
473
  [[package]]
420
- name = "quote"
421
- version = "1.0.36"
474
+ name = "python3-dll-a"
475
+ version = "0.2.11"
422
476
  source = "registry+https://github.com/rust-lang/crates.io-index"
423
- checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
477
+ checksum = "9b9e268ee1be609e93a13eb06839f68f67e5fe0fb4049834d261c2d5091c1b6d"
424
478
  dependencies = [
425
- "proc-macro2",
479
+ "cc",
426
480
  ]
427
481
 
428
482
  [[package]]
429
- name = "redox_syscall"
430
- version = "0.4.1"
483
+ name = "quote"
484
+ version = "1.0.37"
431
485
  source = "registry+https://github.com/rust-lang/crates.io-index"
432
- checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
486
+ checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
433
487
  dependencies = [
434
- "bitflags 1.3.2",
488
+ "proc-macro2",
435
489
  ]
436
490
 
437
491
  [[package]]
438
492
  name = "redox_syscall"
439
- version = "0.5.2"
493
+ version = "0.5.7"
440
494
  source = "registry+https://github.com/rust-lang/crates.io-index"
441
- checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
495
+ checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
442
496
  dependencies = [
443
- "bitflags 2.5.0",
497
+ "bitflags",
444
498
  ]
445
499
 
446
500
  [[package]]
447
501
  name = "regex"
448
- version = "1.10.5"
502
+ version = "1.11.1"
449
503
  source = "registry+https://github.com/rust-lang/crates.io-index"
450
- checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f"
504
+ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
451
505
  dependencies = [
452
506
  "aho-corasick",
453
507
  "memchr",
@@ -457,9 +511,9 @@ dependencies = [
457
511
 
458
512
  [[package]]
459
513
  name = "regex-automata"
460
- version = "0.4.7"
514
+ version = "0.4.9"
461
515
  source = "registry+https://github.com/rust-lang/crates.io-index"
462
- checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
516
+ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
463
517
  dependencies = [
464
518
  "aho-corasick",
465
519
  "memchr",
@@ -468,30 +522,24 @@ dependencies = [
468
522
 
469
523
  [[package]]
470
524
  name = "regex-syntax"
471
- version = "0.8.4"
525
+ version = "0.8.5"
472
526
  source = "registry+https://github.com/rust-lang/crates.io-index"
473
- checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
527
+ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
474
528
 
475
529
  [[package]]
476
530
  name = "rustc_version"
477
- version = "0.4.0"
531
+ version = "0.4.1"
478
532
  source = "registry+https://github.com/rust-lang/crates.io-index"
479
- checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
533
+ checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
480
534
  dependencies = [
481
535
  "semver",
482
536
  ]
483
537
 
484
538
  [[package]]
485
539
  name = "rustversion"
486
- version = "1.0.17"
540
+ version = "1.0.18"
487
541
  source = "registry+https://github.com/rust-lang/crates.io-index"
488
- checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
489
-
490
- [[package]]
491
- name = "scopeguard"
492
- version = "1.2.0"
493
- source = "registry+https://github.com/rust-lang/crates.io-index"
494
- checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
542
+ checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248"
495
543
 
496
544
  [[package]]
497
545
  name = "semver"
@@ -501,18 +549,18 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
501
549
 
502
550
  [[package]]
503
551
  name = "serde"
504
- version = "1.0.203"
552
+ version = "1.0.215"
505
553
  source = "registry+https://github.com/rust-lang/crates.io-index"
506
- checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094"
554
+ checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f"
507
555
  dependencies = [
508
556
  "serde_derive",
509
557
  ]
510
558
 
511
559
  [[package]]
512
560
  name = "serde_derive"
513
- version = "1.0.203"
561
+ version = "1.0.215"
514
562
  source = "registry+https://github.com/rust-lang/crates.io-index"
515
- checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba"
563
+ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0"
516
564
  dependencies = [
517
565
  "proc-macro2",
518
566
  "quote",
@@ -520,16 +568,16 @@ dependencies = [
520
568
  ]
521
569
 
522
570
  [[package]]
523
- name = "smallvec"
524
- version = "1.13.2"
571
+ name = "shlex"
572
+ version = "1.3.0"
525
573
  source = "registry+https://github.com/rust-lang/crates.io-index"
526
- checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
574
+ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
527
575
 
528
576
  [[package]]
529
577
  name = "sparsevec"
530
- version = "0.2.0"
578
+ version = "0.2.1"
531
579
  source = "registry+https://github.com/rust-lang/crates.io-index"
532
- checksum = "35df5d2e580b29f3f7ec5b4ed49b0ab3acf7f3624122b3e823cafb9630f293b8"
580
+ checksum = "91ef4657ebc254f6e84a863cb495c2feb60e5b48eba5141bf2bbbe202adb65b4"
533
581
  dependencies = [
534
582
  "num-traits",
535
583
  "packedvec",
@@ -545,9 +593,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
545
593
 
546
594
  [[package]]
547
595
  name = "syn"
548
- version = "2.0.66"
596
+ version = "2.0.90"
549
597
  source = "registry+https://github.com/rust-lang/crates.io-index"
550
- checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
598
+ checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31"
551
599
  dependencies = [
552
600
  "proc-macro2",
553
601
  "quote",
@@ -556,15 +604,15 @@ dependencies = [
556
604
 
557
605
  [[package]]
558
606
  name = "target-lexicon"
559
- version = "0.12.14"
607
+ version = "0.12.16"
560
608
  source = "registry+https://github.com/rust-lang/crates.io-index"
561
- checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
609
+ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
562
610
 
563
611
  [[package]]
564
612
  name = "time"
565
- version = "0.3.36"
613
+ version = "0.3.37"
566
614
  source = "registry+https://github.com/rust-lang/crates.io-index"
567
- checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
615
+ checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21"
568
616
  dependencies = [
569
617
  "deranged",
570
618
  "itoa",
@@ -585,9 +633,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
585
633
 
586
634
  [[package]]
587
635
  name = "time-macros"
588
- version = "0.2.18"
636
+ version = "0.2.19"
589
637
  source = "registry+https://github.com/rust-lang/crates.io-index"
590
- checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
638
+ checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de"
591
639
  dependencies = [
592
640
  "num-conv",
593
641
  "time-core",
@@ -595,15 +643,15 @@ dependencies = [
595
643
 
596
644
  [[package]]
597
645
  name = "unicode-ident"
598
- version = "1.0.12"
646
+ version = "1.0.14"
599
647
  source = "registry+https://github.com/rust-lang/crates.io-index"
600
- checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
648
+ checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
601
649
 
602
650
  [[package]]
603
651
  name = "unicode-width"
604
- version = "0.1.13"
652
+ version = "0.1.14"
605
653
  source = "registry+https://github.com/rust-lang/crates.io-index"
606
- checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
654
+ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
607
655
 
608
656
  [[package]]
609
657
  name = "unindent"
@@ -613,9 +661,9 @@ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
613
661
 
614
662
  [[package]]
615
663
  name = "vergen"
616
- version = "8.3.1"
664
+ version = "8.3.2"
617
665
  source = "registry+https://github.com/rust-lang/crates.io-index"
618
- checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525"
666
+ checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566"
619
667
  dependencies = [
620
668
  "anyhow",
621
669
  "rustversion",
@@ -634,19 +682,83 @@ dependencies = [
634
682
  ]
635
683
 
636
684
  [[package]]
637
- name = "windows-sys"
685
+ name = "wasm-bindgen"
686
+ version = "0.2.97"
687
+ source = "registry+https://github.com/rust-lang/crates.io-index"
688
+ checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c"
689
+ dependencies = [
690
+ "cfg-if",
691
+ "once_cell",
692
+ "wasm-bindgen-macro",
693
+ ]
694
+
695
+ [[package]]
696
+ name = "wasm-bindgen-backend"
697
+ version = "0.2.97"
698
+ source = "registry+https://github.com/rust-lang/crates.io-index"
699
+ checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd"
700
+ dependencies = [
701
+ "bumpalo",
702
+ "log",
703
+ "once_cell",
704
+ "proc-macro2",
705
+ "quote",
706
+ "syn",
707
+ "wasm-bindgen-shared",
708
+ ]
709
+
710
+ [[package]]
711
+ name = "wasm-bindgen-macro"
712
+ version = "0.2.97"
713
+ source = "registry+https://github.com/rust-lang/crates.io-index"
714
+ checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051"
715
+ dependencies = [
716
+ "quote",
717
+ "wasm-bindgen-macro-support",
718
+ ]
719
+
720
+ [[package]]
721
+ name = "wasm-bindgen-macro-support"
722
+ version = "0.2.97"
723
+ source = "registry+https://github.com/rust-lang/crates.io-index"
724
+ checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d"
725
+ dependencies = [
726
+ "proc-macro2",
727
+ "quote",
728
+ "syn",
729
+ "wasm-bindgen-backend",
730
+ "wasm-bindgen-shared",
731
+ ]
732
+
733
+ [[package]]
734
+ name = "wasm-bindgen-shared"
735
+ version = "0.2.97"
736
+ source = "registry+https://github.com/rust-lang/crates.io-index"
737
+ checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49"
738
+
739
+ [[package]]
740
+ name = "windows-core"
638
741
  version = "0.52.0"
639
742
  source = "registry+https://github.com/rust-lang/crates.io-index"
640
- checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
743
+ checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
744
+ dependencies = [
745
+ "windows-targets",
746
+ ]
747
+
748
+ [[package]]
749
+ name = "windows-sys"
750
+ version = "0.59.0"
751
+ source = "registry+https://github.com/rust-lang/crates.io-index"
752
+ checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
641
753
  dependencies = [
642
754
  "windows-targets",
643
755
  ]
644
756
 
645
757
  [[package]]
646
758
  name = "windows-targets"
647
- version = "0.52.5"
759
+ version = "0.52.6"
648
760
  source = "registry+https://github.com/rust-lang/crates.io-index"
649
- checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
761
+ checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
650
762
  dependencies = [
651
763
  "windows_aarch64_gnullvm",
652
764
  "windows_aarch64_msvc",
@@ -660,48 +772,48 @@ dependencies = [
660
772
 
661
773
  [[package]]
662
774
  name = "windows_aarch64_gnullvm"
663
- version = "0.52.5"
775
+ version = "0.52.6"
664
776
  source = "registry+https://github.com/rust-lang/crates.io-index"
665
- checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
777
+ checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
666
778
 
667
779
  [[package]]
668
780
  name = "windows_aarch64_msvc"
669
- version = "0.52.5"
781
+ version = "0.52.6"
670
782
  source = "registry+https://github.com/rust-lang/crates.io-index"
671
- checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
783
+ checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
672
784
 
673
785
  [[package]]
674
786
  name = "windows_i686_gnu"
675
- version = "0.52.5"
787
+ version = "0.52.6"
676
788
  source = "registry+https://github.com/rust-lang/crates.io-index"
677
- checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
789
+ checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
678
790
 
679
791
  [[package]]
680
792
  name = "windows_i686_gnullvm"
681
- version = "0.52.5"
793
+ version = "0.52.6"
682
794
  source = "registry+https://github.com/rust-lang/crates.io-index"
683
- checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
795
+ checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
684
796
 
685
797
  [[package]]
686
798
  name = "windows_i686_msvc"
687
- version = "0.52.5"
799
+ version = "0.52.6"
688
800
  source = "registry+https://github.com/rust-lang/crates.io-index"
689
- checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
801
+ checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
690
802
 
691
803
  [[package]]
692
804
  name = "windows_x86_64_gnu"
693
- version = "0.52.5"
805
+ version = "0.52.6"
694
806
  source = "registry+https://github.com/rust-lang/crates.io-index"
695
- checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
807
+ checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
696
808
 
697
809
  [[package]]
698
810
  name = "windows_x86_64_gnullvm"
699
- version = "0.52.5"
811
+ version = "0.52.6"
700
812
  source = "registry+https://github.com/rust-lang/crates.io-index"
701
- checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
813
+ checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
702
814
 
703
815
  [[package]]
704
816
  name = "windows_x86_64_msvc"
705
- version = "0.52.5"
817
+ version = "0.52.6"
706
818
  source = "registry+https://github.com/rust-lang/crates.io-index"
707
- checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
819
+ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "py-promql-parser"
3
- version = "0.4.1"
3
+ version = "0.4.2"
4
4
  edition = "2021"
5
5
  description = "PromQL Parser for Python"
6
6
  license = "MIT"
@@ -14,5 +14,5 @@ crate-type = ["cdylib"]
14
14
 
15
15
  [dependencies]
16
16
  chrono = { version = "0.4.23", default-features = false, features = ["std"] }
17
- promql-parser = "0.4.0"
18
- pyo3 = { version = "0.21.2", features = ["chrono", "extension-module"] }
17
+ promql-parser = "0.4.3"
18
+ pyo3 = { version = "0.23.3", features = ["chrono", "generate-import-lib"] }
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: promql-parser
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -9,4 +9,8 @@ classifiers = [
9
9
  "Programming Language :: Rust",
10
10
  "Programming Language :: Python :: Implementation :: CPython",
11
11
  "Programming Language :: Python :: Implementation :: PyPy",
12
- ]
12
+ ]
13
+ dynamic = ["version"]
14
+
15
+ [tool.maturin]
16
+ features = ["pyo3/extension-module"]
@@ -8,7 +8,7 @@ use promql_parser::parser::{
8
8
  UnaryExpr, VectorMatchCardinality, VectorSelector,
9
9
  };
10
10
  use pyo3::exceptions::{PyNotImplementedError, PyOverflowError, PyValueError};
11
- use pyo3::prelude::*;
11
+ use pyo3::{prelude::*, IntoPyObjectExt};
12
12
 
13
13
  #[pyclass(subclass, name = "Expr", module = "promql_parser")]
14
14
  #[derive(Debug, Clone)]
@@ -94,7 +94,7 @@ impl PyAggregateExpr {
94
94
  None => None,
95
95
  },
96
96
  });
97
- Ok(Py::new(py, initializer)?.into_py(py))
97
+ Py::new(py, initializer)?.into_py_any(py)
98
98
  }
99
99
  }
100
100
 
@@ -126,8 +126,8 @@ pub struct PyAggModifier {
126
126
  labels: Vec<Label>,
127
127
  }
128
128
 
129
- #[pyclass(name = "AggModifierType", module = "promql_parser")]
130
- #[derive(Debug, Clone, Copy)]
129
+ #[pyclass(name = "AggModifierType", module = "promql_parser", eq, eq_int)]
130
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
131
131
  pub enum PyAggModifierType {
132
132
  By,
133
133
  Without,
@@ -148,7 +148,7 @@ impl PyUnaryExpr {
148
148
  let initializer = PyClassInitializer::from(parent).add_subclass(PyUnaryExpr {
149
149
  expr: PyExpr::create(py, *expr)?,
150
150
  });
151
- Ok(Py::new(py, initializer)?.into_py(py))
151
+ Py::new(py, initializer)?.into_py_any(py)
152
152
  }
153
153
  }
154
154
 
@@ -199,7 +199,7 @@ impl PyBinaryExpr {
199
199
  rhs: PyExpr::create(py, *rhs)?,
200
200
  modifier: py_modifier,
201
201
  });
202
- Ok(Py::new(py, initializer)?.into_py(py))
202
+ Py::new(py, initializer)?.into_py_any(py)
203
203
  }
204
204
  }
205
205
 
@@ -223,15 +223,15 @@ pub struct PyLabelModifier {
223
223
  labels: Vec<Label>,
224
224
  }
225
225
 
226
- #[pyclass(name = "LabelModifierType", module = "promql_parser")]
227
- #[derive(Debug, Clone, Copy)]
226
+ #[pyclass(name = "LabelModifierType", module = "promql_parser", eq, eq_int)]
227
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
228
228
  pub enum PyLabelModifierType {
229
229
  Include,
230
230
  Exclude,
231
231
  }
232
232
 
233
- #[pyclass(name = "VectorMatchCardinality", module = "promql_parser")]
234
- #[derive(Debug, Clone, Copy)]
233
+ #[pyclass(name = "VectorMatchCardinality", module = "promql_parser", eq, eq_int)]
234
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
235
235
  pub enum PyVectorMatchCardinality {
236
236
  OneToOne,
237
237
  ManyToOne,
@@ -265,7 +265,7 @@ impl PyParenExpr {
265
265
  let initializer = PyClassInitializer::from(parent).add_subclass(PyParenExpr {
266
266
  expr: PyExpr::create(py, *expr)?,
267
267
  });
268
- Ok(Py::new(py, initializer)?.into_py(py))
268
+ Py::new(py, initializer)?.into_py_any(py)
269
269
  }
270
270
  }
271
271
 
@@ -318,7 +318,7 @@ impl PySubqueryExpr {
318
318
  None => None,
319
319
  },
320
320
  });
321
- Ok(Py::new(py, initializer)?.into_py(py))
321
+ Py::new(py, initializer)?.into_py_any(py)
322
322
  }
323
323
  }
324
324
 
@@ -342,8 +342,8 @@ impl From<AtModifier> for PyAtModifier {
342
342
  }
343
343
  }
344
344
 
345
- #[pyclass(name = "AtModifierType", module = "promql_parser")]
346
- #[derive(Debug, Clone, Copy)]
345
+ #[pyclass(name = "AtModifierType", module = "promql_parser", eq, eq_int)]
346
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
347
347
  pub enum PyAtModifierType {
348
348
  Start,
349
349
  End,
@@ -363,7 +363,7 @@ impl PyNumberLiteral {
363
363
  };
364
364
  let NumberLiteral { val } = expr;
365
365
  let initializer = PyClassInitializer::from(parent).add_subclass(PyNumberLiteral { val });
366
- Ok(Py::new(py, initializer)?.into_py(py))
366
+ Py::new(py, initializer)?.into_py_any(py)
367
367
  }
368
368
  }
369
369
 
@@ -380,11 +380,11 @@ impl PyStringLiteral {
380
380
  };
381
381
  let StringLiteral { val } = expr;
382
382
  let initializer = PyClassInitializer::from(parent).add_subclass(PyStringLiteral { val });
383
- Ok(Py::new(py, initializer)?.into_py(py))
383
+ Py::new(py, initializer)?.into_py_any(py)
384
384
  }
385
385
  }
386
386
 
387
- #[pyclass(name = "MatchOp", module = "promql_parser")]
387
+ #[pyclass(name = "MatchOp", module = "promql_parser", eq, eq_int)]
388
388
  #[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)]
389
389
  pub enum PyMatchOp {
390
390
  Equal,
@@ -508,7 +508,7 @@ impl PyVectorSelector {
508
508
  },
509
509
  at: at.map(|at| at.into()),
510
510
  });
511
- Ok(Py::new(py, initializer)?.into_py(py))
511
+ Py::new(py, initializer)?.into_py_any(py)
512
512
  }
513
513
  }
514
514
 
@@ -532,7 +532,7 @@ impl PyMatrixSelector {
532
532
  range: Duration::from_std(range)
533
533
  .map_err(|e| PyOverflowError::new_err(e.to_string()))?,
534
534
  });
535
- Ok(Py::new(py, initializer)?.into_py(py))
535
+ Py::new(py, initializer)?.into_py_any(py)
536
536
  }
537
537
  }
538
538
 
@@ -563,12 +563,12 @@ impl PyCall {
563
563
  .collect();
564
564
  let initializer =
565
565
  PyClassInitializer::from(parent).add_subclass(PyCall { func, args: args? });
566
- Ok(Py::new(py, initializer)?.into_py(py))
566
+ Py::new(py, initializer)?.into_py_any(py)
567
567
  }
568
568
  }
569
569
 
570
- #[pyclass(name = "ValueType", module = "promql_parser")]
571
- #[derive(Debug, Clone, Copy)]
570
+ #[pyclass(name = "ValueType", module = "promql_parser", eq, eq_int)]
571
+ #[derive(Debug, Clone, Copy, PartialEq, Eq)]
572
572
  pub enum PyValueType {
573
573
  Vector,
574
574
  Scalar,
@@ -13,7 +13,7 @@ fn parse(py: Python, input: &str) -> PyResult<PyObject> {
13
13
  }
14
14
 
15
15
  #[pyfunction]
16
- fn parse_duration<'p>(py: Python<'p>, duration: &str) -> PyResult<&'p PyDelta> {
16
+ fn parse_duration<'p>(py: Python<'p>, duration: &str) -> PyResult<Bound<'p, PyDelta>> {
17
17
  let duration =
18
18
  ::promql_parser::util::duration::parse_duration(duration).map_err(PyValueError::new_err)?;
19
19
  PyDelta::new(
@@ -26,7 +26,7 @@ fn parse_duration<'p>(py: Python<'p>, duration: &str) -> PyResult<&'p PyDelta> {
26
26
  }
27
27
 
28
28
  #[pyfunction]
29
- fn display_duration(delta: &PyDelta) -> String {
29
+ fn display_duration(delta: Bound<'_, PyDelta>) -> String {
30
30
  let duration = std::time::Duration::new(
31
31
  delta.get_days() as u64 * 24 * 60 * 60 + delta.get_seconds() as u64,
32
32
  delta.get_microseconds() as u32 * 1000,
@@ -35,8 +35,8 @@ fn display_duration(delta: &PyDelta) -> String {
35
35
  }
36
36
 
37
37
  /// A Python module implemented in Rust.
38
- #[pymodule]
39
- fn promql_parser(_py: Python, m: &PyModule) -> PyResult<()> {
38
+ #[pymodule(gil_used = false)]
39
+ fn promql_parser(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
40
40
  m.add_class::<PyExpr>()?;
41
41
  m.add_class::<expr::PyAggregateExpr>()?;
42
42
  m.add_class::<expr::PyTokenType>()?;
File without changes
File without changes
File without changes