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

Paths are not normalized to posix format on Windows #578

Open
3 tasks done
EraYaN opened this issue Jun 4, 2024 · 0 comments
Open
3 tasks done

Paths are not normalized to posix format on Windows #578

EraYaN opened this issue Jun 4, 2024 · 0 comments
Labels
bug Something isn't working investigation needed

Comments

@EraYaN
Copy link

EraYaN commented Jun 4, 2024

Summary

Paths are not normalized to posix format on Windows

Reproduction Steps

Call protoc with the betterpython out options with multiple files that depend on one another.

Also happen when run through buf: (buf.gen.yaml)

version: v2
plugins:
  - local: protoc-gen-python_betterproto
    out: output/pythonbetter/src
    strategy: all
inputs:
  - directory: .
    paths:
      - protos

strategy: all causes this behaviour since it doesn't call protoc once per proto file but once with all. (Which is what you want)

Expected Results

Neatly generated code and no output

Actual Results

Hundreds of these:

path "protocols\\test\\__init__.py" is not equal to "protocols/test/__init__.py", and therefore does not conform to the Protobuf generation specification. The path must be non-empty, relative, use "/" instead of "\" as the path separator, and not use "." or ".." as part of the path. Generation will continue without error here, but please raise an issue with the maintainer of the plugin and reference https://github.com/protocolbuffers/protobuf/blob/95e6c5b4746dd7474d540ce4fb375e3f79a086f8/src/google/protobuf/compiler/plugin.proto#L122

System Information

libprotoc 3.21.12
Python 3.10.12
Name: betterproto
Version: 2.0.0b6
Summary: A better Protobuf / gRPC generator & library
Home-page: https://github.com/danielgtaylor/python-betterproto
Author: Daniel G. Taylor
Author-email: danielgtaylor@gmail.com
License: MIT
Location: c:\users\erwindehaan\mambaforge\lib\site-packages
Requires: grpclib, python-dateutil
Required-by:

On Windows 11 x64, running in Powershell

Checklist

  • I have searched the issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have verified this issue occurs on the latest prelease of betterproto which can be installed using pip install -U --pre betterproto, if possible.
@EraYaN EraYaN added bug Something isn't working investigation needed labels Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation needed
Projects
None yet
Development

No branches or pull requests

1 participant