Commit Graph

180 Commits

Author SHA1 Message Date
Sebastien Binet 08799919c9 bind: test func taking pointers
Change-Id: Ib281c5e8b88930a5e9515cabe5f8a414911a2240
2015-09-02 17:47:04 +02:00
Sebastien Binet 44026ff053 bind: fix funcs with params with pointers
This CL introduces skBuiltin to differentiate between named types pointing at a
basic type and builtin types.
It also provides some limited heuristics to detect when a parameters is passed
by reference.

Updates #45

Change-Id: I0863303772514f819131d4bcf586358d0cc707db
2015-09-02 17:47:04 +02:00
Sebastien Binet 33f3ca06ba bind: remove stale comment
Change-Id: Id3990d74d5547a95ef1d0e8d713788889833f416
2015-09-02 17:46:41 +02:00
Sebastien Binet 6422285aab gopy: run go-get on package to wrap to handle deps
Change-Id: If030e5c4bab1401227e2e826c80b61d3053ad743
2015-09-02 17:13:33 +02:00
Sebastien Binet 998c78c822 bind: consolidate gengo-preamble
Change-Id: I24024ec118735be00f391060c257a990fe8a49d3
2015-09-02 17:09:19 +02:00
Sebastien Binet 3913a1e753 Merge pull request #50 from kellrott/master
bind: starting support for maps in go

Updates #22.
2015-09-01 00:31:59 +02:00
Kyle Ellrott c1a4248992 Starting to add the ability recognize maps in GO. (Updates #22)
Responding to issues on PR discussion
2015-08-31 15:25:37 -07:00
Sebastien Binet 55c408dc44 bind: handling of private fields in struct.tp_init
Previously, the tp_init function being generated for a struct would try to fill
private fields from the args passed to __init__.
This obviously breaks Go's encapsulation mechanism.

Only allow public fields to be initialized from __init__.
Add a test.

Fixes #52.
2015-08-31 18:40:47 +02:00
Sebastien Binet 3978d079ad bind: dont wrap unexported methods
gengo was trying to wrap non-exported methods on named types.
don't do that.

Fixes #53.

Change-Id: I1043ba18f9012100c6228e3db6d79bc55fbb41ec
2015-08-31 18:12:07 +02:00
Sebastien Binet e62cd6aaf8 doc: add 'contribute' blurb
Change-Id: I93cac4ba8fe586c80e60b45950ef5efe04a41cad
2015-08-31 10:39:02 +02:00
Sebastien Binet daf017bd41 bind: discover pkgconfig package name
This CL enhances gengo with the ability to discover the latest python.pc
package name and adds it to the #cgo pkgconfig pragma.

Fixes #51.

Change-Id: If4d46d6fe90731df6b2cb4f9c39fb3ec967e7330
2015-08-31 10:23:57 +02:00
Sebastien Binet 6d80c41494 bind: add test script for interfaces
Change-Id: Iba3902544ebf5e1d0a7846803bcb628518334f7b
2015-08-14 13:31:28 +02:00
Sebastien Binet d4e4779d2f bind: first stab at wrapping interfaces
Change-Id: Ife9be87d97a1c796166c2ac204d7de0322326a94
2015-08-14 13:26:09 +02:00
Sebastien Binet c1d3b45735 bind: first stab at a gopy object model 2015-08-14 13:04:35 +02:00
Sebastien Binet c8ce550bd3 examples/iface: expand test
Change-Id: Ibe437b2af33ec9adcf136e51acf50bbc5f4e18b7
2015-08-14 13:01:21 +02:00
Sebastien Binet 14b9cb2dba bind: test for sq_inplace_concat
Change-Id: I4f25f62647cc99a7397afbb5f5bba1dee5484e3d
2015-08-12 19:07:09 +02:00
Sebastien Binet 8273e0bc29 bind: support for sq_inplace_concat for slices
Fixes #26

Change-Id: Ic0dfa216c8149f25432fb38653b909a1ea1e010f
2015-08-12 19:05:54 +02:00
Sebastien Binet e4d704fa3f bind: fix typo in named-test
Change-Id: I761a1bd9b72e38f41198e681cb830766258a681e
2015-08-12 18:53:28 +02:00
Sebastien Binet cd92a1aee8 bind: fix C99-ism
Change-Id: I37a13cbea00303fb16a50a9d8479c74a982e6c5c
2015-08-12 18:17:38 +02:00
Sebastien Binet 4c77c90e70 bind: test ctors for arrays+slices
Change-Id: I35a72f532713fa0a2668ec98080b715f01dbcae1
2015-08-12 18:13:32 +02:00
Sebastien Binet 66ad3791f4 bind: support for ctors for arrays+slices
Fixes #41.

Change-Id: Iae4a05adf7ee13bd5646a68cfe09144c23b1487a
2015-08-12 18:12:29 +02:00
Sebastien Binet be74c37022 gopy: dont reload C-extension module
While waiting for #27 to be handled upstream, prevent users from crashing their
interpreter by not allowing to reload a C-extension module if already wrapped
and compiled.

Fixes #46.

Change-Id: Ic9624beae3061b286d09aca71882915923bd6298
2015-08-12 11:44:27 +02:00
Sebastien Binet 41f904d5cc bind: add test for pointers
(but disabled for now)

Updates #45

Change-Id: I0c8a2cce45f99d36ffb62b1f8f85f20703c00acb
2015-08-12 11:30:47 +02:00
Sebastien Binet f40527bd4f bind: lift code into addPointerType
Change-Id: I3aca1d448e7eaa398d665ed1ddd836961146bcc5
2015-08-12 11:26:40 +02:00
Sebastien Binet f6940af31c bind: test typed constants and typenamed vars 2015-08-12 11:25:23 +02:00
Sebastien Binet 1b431ce89d bind: support for typed constants+vars
Fixes #43

Change-Id: Ibf21bc4c792fe25e34f85b69a41a1f6d135e87f4
2015-08-12 10:52:32 +02:00
Sebastien Binet c4ad7bd023 bind: change wrap pointer logic (HACK)
Change-Id: Idf21382b6b36d253e0ff46d8b86e75f3648ad0ab
2015-08-12 10:25:07 +02:00
Sebastien Binet 9b97454b76 bind: implement a 2-step scanning process
Package.process now scans types/objects in 2 steps:
 - collect all symbols
 - process these symbols to create bind.Struct and co.

Also, correctly create symbols for parameters and results of types.Func's
signature.
2015-08-12 10:24:19 +02:00
Sebastien Binet 13a0eaf035 bind: fix bug in addArrayType
Change-Id: Iad5f8964129a685e3a39220c8d118c485b9e9703
2015-08-12 09:11:57 +02:00
Sebastien Binet 085059a448 bind: fix bug in addSliceType
Change-Id: I5a33be74a20463d28d15d10be74b0b98a56a039d
2015-08-12 09:09:29 +02:00
Sebastien Binet 4db01df52d bind: test docstrings of named types' methods
Change-Id: Ib625a14a09f9ce83bc814b9b8c0d431bddbce639
2015-08-12 08:49:06 +02:00
Sebastien Binet e891e740c2 bind: attach docstrings to methods of named types
Change-Id: If51d4bd20dfe0259d30a9a31512cc04a5ca5defd
2015-08-12 08:47:12 +02:00
Sebastien Binet 92c547a998 travis: try new infrastructure 2015-08-11 21:24:54 +02:00
Sebastien Binet 5c74378c29 examples/cpkg: fix c-compilation warning
Compiling with `-Wformat-security` resulted in:
```sh
gopy/_examples/cpkg/cpkg.go: In function ‘cpkg_printf’:
gopy/_examples/cpkg/cpkg.go:11:2: warning: format not a string literal and no format arguments [-Wformat-security]
```

This CL is an attempted at fixing that.
2015-08-11 21:12:19 +02:00
Sebastien Binet e2b2b4c610 doc: add build badge 2015-08-11 21:08:04 +02:00
Sebastien Binet 7693fe02e0 gopy: add travis-ci 2015-08-11 21:04:38 +02:00
Sebastien Binet 6a505e224b doc: add godoc badge 2015-08-11 21:01:36 +02:00
Sebastien Binet 577ca00d4b gopy: add diff output when tests fail
Change-Id: I31c586aedb81a43676fd3e323b7adff82903ac1e
2015-08-11 19:22:06 +02:00
Sebastien Binet 7852de8d4b bind: test empty structs
Change-Id: I9d30488e9dbc6244fa891a6a43725db775fe9ab1
2015-08-11 19:04:15 +02:00
Sebastien Binet 536b44dd2a bind: test more basic named types ctor
Change-Id: Ibc519364561f464c2d00fd3836b3d01a4ce29a92
2015-08-11 18:55:57 +02:00
Sebastien Binet 90fb7cc80b bind: test for ctors of named (basic) types
Change-Id: I8905392331546aa730652cee0a2192449964ef6d
2015-08-11 18:43:08 +02:00
Sebastien Binet ef1162374e bind: support for ctors for named (basic) types
Fixes #38.

Change-Id: Id2598e71f6c9912e42e9f4e562267b9dd6368805
2015-08-11 18:41:41 +02:00
Sebastien Binet 5d2cebb740 bind: test methods on named types
Change-Id: I054630e4973db94c132e17e99a1a8ff084fcea0f
2015-08-11 17:47:23 +02:00
Sebastien Binet 98b8131dfd bind: fix float32 converter typo
Change-Id: I02e2853f88398cafcb5d35abd53a3e2a2b103c52
2015-08-11 17:38:15 +02:00
Sebastien Binet 00b7aa9a22 bind: wrap methods of all named types
Updates #31
Fixes #40

Change-Id: I9b8a0ab70779088bad35bdcfb7be6d340bb860b8
2015-08-11 17:35:51 +02:00
Sebastien Binet 216a45e7c3 bind: collect methods of all named types into symtab
Change-Id: Ia8f8ed3f7b68a06fe09945d795403e3f10e69285
2015-08-11 17:35:18 +02:00
Sebastien Binet 7b33bc0361 bind: store full object name in symtab (including package path)
Change-Id: If13be1869ab27ab8e486a5f68b827d575bc1879b
2015-08-11 17:34:33 +02:00
Sebastien Binet df2b8858f4 bind: leverage new genFunc
Change-Id: I79b0ec59dba91948a56fdd3d6a00801f9df0effd
2015-08-11 17:32:51 +02:00
Sebastien Binet 0ee5f57b2c bind: refactor genFunc
Change-Id: Icfcce2f87dc50fd0eef0cbc12ecc4484401c465d
2015-08-11 17:28:38 +02:00
Sebastien Binet 1bca59ae15 bind: support for empty structs
Fixes #39.

Change-Id: Id7e8708ceb331dcac79a7738b108e18f729c1e96
2015-08-11 13:46:38 +02:00