Skip to content

Some improvements#1

Open
xowenx wants to merge 1 commit into
pupssman:masterfrom
xowenx:master
Open

Some improvements#1
xowenx wants to merge 1 commit into
pupssman:masterfrom
xowenx:master

Conversation

@xowenx
Copy link
Copy Markdown

@xowenx xowenx commented Apr 8, 2015

change --python_out to packagedir,
add --proto_path/-I option,
add some hint when not need generating pb2 file.

add --proto_path/-I option,
add some hint when not need generating pb2 file.
@pupssman pupssman changed the title some improments Some improvements Apr 8, 2015
@pupssman
Copy link
Copy Markdown
Owner

pupssman commented Apr 8, 2015

Hi there! Thanks for PR!

But I've got some concerns, particularly about the --python_out thing. My own test example has directory structure as follows:

my_package/setup.py
my_package/my_pack/__init__.py
my_package/my_pack/my.proto

And when I run python setup.py build_proto it places my_pb2.py in the my_pack dir if and only if I specify --python_out=.. If I use --python_out=<packagedir> it places generated file here:

my_package/my_pack/my_pack/my_bp2.py

If that behaviour is not true for you, please specify setuptools version and protoc versions, mine are:
root@home: ~/ protoc --version libprotoc 2.5.0
and

>>> import setuptools as s
>>> s.__version__
'3.6'
>>> 

@mavlyutov
Copy link
Copy Markdown

soooo outdated

95:~ mavlyutov$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools as s
>>> s.__version__
'15.0'

@xowenx
Copy link
Copy Markdown
Author

xowenx commented Apr 9, 2015

My version combination is (setuptools 15.0/ protoc 2.6.1).

In my situation, protoc command will run at the same dir hierarchy as setup.py, and if --python_out be set as "." , it would generate pb2.py file at the package root dir.

I'm curious why protoc generate redundancy dir at in your description, maybe relate to protoc version ?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants