danielgtaylor / python-betterproto

Clean, modern, Python 3.6+ code generator & library for Protobuf 3 and async gRPC
MIT License
1.56k stars 218 forks source link

Define __all__ #625

Closed AdrienVannson closed 3 weeks ago

AdrienVannson commented 1 month ago

Summary

Define __all__ in the generated files, as suggested by https://github.com/danielgtaylor/python-betterproto/issues/486

Checklist

Gobot1234 commented 1 month ago

Please move this to the end of the file, because honestly it's not something I want to see

Gobot1234 commented 1 month ago

Also please can you change this to a tuple not a list

AdrienVannson commented 1 month ago

It is defined at the top of the file on purpose, as suggested by PEP-8: https://peps.python.org/pep-0008/#module-level-dunder-names

Gobot1234 commented 1 month ago

Please can you add a test that this exists and avoids importing dataclasses etc?

Gobot1234 commented 1 month ago

It is defined at the top of the file on purpose, as suggested by PEP-8: peps.python.org/pep-0008#module-level-dunder-names

I have never seen it go before module imports hmm.

AdrienVannson commented 1 month ago

Please can you add a test that this exists and avoids importing dataclasses etc?

I added a test that check that __all__ is correctly defined. However, I'm not sure what you mean by importing dataclasses