File tree Expand file tree Collapse file tree
protobuf/simple_example/v1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949 ./pants --version
5050 - name : Check BUILD files
5151 run : ./pants tailor --check update-build-files --check
52- - name : Test
52+ - name : Lint and test
5353 run : |
54- ./pants test ::
54+ ./pants lint test ::
Original file line number Diff line number Diff line change @@ -4,11 +4,18 @@ An example repository to demonstrate codegen support in Pants.
44
55Refer to these docs for more information:
66
7- * [ Python Protobuf] ( https://www.pantsbuild.org/v2.10/ docs/protobuf-python )
8- * [ Python Thrift] ( https://www.pantsbuild.org/v2.10/ docs/thrift-python )
7+ * [ Python Protobuf] ( https://www.pantsbuild.org/docs/protobuf-python )
8+ * [ Python Thrift] ( https://www.pantsbuild.org/docs/thrift-python )
99
10- Run ` ./pants export-codegen :: ` to see the generated files. This isn't necessary for Pants to
11- use the generated files, but can be useful when debugging or to generate files for IDEs.
10+ Some commands you can try out:
11+
12+ * ` ./pants export-codegen :: ` - see the generated files.
13+ * This isn't necessary for Pants to use the generated files, but can be useful when
14+ debugging or to generate files for IDEs.
15+ * ` ./pants test :: ` - run all tests
16+ * ` ./pants fmt :: ` - format Protobuf with ` buf `
17+ * ` ./pants lint :: ` - lint Protobuf with ` buf `
18+ * ` ./pants dependencies <path/to/file> ` - see what depends on what
1219
1320Check out our other [ example repositories] ( https://www.pantsbuild.org/docs/example-repos ) to see
14- other features like running linters and formatters, and packaging binaries.
21+ other features like packaging binaries.
Original file line number Diff line number Diff line change 11[GLOBAL ]
2- pants_version = " 2.10.0 "
2+ pants_version = " 2.11.0rc3 "
33backend_packages = [
4+ " pants.backend.codegen.protobuf.lint.buf" ,
45 " pants.backend.codegen.protobuf.python" ,
56 " pants.backend.codegen.thrift.apache.python" ,
67 " pants.backend.python" ,
78]
89
9- # This will become the default in 2.11, and is only explicitly set to not break
10- # backwards-compatibility for existing users. If you are setting up Pants for
11- # the first time, set this to false.
12- use_deprecated_python_macros = false
13-
1410[anonymous-telemetry ]
1511enabled = true
1612repo_id = " 205E301D-44A4-42FF-8495-C9D41871A431"
File renamed without changes.
Original file line number Diff line number Diff line change 11syntax = "proto3" ;
22
3- package simple_example ;
3+ package simple_example.v1 ;
44
55message Person {
66 string name = 1 ;
77 int32 id = 2 ;
88 string email = 3 ;
99}
10-
Original file line number Diff line number Diff line change 1- from simple_example .person_pb2 import Person
1+ from simple_example .v1 . person_pb2 import Person
22
33def test_person () -> None :
44 p = Person ()
You can’t perform that action at this time.
0 commit comments