Commit Graph

19 Commits

Author SHA1 Message Date
Kevin Zhang 591500e321 Add build tags
Signed-off-by: Kevin Zhang <kzhang@tecton.ai>
2022-07-14 13:58:59 -07:00
Randall C. O'Reilly 2a31e2f5ec make new args avail for all modes 2022-06-30 23:30:35 -07:00
Justin Israel ac5c077a97
main,bind: extended gopy:name control, auto PEP8 naming, and property docstring support
This commit provides an option to automatically rename functions, methods, and properties to PEP-style snake_case when generating code.
2021-03-26 09:16:11 +01:00
Justin Israel 8ab2cac131
main,bind,_examples: use absolute package imports and make configurable
This CL fixes an issue with the way python import statements are generated using an realtive current directory approach that is no longer compatible with python3. The default behavior has been updated to default to a dot-relative absolute package import for "go" and compiled extension, and a configuration option has been exposed from the CLI flags down to the bind package.
A refactor of configuration options was added to avoid further expanding the number of arguments being passed through the system.

Fixes go-python/gopy#239
2021-03-17 22:02:07 +01:00
Randall C. O'Reilly 0d0bcab6b1 wasn't properly skipping doc.go only dirs due to full path 2020-11-23 18:36:10 -08:00
Randall C. O'Reilly 3e06d5adc0 split up loading of package from parsing, only use the tools packages.Load and remove dependence on GOPATH GoSrcDir -- should now work exclusively with modules. also only build but don't install packages so go/bin doesn't get spammed 2020-11-23 17:18:30 -08:00
Randall C. O'Reilly b9902d7dc3 add a -no-make flag, which prevents overwriting the generated Makefile when run from the Makefile. add extra -Wno-error -Wno-implicit-function-declaration CFLAGS to fix Xcode 12 and make actual errors more visible 2020-09-19 18:03:45 -07:00
Randall C. O'Reilly 87be7f7b22 bind: add no-warn flag; use underlying type for Named types for struct fields; use overall package name for DecRef etc.
Fixes #219
Fixes #220
Fixes #221
2020-03-26 08:30:42 +01:00
Sebastien Binet 7e6560ef62
bind: slice elem method auto-wraps the handle, also maps
* fixes issue #191 (slice elem method auto-wraps the handle, including extra tests in slices), and fixes py wrapper imports to include everything referenced.

* also wrap handles for map __getitem__

* also rm gopy exe

* update after previewing PR: remove gopy.gide, don't print extra py imports, undo one usage change.

* one more cmd-exe fix
2019-09-30 15:32:05 +02:00
Randall C. O'Reilly 780132b629 final update of goki -> go-python -- my pass should be complete here and now just awaiting final review for PR merge. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly ec3f125415 should be last fixes before switching over paths and pulling from PR etc: added osfile example test, which uses pkg and imports os -- needed some fixes to get os package to parse, including fixing error conversion from string, and dealing with func literals with no arg names. osfile doesn't actually work b/c python import only working after install -- not worth doing install for test. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly 9e491ab3da most of PR review comments addressed -- few more to tackle tmrw. haven't changed import paths yet b/c still working out of my dir -- will do that as a last step. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly 8d98f0953a all tests now passing except maps.. also need to test py2 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly 8c4f9979b4 added exe command mode -- builds an executable that has all the go packages built-in and can interpreter in non-main thread. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly 782d3b74c8 more fixes to exclude various things -- excluding python keywords for example. gi now loads and tries to run - might work on linux, but mac requires main thread for loop. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly a2fed7cc19 parses gi successfully! however, python requires classes to be defined in order, so now need to sort the pywrap struct output so embedded are always earlier.. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly c960f7e8d5 using golang.org/x/tools/go/packages for package import b/c supports std library packages too 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly cf18fcbf00 major reorg to support multi-packages in one .so all working -- emergent mostly working. 2019-08-24 10:31:16 +02:00
Randall C. O'Reilly d8e3ff78f9 added pkg command, does full recursive generate for entire package -- figured out how to navigate python packages finally.. 2019-08-24 10:31:16 +02:00