tesla-ble 6.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tesla_ble-6.0.1/.clang-format +137 -0
- tesla_ble-6.0.1/.clang-tidy +163 -0
- tesla_ble-6.0.1/.codecov.yml +21 -0
- tesla_ble-6.0.1/.github/FUNDING.yml +1 -0
- tesla_ble-6.0.1/.github/dependabot.yml +6 -0
- tesla_ble-6.0.1/.github/workflows/cmake.yml +174 -0
- tesla_ble-6.0.1/.github/workflows/python-wheels.yml +95 -0
- tesla_ble-6.0.1/.github/workflows/release.yml +64 -0
- tesla_ble-6.0.1/.gitignore +222 -0
- tesla_ble-6.0.1/AGENTS.md +61 -0
- tesla_ble-6.0.1/CHANGELOG.md +45 -0
- tesla_ble-6.0.1/CMakeLists.txt +217 -0
- tesla_ble-6.0.1/LICENSE +661 -0
- tesla_ble-6.0.1/NOTICE +41 -0
- tesla_ble-6.0.1/PKG-INFO +284 -0
- tesla_ble-6.0.1/README.md +267 -0
- tesla_ble-6.0.1/VERSION +1 -0
- tesla_ble-6.0.1/bindings/python/.gitignore +6 -0
- tesla_ble-6.0.1/bindings/python/CMakeLists.txt +37 -0
- tesla_ble-6.0.1/bindings/python/README.md +150 -0
- tesla_ble-6.0.1/bindings/python/cpp/module.cpp +1029 -0
- tesla_ble-6.0.1/bindings/python/cpp/simulated_vehicle.cpp +937 -0
- tesla_ble-6.0.1/bindings/python/cpp/simulated_vehicle.h +114 -0
- tesla_ble-6.0.1/bindings/python/cpp/state_dicts.cpp +425 -0
- tesla_ble-6.0.1/bindings/python/cpp/state_dicts.h +22 -0
- tesla_ble-6.0.1/bindings/python/src/tesla_ble/__init__.py +81 -0
- tesla_ble-6.0.1/bindings/python/src/tesla_ble/_tesla_ble.pyi +289 -0
- tesla_ble-6.0.1/bindings/python/src/tesla_ble/py.typed +0 -0
- tesla_ble-6.0.1/bindings/python/tests/conftest.py +85 -0
- tesla_ble-6.0.1/bindings/python/tests/stubtest_allowlist.txt +2 -0
- tesla_ble-6.0.1/bindings/python/tests/test_module.py +88 -0
- tesla_ble-6.0.1/bindings/python/tests/test_offline_flow.py +545 -0
- tesla_ble-6.0.1/bindings/python/tests/test_runtime.py +225 -0
- tesla_ble-6.0.1/bindings/python/tests/typing_contract.py +38 -0
- tesla_ble-6.0.1/bindings/python/tools/gen_state_dicts.py +253 -0
- tesla_ble-6.0.1/examples/simple/.gitignore +3 -0
- tesla_ble-6.0.1/examples/simple/CMakeLists.txt +7 -0
- tesla_ble-6.0.1/examples/simple/main.cpp +264 -0
- tesla_ble-6.0.1/generated/include/car_server.pb.h +2316 -0
- tesla_ble-6.0.1/generated/include/common.pb.h +270 -0
- tesla_ble-6.0.1/generated/include/errors.pb.h +66 -0
- tesla_ble-6.0.1/generated/include/google/protobuf/timestamp.pb.h +147 -0
- tesla_ble-6.0.1/generated/include/keys.pb.h +37 -0
- tesla_ble-6.0.1/generated/include/managed_charging.pb.h +47 -0
- tesla_ble-6.0.1/generated/include/signatures.pb.h +300 -0
- tesla_ble-6.0.1/generated/include/universal_message.pb.h +286 -0
- tesla_ble-6.0.1/generated/include/vcsec.pb.h +876 -0
- tesla_ble-6.0.1/generated/include/vehicle.pb.h +3431 -0
- tesla_ble-6.0.1/generated/src/car_server.pb.c +184 -0
- tesla_ble-6.0.1/generated/src/common.pb.c +21 -0
- tesla_ble-6.0.1/generated/src/errors.pb.c +9 -0
- tesla_ble-6.0.1/generated/src/google/protobuf/timestamp.pb.c +12 -0
- tesla_ble-6.0.1/generated/src/keys.pb.c +7 -0
- tesla_ble-6.0.1/generated/src/managed_charging.pb.c +7 -0
- tesla_ble-6.0.1/generated/src/signatures.pb.c +23 -0
- tesla_ble-6.0.1/generated/src/universal_message.pb.c +15 -0
- tesla_ble-6.0.1/generated/src/vcsec.pb.c +47 -0
- tesla_ble-6.0.1/generated/src/vehicle.pb.c +85 -0
- tesla_ble-6.0.1/idf_component.yml +12 -0
- tesla_ble-6.0.1/include/adapters.h +85 -0
- tesla_ble-6.0.1/include/client.h +198 -0
- tesla_ble-6.0.1/include/command_error.h +89 -0
- tesla_ble-6.0.1/include/crypto_context.h +183 -0
- tesla_ble-6.0.1/include/defs.h +44 -0
- tesla_ble-6.0.1/include/errors.h +39 -0
- tesla_ble-6.0.1/include/message_builders.h +81 -0
- tesla_ble-6.0.1/include/message_processor.h +68 -0
- tesla_ble-6.0.1/include/peer.h +186 -0
- tesla_ble-6.0.1/include/polling_policy.h +77 -0
- tesla_ble-6.0.1/include/sliding_window.h +97 -0
- tesla_ble-6.0.1/include/state_text.h +57 -0
- tesla_ble-6.0.1/include/tb_logging.h +39 -0
- tesla_ble-6.0.1/include/tb_utils.h +12 -0
- tesla_ble-6.0.1/include/vehicle.h +504 -0
- tesla_ble-6.0.1/include/vin_utils.h +52 -0
- tesla_ble-6.0.1/library.json +29 -0
- tesla_ble-6.0.1/proto/Makefile +32 -0
- tesla_ble-6.0.1/proto/README.md +3 -0
- tesla_ble-6.0.1/proto/car_server.options +41 -0
- tesla_ble-6.0.1/proto/car_server.proto +554 -0
- tesla_ble-6.0.1/proto/common.proto +78 -0
- tesla_ble-6.0.1/proto/errors.proto +22 -0
- tesla_ble-6.0.1/proto/google/protobuf/timestamp.proto +145 -0
- tesla_ble-6.0.1/proto/keys.proto +17 -0
- tesla_ble-6.0.1/proto/managed_charging.proto +22 -0
- tesla_ble-6.0.1/proto/signatures.options +17 -0
- tesla_ble-6.0.1/proto/signatures.proto +94 -0
- tesla_ble-6.0.1/proto/universal_message.options +14 -0
- tesla_ble-6.0.1/proto/universal_message.proto +101 -0
- tesla_ble-6.0.1/proto/vcsec.options +8 -0
- tesla_ble-6.0.1/proto/vcsec.proto +296 -0
- tesla_ble-6.0.1/proto/vehicle.options +20 -0
- tesla_ble-6.0.1/proto/vehicle.proto +746 -0
- tesla_ble-6.0.1/pyproject.toml +77 -0
- tesla_ble-6.0.1/scripts/check_dist.py +70 -0
- tesla_ble-6.0.1/scripts/clang-format.sh +66 -0
- tesla_ble-6.0.1/scripts/clang-tidy.sh +154 -0
- tesla_ble-6.0.1/scripts/release.sh +86 -0
- tesla_ble-6.0.1/scripts/run_tests.sh +196 -0
- tesla_ble-6.0.1/scripts/set-version.sh +47 -0
- tesla_ble-6.0.1/scripts/setup_dev_environment.sh +245 -0
- tesla_ble-6.0.1/scripts/test_check_dist.py +63 -0
- tesla_ble-6.0.1/src/client.cpp +1153 -0
- tesla_ble-6.0.1/src/crypto_context.cpp +476 -0
- tesla_ble-6.0.1/src/errors.cpp +19 -0
- tesla_ble-6.0.1/src/logging_bridge.cpp +87 -0
- tesla_ble-6.0.1/src/message_builders.cpp +546 -0
- tesla_ble-6.0.1/src/message_processor.cpp +74 -0
- tesla_ble-6.0.1/src/peer.cpp +625 -0
- tesla_ble-6.0.1/src/state_text.cpp +186 -0
- tesla_ble-6.0.1/src/tb_logging.cpp +813 -0
- tesla_ble-6.0.1/src/tb_utils.cpp +60 -0
- tesla_ble-6.0.1/src/vehicle.cpp +2011 -0
- tesla_ble-6.0.1/src/vin_utils.cpp +97 -0
- tesla_ble-6.0.1/tests/.gitignore +16 -0
- tesla_ble-6.0.1/tests/CMakeLists.txt +59 -0
- tesla_ble-6.0.1/tests/mocks/mock_adapters.h +64 -0
- tesla_ble-6.0.1/tests/test_ad_buffer_construction.cpp +360 -0
- tesla_ble-6.0.1/tests/test_client.cpp +64 -0
- tesla_ble-6.0.1/tests/test_command_helpers.h +52 -0
- tesla_ble-6.0.1/tests/test_constants.h +157 -0
- tesla_ble-6.0.1/tests/test_encrypted_responses.cpp +423 -0
- tesla_ble-6.0.1/tests/test_error_handling.cpp +210 -0
- tesla_ble-6.0.1/tests/test_key_generation.cpp +107 -0
- tesla_ble-6.0.1/tests/test_logging.cpp +166 -0
- tesla_ble-6.0.1/tests/test_message_building.cpp +585 -0
- tesla_ble-6.0.1/tests/test_message_parsing.cpp +338 -0
- tesla_ble-6.0.1/tests/test_message_processor.cpp +65 -0
- tesla_ble-6.0.1/tests/test_polling_policy.cpp +206 -0
- tesla_ble-6.0.1/tests/test_protocol_authentication.cpp +308 -0
- tesla_ble-6.0.1/tests/test_protocol_compliance.cpp +165 -0
- tesla_ble-6.0.1/tests/test_protocol_edge_cases.cpp +72 -0
- tesla_ble-6.0.1/tests/test_protocol_handshake.cpp +362 -0
- tesla_ble-6.0.1/tests/test_protocol_vectors.cpp +128 -0
- tesla_ble-6.0.1/tests/test_session_management.cpp +117 -0
- tesla_ble-6.0.1/tests/test_session_recovery.cpp +282 -0
- tesla_ble-6.0.1/tests/test_state_text.cpp +122 -0
- tesla_ble-6.0.1/tests/test_tb_utils.cpp +120 -0
- tesla_ble-6.0.1/tests/test_vehicle.cpp +2960 -0
- tesla_ble-6.0.1/tests/test_vin_utils.cpp +144 -0
- tesla_ble-6.0.1/uv.lock +349 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Language: Cpp
|
|
2
|
+
AccessModifierOffset: -1
|
|
3
|
+
AlignAfterOpenBracket: Align
|
|
4
|
+
AlignConsecutiveAssignments: false
|
|
5
|
+
AlignConsecutiveDeclarations: false
|
|
6
|
+
AlignEscapedNewlines: DontAlign
|
|
7
|
+
AlignOperands: true
|
|
8
|
+
AlignTrailingComments: true
|
|
9
|
+
AllowAllParametersOfDeclarationOnNextLine: true
|
|
10
|
+
AllowShortBlocksOnASingleLine: false
|
|
11
|
+
AllowShortCaseLabelsOnASingleLine: false
|
|
12
|
+
AllowShortFunctionsOnASingleLine: All
|
|
13
|
+
AllowShortIfStatementsOnASingleLine: false
|
|
14
|
+
AllowShortLoopsOnASingleLine: false
|
|
15
|
+
AlwaysBreakAfterReturnType: None
|
|
16
|
+
AlwaysBreakBeforeMultilineStrings: false
|
|
17
|
+
AlwaysBreakTemplateDeclarations: MultiLine
|
|
18
|
+
BinPackArguments: true
|
|
19
|
+
BinPackParameters: true
|
|
20
|
+
BraceWrapping:
|
|
21
|
+
AfterClass: false
|
|
22
|
+
AfterControlStatement: false
|
|
23
|
+
AfterEnum: false
|
|
24
|
+
AfterFunction: false
|
|
25
|
+
AfterNamespace: false
|
|
26
|
+
AfterObjCDeclaration: false
|
|
27
|
+
AfterStruct: false
|
|
28
|
+
AfterUnion: false
|
|
29
|
+
AfterExternBlock: false
|
|
30
|
+
BeforeCatch: false
|
|
31
|
+
BeforeElse: false
|
|
32
|
+
IndentBraces: false
|
|
33
|
+
SplitEmptyFunction: true
|
|
34
|
+
SplitEmptyRecord: true
|
|
35
|
+
SplitEmptyNamespace: true
|
|
36
|
+
BreakBeforeBinaryOperators: None
|
|
37
|
+
BreakBeforeBraces: Attach
|
|
38
|
+
BreakBeforeInheritanceComma: false
|
|
39
|
+
BreakInheritanceList: BeforeColon
|
|
40
|
+
BreakBeforeTernaryOperators: true
|
|
41
|
+
BreakConstructorInitializersBeforeComma: false
|
|
42
|
+
BreakConstructorInitializers: BeforeColon
|
|
43
|
+
BreakAfterJavaFieldAnnotations: false
|
|
44
|
+
BreakStringLiterals: true
|
|
45
|
+
ColumnLimit: 120
|
|
46
|
+
CommentPragmas: '^ IWYU pragma:'
|
|
47
|
+
CompactNamespaces: false
|
|
48
|
+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|
49
|
+
ConstructorInitializerIndentWidth: 4
|
|
50
|
+
ContinuationIndentWidth: 4
|
|
51
|
+
Cpp11BracedListStyle: true
|
|
52
|
+
DerivePointerAlignment: false
|
|
53
|
+
DisableFormat: false
|
|
54
|
+
ExperimentalAutoDetectBinPacking: false
|
|
55
|
+
FixNamespaceComments: true
|
|
56
|
+
ForEachMacros:
|
|
57
|
+
- foreach
|
|
58
|
+
- Q_FOREACH
|
|
59
|
+
- BOOST_FOREACH
|
|
60
|
+
IncludeBlocks: Preserve
|
|
61
|
+
IncludeCategories:
|
|
62
|
+
- Regex: '^<ext/.*\.h>'
|
|
63
|
+
Priority: 2
|
|
64
|
+
- Regex: '^<.*\.h>'
|
|
65
|
+
Priority: 1
|
|
66
|
+
- Regex: '^<.*'
|
|
67
|
+
Priority: 2
|
|
68
|
+
- Regex: '.*'
|
|
69
|
+
Priority: 3
|
|
70
|
+
IncludeIsMainRegex: '([-_](test|unittest))?$'
|
|
71
|
+
IndentCaseLabels: true
|
|
72
|
+
IndentPPDirectives: None
|
|
73
|
+
IndentWidth: 2
|
|
74
|
+
IndentWrappedFunctionNames: false
|
|
75
|
+
KeepEmptyLinesAtTheStartOfBlocks: false
|
|
76
|
+
MacroBlockBegin: ''
|
|
77
|
+
MacroBlockEnd: ''
|
|
78
|
+
MaxEmptyLinesToKeep: 1
|
|
79
|
+
NamespaceIndentation: None
|
|
80
|
+
PenaltyBreakAssignment: 2
|
|
81
|
+
PenaltyBreakBeforeFirstCallParameter: 1
|
|
82
|
+
PenaltyBreakComment: 300
|
|
83
|
+
PenaltyBreakFirstLessLess: 120
|
|
84
|
+
PenaltyBreakString: 1000
|
|
85
|
+
PenaltyBreakTemplateDeclaration: 10
|
|
86
|
+
PenaltyExcessCharacter: 1000000
|
|
87
|
+
PenaltyReturnTypeOnItsOwnLine: 2000
|
|
88
|
+
PointerAlignment: Right
|
|
89
|
+
RawStringFormats:
|
|
90
|
+
- Language: Cpp
|
|
91
|
+
Delimiters:
|
|
92
|
+
- cc
|
|
93
|
+
- CC
|
|
94
|
+
- cpp
|
|
95
|
+
- Cpp
|
|
96
|
+
- CPP
|
|
97
|
+
- 'c++'
|
|
98
|
+
- 'C++'
|
|
99
|
+
CanonicalDelimiter: ''
|
|
100
|
+
BasedOnStyle: google
|
|
101
|
+
- Language: TextProto
|
|
102
|
+
Delimiters:
|
|
103
|
+
- pb
|
|
104
|
+
- PB
|
|
105
|
+
- proto
|
|
106
|
+
- PROTO
|
|
107
|
+
EnclosingFunctions:
|
|
108
|
+
- EqualsProto
|
|
109
|
+
- EquivToProto
|
|
110
|
+
- PARSE_PARTIAL_TEXT_PROTO
|
|
111
|
+
- PARSE_TEST_PROTO
|
|
112
|
+
- PARSE_TEXT_PROTO
|
|
113
|
+
- ParseTextOrDie
|
|
114
|
+
- ParseTextProtoOrDie
|
|
115
|
+
CanonicalDelimiter: ''
|
|
116
|
+
BasedOnStyle: google
|
|
117
|
+
ReflowComments: true
|
|
118
|
+
SortIncludes: false
|
|
119
|
+
SortUsingDeclarations: false
|
|
120
|
+
SpaceAfterCStyleCast: true
|
|
121
|
+
SpaceAfterTemplateKeyword: false
|
|
122
|
+
SpaceBeforeAssignmentOperators: true
|
|
123
|
+
SpaceBeforeCpp11BracedList: false
|
|
124
|
+
SpaceBeforeCtorInitializerColon: true
|
|
125
|
+
SpaceBeforeInheritanceColon: true
|
|
126
|
+
SpaceBeforeParens: ControlStatements
|
|
127
|
+
SpaceBeforeRangeBasedForLoopColon: true
|
|
128
|
+
SpaceInEmptyParentheses: false
|
|
129
|
+
SpacesBeforeTrailingComments: 2
|
|
130
|
+
SpacesInAngles: false
|
|
131
|
+
SpacesInContainerLiterals: false
|
|
132
|
+
SpacesInCStyleCastParentheses: false
|
|
133
|
+
SpacesInParentheses: false
|
|
134
|
+
SpacesInSquareBrackets: false
|
|
135
|
+
Standard: Auto
|
|
136
|
+
TabWidth: 2
|
|
137
|
+
UseTab: Never
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
Checks: >-
|
|
3
|
+
bugprone-*,
|
|
4
|
+
cppcoreguidelines-*,
|
|
5
|
+
google-*,
|
|
6
|
+
modernize-*,
|
|
7
|
+
performance-*,
|
|
8
|
+
readability-*,
|
|
9
|
+
-bugprone-easily-swappable-parameters,
|
|
10
|
+
-bugprone-implicit-widening-of-multiplication-result,
|
|
11
|
+
-bugprone-multi-level-implicit-pointer-conversion,
|
|
12
|
+
-bugprone-narrowing-conversions,
|
|
13
|
+
-bugprone-signed-char-misuse,
|
|
14
|
+
-bugprone-switch-missing-default-case,
|
|
15
|
+
-cppcoreguidelines-avoid-c-arrays,
|
|
16
|
+
-cppcoreguidelines-avoid-const-or-ref-data-members,
|
|
17
|
+
-cppcoreguidelines-avoid-do-while,
|
|
18
|
+
-cppcoreguidelines-avoid-magic-numbers,
|
|
19
|
+
-cppcoreguidelines-init-variables,
|
|
20
|
+
-cppcoreguidelines-macro-to-enum,
|
|
21
|
+
-cppcoreguidelines-macro-usage,
|
|
22
|
+
-cppcoreguidelines-missing-std-forward,
|
|
23
|
+
-cppcoreguidelines-narrowing-conversions,
|
|
24
|
+
-cppcoreguidelines-non-private-member-variables-in-classes,
|
|
25
|
+
-cppcoreguidelines-owning-memory,
|
|
26
|
+
-cppcoreguidelines-prefer-member-initializer,
|
|
27
|
+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
|
|
28
|
+
-cppcoreguidelines-pro-bounds-constant-array-index,
|
|
29
|
+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
|
|
30
|
+
-cppcoreguidelines-pro-type-const-cast,
|
|
31
|
+
-cppcoreguidelines-pro-type-cstyle-cast,
|
|
32
|
+
-cppcoreguidelines-pro-type-member-init,
|
|
33
|
+
-cppcoreguidelines-pro-type-reinterpret-cast,
|
|
34
|
+
-cppcoreguidelines-pro-type-static-cast-downcast,
|
|
35
|
+
-cppcoreguidelines-pro-type-union-access,
|
|
36
|
+
-cppcoreguidelines-pro-type-vararg,
|
|
37
|
+
-cppcoreguidelines-rvalue-reference-param-not-moved,
|
|
38
|
+
-cppcoreguidelines-special-member-functions,
|
|
39
|
+
-cppcoreguidelines-use-default-member-init,
|
|
40
|
+
-cppcoreguidelines-virtual-class-destructor,
|
|
41
|
+
-google-build-using-namespace,
|
|
42
|
+
-google-explicit-constructor,
|
|
43
|
+
-google-readability-braces-around-statements,
|
|
44
|
+
-google-readability-casting,
|
|
45
|
+
-google-readability-namespace-comments,
|
|
46
|
+
-google-readability-todo,
|
|
47
|
+
-google-runtime-references,
|
|
48
|
+
-modernize-avoid-bind,
|
|
49
|
+
-modernize-avoid-c-arrays,
|
|
50
|
+
-modernize-concat-nested-namespaces,
|
|
51
|
+
-modernize-macro-to-enum,
|
|
52
|
+
-modernize-return-braced-init-list,
|
|
53
|
+
-modernize-type-traits,
|
|
54
|
+
-modernize-use-auto,
|
|
55
|
+
-modernize-use-constraints,
|
|
56
|
+
-modernize-use-default-member-init,
|
|
57
|
+
-modernize-use-equals-default,
|
|
58
|
+
-modernize-use-nodiscard,
|
|
59
|
+
-modernize-use-nullptr,
|
|
60
|
+
-modernize-use-trailing-return-type,
|
|
61
|
+
-performance-enum-size,
|
|
62
|
+
-readability-avoid-nested-conditional-operator,
|
|
63
|
+
-readability-container-contains,
|
|
64
|
+
-readability-container-data-pointer,
|
|
65
|
+
-readability-convert-member-functions-to-static,
|
|
66
|
+
-readability-else-after-return,
|
|
67
|
+
-readability-function-cognitive-complexity,
|
|
68
|
+
-readability-implicit-bool-conversion,
|
|
69
|
+
-readability-isolate-declaration,
|
|
70
|
+
-readability-magic-numbers,
|
|
71
|
+
-readability-make-member-function-const,
|
|
72
|
+
-readability-named-parameter,
|
|
73
|
+
-readability-redundant-casting,
|
|
74
|
+
-readability-redundant-inline-specifier,
|
|
75
|
+
-readability-redundant-member-init,
|
|
76
|
+
-readability-redundant-string-init,
|
|
77
|
+
-readability-uppercase-literal-suffix,
|
|
78
|
+
-readability-use-anyofallof,
|
|
79
|
+
WarningsAsErrors: '*'
|
|
80
|
+
HeaderFilterRegex: '.*'
|
|
81
|
+
ExcludeHeaderFilterRegex: '(generated|_deps)/.*'
|
|
82
|
+
FormatStyle: google
|
|
83
|
+
CheckOptions:
|
|
84
|
+
- key: google-readability-function-size.StatementThreshold
|
|
85
|
+
value: '800'
|
|
86
|
+
- key: google-runtime-int.TypeSuffix
|
|
87
|
+
value: '_t'
|
|
88
|
+
- key: llvm-namespace-comment.ShortNamespaceLines
|
|
89
|
+
value: '10'
|
|
90
|
+
- key: llvm-namespace-comment.SpacesBeforeComments
|
|
91
|
+
value: '2'
|
|
92
|
+
- key: modernize-loop-convert.MaxCopySize
|
|
93
|
+
value: '16'
|
|
94
|
+
- key: modernize-loop-convert.MinConfidence
|
|
95
|
+
value: reasonable
|
|
96
|
+
- key: modernize-loop-convert.NamingStyle
|
|
97
|
+
value: CamelCase
|
|
98
|
+
- key: modernize-pass-by-value.IncludeStyle
|
|
99
|
+
value: llvm
|
|
100
|
+
- key: modernize-replace-auto-ptr.IncludeStyle
|
|
101
|
+
value: llvm
|
|
102
|
+
- key: modernize-use-nullptr.NullMacros
|
|
103
|
+
value: 'NULL'
|
|
104
|
+
- key: modernize-make-unique.MakeSmartPtrFunction
|
|
105
|
+
value: 'make_unique'
|
|
106
|
+
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
|
|
107
|
+
value: 'esphome/core/helpers.h'
|
|
108
|
+
- key: readability-braces-around-statements.ShortStatementLines
|
|
109
|
+
value: 2
|
|
110
|
+
- key: readability-identifier-naming.LocalVariableCase
|
|
111
|
+
value: 'lower_case'
|
|
112
|
+
- key: readability-identifier-naming.ClassCase
|
|
113
|
+
value: 'CamelCase'
|
|
114
|
+
- key: readability-identifier-naming.StructCase
|
|
115
|
+
value: 'CamelCase'
|
|
116
|
+
- key: readability-identifier-naming.EnumCase
|
|
117
|
+
value: 'CamelCase'
|
|
118
|
+
- key: readability-identifier-naming.EnumConstantCase
|
|
119
|
+
value: 'UPPER_CASE'
|
|
120
|
+
- key: readability-identifier-naming.StaticConstantCase
|
|
121
|
+
value: 'UPPER_CASE'
|
|
122
|
+
- key: readability-identifier-naming.StaticVariableCase
|
|
123
|
+
value: 'lower_case'
|
|
124
|
+
- key: readability-identifier-naming.GlobalConstantCase
|
|
125
|
+
value: 'UPPER_CASE'
|
|
126
|
+
- key: readability-identifier-naming.ParameterCase
|
|
127
|
+
value: 'lower_case'
|
|
128
|
+
- key: readability-identifier-naming.PrivateMemberCase
|
|
129
|
+
value: 'lower_case'
|
|
130
|
+
- key: readability-identifier-naming.PrivateMemberSuffix
|
|
131
|
+
value: '_'
|
|
132
|
+
- key: readability-identifier-naming.PrivateMethodCase
|
|
133
|
+
value: 'lower_case'
|
|
134
|
+
- key: readability-identifier-naming.PrivateMethodSuffix
|
|
135
|
+
value: '_'
|
|
136
|
+
- key: readability-identifier-naming.ClassMemberCase
|
|
137
|
+
value: 'lower_case'
|
|
138
|
+
- key: readability-identifier-naming.ClassMemberCase
|
|
139
|
+
value: 'lower_case'
|
|
140
|
+
- key: readability-identifier-naming.ProtectedMemberCase
|
|
141
|
+
value: 'lower_case'
|
|
142
|
+
- key: readability-identifier-naming.ProtectedMemberSuffix
|
|
143
|
+
value: '_'
|
|
144
|
+
- key: readability-identifier-naming.FunctionCase
|
|
145
|
+
value: 'lower_case'
|
|
146
|
+
- key: readability-identifier-naming.ClassMethodCase
|
|
147
|
+
value: 'lower_case'
|
|
148
|
+
- key: readability-identifier-naming.ProtectedMethodCase
|
|
149
|
+
value: 'lower_case'
|
|
150
|
+
- key: readability-identifier-naming.ProtectedMethodSuffix
|
|
151
|
+
value: '_'
|
|
152
|
+
- key: readability-identifier-naming.VirtualMethodCase
|
|
153
|
+
value: 'lower_case'
|
|
154
|
+
- key: readability-identifier-naming.VirtualMethodSuffix
|
|
155
|
+
value: ''
|
|
156
|
+
- key: readability-qualified-auto.AddConstToQualified
|
|
157
|
+
value: 0
|
|
158
|
+
- key: readability-identifier-length.MinimumVariableNameLength
|
|
159
|
+
value: 0
|
|
160
|
+
- key: readability-identifier-length.MinimumParameterNameLength
|
|
161
|
+
value: 0
|
|
162
|
+
- key: readability-identifier-length.MinimumLoopCounterNameLength
|
|
163
|
+
value: 0
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
coverage:
|
|
2
|
+
status:
|
|
3
|
+
project:
|
|
4
|
+
default:
|
|
5
|
+
target: 70%
|
|
6
|
+
threshold: 5%
|
|
7
|
+
patch:
|
|
8
|
+
default:
|
|
9
|
+
target: 70%
|
|
10
|
+
threshold: 5%
|
|
11
|
+
|
|
12
|
+
ignore:
|
|
13
|
+
- "tests/"
|
|
14
|
+
- "examples/"
|
|
15
|
+
- "build/"
|
|
16
|
+
- "_deps/"
|
|
17
|
+
|
|
18
|
+
comment:
|
|
19
|
+
layout: "reach,diff,flags,tree"
|
|
20
|
+
behavior: default
|
|
21
|
+
require_changes: false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: yoziru
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
name: CI/CD Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["main"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
# Prevent redundant runs on the same branch
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
BUILD_TYPE: Release
|
|
15
|
+
# NOTE: When updating CLANG_VERSION, also update the matrix packages below
|
|
16
|
+
CLANG_VERSION: 21
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
python_quality:
|
|
20
|
+
name: Python lint, format and types
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v6
|
|
24
|
+
- uses: astral-sh/setup-uv@v10.3.0
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.13"
|
|
27
|
+
- run: uv sync --locked --only-dev
|
|
28
|
+
- run: uv run --no-sync ruff check bindings/python scripts
|
|
29
|
+
- run: uv run --no-sync ruff format --check bindings/python scripts
|
|
30
|
+
- run: uv run --no-sync mypy
|
|
31
|
+
|
|
32
|
+
python:
|
|
33
|
+
name: Python ${{ matrix.python }} bindings and packaging
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
strategy:
|
|
36
|
+
matrix:
|
|
37
|
+
python: ["3.13", "3.14", "3.15"]
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v6
|
|
40
|
+
- uses: astral-sh/setup-uv@v10.3.0
|
|
41
|
+
with:
|
|
42
|
+
python-version: ${{ matrix.python }}
|
|
43
|
+
- run: uv sync --locked --only-dev
|
|
44
|
+
- run: uv build
|
|
45
|
+
- run: uv run --no-sync python scripts/check_dist.py dist
|
|
46
|
+
- run: uv pip install --python .venv/bin/python dist/*.whl
|
|
47
|
+
- run: uv run --no-sync pytest bindings/python/tests -q
|
|
48
|
+
- run: uv run --no-sync mypy --strict bindings/python/tests/typing_contract.py
|
|
49
|
+
- run: uv run --no-sync python -m mypy.stubtest tesla_ble._tesla_ble --allowlist bindings/python/tests/stubtest_allowlist.txt
|
|
50
|
+
|
|
51
|
+
checks:
|
|
52
|
+
name: ${{ matrix.check-name }}
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
strategy:
|
|
55
|
+
fail-fast: false # Show all failures instead of stopping early
|
|
56
|
+
matrix:
|
|
57
|
+
include:
|
|
58
|
+
- check: format
|
|
59
|
+
check-name: Format Check
|
|
60
|
+
packages: clang-format-21
|
|
61
|
+
needs_symlink: true
|
|
62
|
+
- check: tidy
|
|
63
|
+
check-name: Tidy Check
|
|
64
|
+
packages: clang-tidy-21 protobuf-compiler build-essential cmake ccache
|
|
65
|
+
needs_symlink: true
|
|
66
|
+
- check: test
|
|
67
|
+
check-name: Build and Test
|
|
68
|
+
packages: protobuf-compiler build-essential cmake ccache
|
|
69
|
+
- check: examples
|
|
70
|
+
check-name: Build Examples
|
|
71
|
+
packages: protobuf-compiler build-essential cmake ccache
|
|
72
|
+
|
|
73
|
+
steps:
|
|
74
|
+
- name: Checkout
|
|
75
|
+
uses: actions/checkout@v6
|
|
76
|
+
|
|
77
|
+
- name: Cache LLVM repository setup
|
|
78
|
+
if: matrix.check == 'format' || matrix.check == 'tidy'
|
|
79
|
+
id: cache-llvm-repo
|
|
80
|
+
uses: actions/cache@v4
|
|
81
|
+
with:
|
|
82
|
+
path: /etc/apt/sources.list.d/llvm.list
|
|
83
|
+
key: llvm-repo-noble-${{ env.CLANG_VERSION }}-${{ hashFiles('.github/workflows/cmake.yml') }}
|
|
84
|
+
|
|
85
|
+
- name: Add LLVM repository
|
|
86
|
+
if: (matrix.check == 'format' || matrix.check == 'tidy') && steps.cache-llvm-repo.outputs.cache-hit != 'true'
|
|
87
|
+
run: |
|
|
88
|
+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
|
|
89
|
+
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${{ env.CLANG_VERSION }} main" | sudo tee /etc/apt/sources.list.d/llvm.list
|
|
90
|
+
sudo apt-get update
|
|
91
|
+
|
|
92
|
+
- name: Install apt dependencies (with cache)
|
|
93
|
+
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
|
|
94
|
+
with:
|
|
95
|
+
packages: ${{ matrix.packages }}
|
|
96
|
+
version: 1.1
|
|
97
|
+
|
|
98
|
+
- name: Symlink clang-format
|
|
99
|
+
if: matrix.check == 'format'
|
|
100
|
+
run: |
|
|
101
|
+
ln -sf /usr/bin/clang-format-${{ env.CLANG_VERSION }} /usr/local/bin/clang-format
|
|
102
|
+
clang-format --version
|
|
103
|
+
|
|
104
|
+
- name: Install clang tools (uncached for correct symlinks)
|
|
105
|
+
if: matrix.check == 'tidy'
|
|
106
|
+
run: |
|
|
107
|
+
ln -sf /usr/bin/clang-tidy-${{ env.CLANG_VERSION }} /usr/local/bin/clang-tidy
|
|
108
|
+
clang-tidy --version
|
|
109
|
+
|
|
110
|
+
- name: Install python dependencies
|
|
111
|
+
if: matrix.check == 'test' || matrix.check == 'examples'
|
|
112
|
+
run: python3 -m pip install protobuf grpcio-tools
|
|
113
|
+
|
|
114
|
+
- name: Use a supported Python for clang-tidy
|
|
115
|
+
if: matrix.check == 'tidy'
|
|
116
|
+
uses: actions/setup-python@v5
|
|
117
|
+
with:
|
|
118
|
+
python-version: "3.14"
|
|
119
|
+
|
|
120
|
+
- name: Prepare bindings environment for clang-tidy
|
|
121
|
+
if: matrix.check == 'tidy'
|
|
122
|
+
run: |
|
|
123
|
+
python3 -m venv .venv
|
|
124
|
+
.venv/bin/pip install "pybind11>=3.1"
|
|
125
|
+
|
|
126
|
+
- name: Setup ccache
|
|
127
|
+
# Skip ccache for format check as it doesn't compile code
|
|
128
|
+
if: matrix.check != 'format'
|
|
129
|
+
uses: hendrikmuhs/ccache-action@v1.2.20
|
|
130
|
+
with:
|
|
131
|
+
key: checks-${{ matrix.check }}-${{ runner.os }}-mbedtls-3.6.6
|
|
132
|
+
|
|
133
|
+
- name: Set reusable strings
|
|
134
|
+
if: matrix.check != 'format'
|
|
135
|
+
id: strings
|
|
136
|
+
shell: bash
|
|
137
|
+
run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
|
138
|
+
|
|
139
|
+
- name: Configure CMake
|
|
140
|
+
if: matrix.check != 'format'
|
|
141
|
+
run: >
|
|
142
|
+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
|
|
143
|
+
-DCMAKE_CXX_COMPILER=g++
|
|
144
|
+
-DCMAKE_C_COMPILER=gcc
|
|
145
|
+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
|
|
146
|
+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
|
147
|
+
-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
|
148
|
+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
149
|
+
-S ${{ github.workspace }}
|
|
150
|
+
|
|
151
|
+
- name: Check clang-format
|
|
152
|
+
if: matrix.check == 'format'
|
|
153
|
+
run: ./scripts/clang-format.sh --check
|
|
154
|
+
|
|
155
|
+
- name: Run clang-tidy
|
|
156
|
+
if: matrix.check == 'tidy'
|
|
157
|
+
run: ./scripts/clang-tidy.sh --check
|
|
158
|
+
|
|
159
|
+
- name: Build Library
|
|
160
|
+
if: matrix.check == 'test'
|
|
161
|
+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ env.BUILD_TYPE }} -j
|
|
162
|
+
|
|
163
|
+
- name: Run Tests
|
|
164
|
+
if: matrix.check == 'test'
|
|
165
|
+
working-directory: ${{ steps.strings.outputs.build-output-dir }}
|
|
166
|
+
run: ctest --build-config ${{ env.BUILD_TYPE }} --output-on-failure --verbose
|
|
167
|
+
|
|
168
|
+
- name: Build and run example
|
|
169
|
+
if: matrix.check == 'examples'
|
|
170
|
+
run: |
|
|
171
|
+
mkdir -p build-example && cd build-example
|
|
172
|
+
cmake ../examples/simple -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
173
|
+
cmake --build . --config ${{ env.BUILD_TYPE }}
|
|
174
|
+
./simple
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
name: Python Wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
release:
|
|
6
|
+
types: [published]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build_wheels:
|
|
13
|
+
name: Wheels ${{ matrix.platform }} / ${{ matrix.arch }}
|
|
14
|
+
runs-on: ${{ matrix.runner }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
include:
|
|
19
|
+
- {runner: ubuntu-24.04, platform: manylinux, arch: x86_64}
|
|
20
|
+
- {runner: ubuntu-24.04, platform: musllinux, arch: x86_64}
|
|
21
|
+
- {runner: ubuntu-24.04-arm, platform: manylinux, arch: aarch64}
|
|
22
|
+
- {runner: ubuntu-24.04-arm, platform: musllinux, arch: aarch64}
|
|
23
|
+
- {runner: macos-15-intel, platform: macosx, arch: x86_64}
|
|
24
|
+
- {runner: macos-15, platform: macosx, arch: arm64}
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v7.0.1
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
- uses: astral-sh/setup-uv@v10.3.0
|
|
30
|
+
|
|
31
|
+
- uses: pypa/cibuildwheel@v4.3.1
|
|
32
|
+
env:
|
|
33
|
+
CIBW_ARCHS: ${{ matrix.arch }}
|
|
34
|
+
CIBW_BUILD: cp313-${{ matrix.platform }}* cp314-${{ matrix.platform }}* cp315-${{ matrix.platform }}*
|
|
35
|
+
|
|
36
|
+
- uses: actions/setup-python@v7.0.0
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.14"
|
|
39
|
+
- run: python scripts/check_dist.py wheelhouse
|
|
40
|
+
|
|
41
|
+
- uses: actions/upload-artifact@v7.0.2
|
|
42
|
+
with:
|
|
43
|
+
name: wheels-${{ matrix.platform }}-${{ matrix.arch }}
|
|
44
|
+
path: ./wheelhouse/*.whl
|
|
45
|
+
|
|
46
|
+
build_sdist:
|
|
47
|
+
name: Source distribution
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v7.0.1
|
|
51
|
+
with:
|
|
52
|
+
persist-credentials: false
|
|
53
|
+
- uses: actions/setup-python@v7.0.0
|
|
54
|
+
with:
|
|
55
|
+
python-version: "3.13"
|
|
56
|
+
# The sdist contains the whole C++ library and builds wheels standalone.
|
|
57
|
+
- run: pipx run build --sdist .
|
|
58
|
+
- run: python scripts/check_dist.py dist
|
|
59
|
+
- uses: actions/upload-artifact@v7.0.2
|
|
60
|
+
with:
|
|
61
|
+
name: sdist
|
|
62
|
+
path: dist/*.tar.gz
|
|
63
|
+
|
|
64
|
+
validate_dist:
|
|
65
|
+
name: Validate complete release matrix
|
|
66
|
+
needs: [build_wheels, build_sdist]
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v7.0.1
|
|
70
|
+
with:
|
|
71
|
+
persist-credentials: false
|
|
72
|
+
- uses: actions/setup-python@v7.0.0
|
|
73
|
+
with:
|
|
74
|
+
python-version: "3.14"
|
|
75
|
+
- uses: actions/download-artifact@v8.0.2
|
|
76
|
+
with:
|
|
77
|
+
path: dist
|
|
78
|
+
merge-multiple: true
|
|
79
|
+
- run: python scripts/check_dist.py --release-matrix dist
|
|
80
|
+
- run: python scripts/test_check_dist.py
|
|
81
|
+
|
|
82
|
+
publish:
|
|
83
|
+
name: Publish to PyPI
|
|
84
|
+
if: github.event_name == 'release'
|
|
85
|
+
needs: [validate_dist]
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
environment: pypi
|
|
88
|
+
permissions:
|
|
89
|
+
id-token: write
|
|
90
|
+
steps:
|
|
91
|
+
- uses: actions/download-artifact@v8.0.2
|
|
92
|
+
with:
|
|
93
|
+
path: dist
|
|
94
|
+
merge-multiple: true
|
|
95
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
bump:
|
|
7
|
+
description: Version bump type
|
|
8
|
+
required: true
|
|
9
|
+
default: patch
|
|
10
|
+
type: choice
|
|
11
|
+
options:
|
|
12
|
+
- patch
|
|
13
|
+
- minor
|
|
14
|
+
- major
|
|
15
|
+
version:
|
|
16
|
+
description: Explicit version override (X.Y.Z)
|
|
17
|
+
required: false
|
|
18
|
+
type: string
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
release:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
environment: release
|
|
27
|
+
|
|
28
|
+
steps:
|
|
29
|
+
- name: Require main branch
|
|
30
|
+
run: |
|
|
31
|
+
if [ "${GITHUB_REF_NAME}" != "main" ]; then
|
|
32
|
+
echo "Run releases from main only" >&2
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
- name: Require release token
|
|
37
|
+
env:
|
|
38
|
+
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
39
|
+
run: |
|
|
40
|
+
if [ -z "$RELEASE_TOKEN" ]; then
|
|
41
|
+
echo "Set RELEASE_TOKEN in the protected 'release' environment" >&2
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
- name: Checkout
|
|
46
|
+
uses: actions/checkout@v6
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
ref: main
|
|
50
|
+
token: ${{ secrets.RELEASE_TOKEN }}
|
|
51
|
+
|
|
52
|
+
- name: Run release
|
|
53
|
+
env:
|
|
54
|
+
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
55
|
+
INPUT_BUMP: ${{ inputs.bump }}
|
|
56
|
+
INPUT_VERSION: ${{ inputs.version }}
|
|
57
|
+
run: |
|
|
58
|
+
release_arg="$INPUT_VERSION"
|
|
59
|
+
if [ -z "$release_arg" ]; then
|
|
60
|
+
release_arg="$INPUT_BUMP"
|
|
61
|
+
fi
|
|
62
|
+
git config user.name "github-actions[bot]"
|
|
63
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
64
|
+
./scripts/release.sh "$release_arg"
|