Skip to content

Commit ab200dc

Browse files
committed
ci: Fix sample.py
1 parent 42264a6 commit ab200dc

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

ci/samples/sample.py

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
import pythonnative
2-
from pythonnative.foo import pyFoo
3-
from pythonnative.bar import pyBar
4-
from pythonnative.foobar import pyFooBar
1+
import cmakepybind11
2+
from cmakepybind11.foo import pyFoo
3+
from cmakepybind11.bar import pyBar
4+
from cmakepybind11.foobar import pyFooBar
55

6-
print(f'version: {pythonnative.__version__}')
6+
print(f'version: {cmakepybind11.__version__}')
77

88
# foo
99
print(f'Foo: {dir(pyFoo.Foo)}')
1010

11-
p = pyFoo.IntPair(3, 5)
12-
print(f"class IntPair: {dir(p)}")
13-
print(f"p: {p}")
1411
pyFoo.free_function(2147483647) # max int
1512
pyFoo.free_function(2147483647+1) # max int + 1
1613

@@ -19,17 +16,14 @@
1916
f.static_function(1)
2017
f.static_function(2147483647)
2118
f.static_function(2147483647+1)
22-
f.set_int(13)
23-
assert(f.get_int() == 13)
24-
f.set_int64(31)
25-
assert(f.get_int64() == 31)
19+
f.int = 13
20+
assert(f.int == 13)
21+
f.int64 = 31
22+
assert(f.int64 == 31)
2623

2724
# bar
2825
print(f'Bar: {dir(pyBar.Bar)}')
2926

30-
p = pyBar.IntPair(3, 5)
31-
print(f"class IntPair: {dir(p)}")
32-
print(f"p: {p}")
3327
pyBar.free_function(2147483647) # max int
3428
pyBar.free_function(2147483647+1) # max int + 1
3529

@@ -38,17 +32,14 @@
3832
b.static_function(1)
3933
b.static_function(2147483647)
4034
b.static_function(2147483647+1)
41-
b.set_int(13)
42-
assert(b.get_int() == 13)
43-
b.set_int64(31)
44-
assert(b.get_int64() == 31)
35+
b.int = 13
36+
assert(b.int == 13)
37+
b.int64 = 31
38+
assert(b.int64 == 31)
4539

4640
# foobar
4741
print(f'FooBar: {dir(pyFooBar.FooBar)}')
4842

49-
p = pyFooBar.IntPair(3, 5)
50-
print(f"class IntPair: {dir(p)}")
51-
print(f"p: {p}")
5243
pyFooBar.free_function(2147483647) # max int
5344
pyFooBar.free_function(2147483647+1) # max int + 1
5445

@@ -57,9 +48,9 @@
5748
fb.static_function(1)
5849
fb.static_function(2147483647)
5950
fb.static_function(2147483647+1)
60-
fb.set_foo_int(13)
61-
fb.set_bar_int(17)
62-
assert(fb.get_int() == 30)
63-
fb.set_foo_int64(31)
64-
fb.set_bar_int64(37)
65-
assert(fb.get_int64() == 68)
51+
fb.foo_int = 13
52+
fb.bar_int = 17
53+
assert(fb.int == 30)
54+
fb.foo_int64 = 31
55+
fb.bar_int64 = 37
56+
assert(fb.int64 == 68)

0 commit comments

Comments
 (0)