danielgtaylor / danielgtaylor/python-betterproto

Paths are not normalized to posix format on Windows

Aperta
#578 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
bug investigation needed
Lingua principale
Python
Stelle
1.8k
Fork
234
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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`)
```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

- [X] I have searched the issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have verified this issue occurs on the latest prelease of betterproto which can be installed using `pip install -U --pre betterproto`, if possible.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci il problema su Windows usando il comando protoc o la configurazione buf.gen.yaml, con più file dipendenti e strategy: all. Leggi la specifica di generazione di Protobuf collegata nel report e confronta i percorsi generati con il formato POSIX richiesto; il lavoro è completo quando la generazione non produce avvisi sui percorsi e il codice generato è corretto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.