New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile with dependencies? #5

Closed
rtoma opened this Issue Jan 4, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@rtoma

rtoma commented Jan 4, 2017

Great innovative tool.

Most python code uses 3rd party modules. How to compile those?

Example: I have a tool that imports configobj, after using grumpc on my tools .py file the go build returns:

mytool.go:4:2: cannot find package "grumpy/lib/configobj" in any of:
	/usr/local/Cellar/go/1.7.3/libexec/src/grumpy/lib/configobj (from $GOROOT)
	/Users/rtoma/projects/grumpy/build/src/grumpy/lib/configobj (from $GOPATH)
@HUSSTECH

This comment has been minimized.

Show comment
Hide comment
@HUSSTECH

HUSSTECH Jan 4, 2017

ConfigObj is pure python, so I thought it would have worked. I'm reading between the lines a bit here, but from the main readme it sounds like grumpy will only be looking for python modules where you're actually developing. So maybe moving the configobj *.py files into your dev directory it will act as if it were a module you made locally and then grumpy will pick it up.

Obviously this is not the ideal long term solution. Also I think ConfigObj needs Six, which is not in the grumpy lib dirs either. Maybe grumpy should be looking in $PYTHONPATH/Lib/site-packages or something like that. But then it would need to know it can only import pure python modules.

HUSSTECH commented Jan 4, 2017

ConfigObj is pure python, so I thought it would have worked. I'm reading between the lines a bit here, but from the main readme it sounds like grumpy will only be looking for python modules where you're actually developing. So maybe moving the configobj *.py files into your dev directory it will act as if it were a module you made locally and then grumpy will pick it up.

Obviously this is not the ideal long term solution. Also I think ConfigObj needs Six, which is not in the grumpy lib dirs either. Maybe grumpy should be looking in $PYTHONPATH/Lib/site-packages or something like that. But then it would need to know it can only import pure python modules.

@trotterdylan

This comment has been minimized.

Show comment
Hide comment
@trotterdylan

trotterdylan Jan 4, 2017

Collaborator

Indeed, moving the configobj *.py into the lib/ dir of the repo is a workaround that should work now. The "toolchain" is very primitive at this point so for real projects it's probably best to define your own workflow. The essential thing to know is that grumpc is the tool that converts Python -> Go. Then it's a matter of setting up your GOPATH appropriately so that the importing and imported Go packages line up correctly.

I'll update the README to include some examples.

Collaborator

trotterdylan commented Jan 4, 2017

Indeed, moving the configobj *.py into the lib/ dir of the repo is a workaround that should work now. The "toolchain" is very primitive at this point so for real projects it's probably best to define your own workflow. The essential thing to know is that grumpc is the tool that converts Python -> Go. Then it's a matter of setting up your GOPATH appropriately so that the importing and imported Go packages line up correctly.

I'll update the README to include some examples.

@trotterdylan

This comment has been minimized.

Show comment
Hide comment
@trotterdylan

trotterdylan Jun 29, 2017

Collaborator

I'm closing this in favor of #43 which has a bit more in depth discussion at this point.

Collaborator

trotterdylan commented Jun 29, 2017

I'm closing this in favor of #43 which has a bit more in depth discussion at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment