Skip to content
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

Great idea, docs dont seem right #132

Open
DuaneNielsen opened this issue Apr 7, 2019 · 1 comment
Open

Great idea, docs dont seem right #132

DuaneNielsen opened this issue Apr 7, 2019 · 1 comment

Comments

@DuaneNielsen
Copy link

First, let me say, the idea for this module is awesome, there is definately a need for a pure python oriented version of protobuf.

Problem I ran into was that the "Distributing a Python Package with Pyrobuf Modules" section of the docs seems to be not so well supported.

First, there seems to be a bug in compile.py under python 3.6

    def _compile_spec(self):
        try:
            os.makedirs(self.out)
        except _FileExistsError:
            pass

        for source in self.sources:
            if os.path.isdir(source):
                for spec in glob.glob(os.path.join(source, '*.proto')):
                    self._generate(spec)
            else:
                self._generate(source)

The line "for source in self.sources" appears to iterate over each character of the string, instead of a set of modules.

Renaming the directory from 'proto' to 'p' solved that problem. But then nothing was generated.

It migth be helpful to test this code under python 3.6, and also to mention in the docs, which setup commands will generate the files.

@wrobell
Copy link

wrobell commented Jul 5, 2019

I can confirm the issue. setuptools tries to read directory using first letter from pyrobuf_modules. You can set it to 'proto' or ['proto'] and it will try to read p directory.

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

No branches or pull requests

2 participants