Skip to content

Commit 254ce23

Browse files
feat: implement auditlog ng client (#41)
1 parent 0cfb39b commit 254ce23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+9405
-5
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Proto generation check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'src/sap_cloud_sdk/core/auditlog_ng/proto/**'
7+
- 'src/sap_cloud_sdk/core/auditlog_ng/buf.yaml'
8+
- 'src/sap_cloud_sdk/core/auditlog_ng/buf.gen.yaml'
9+
- 'src/sap_cloud_sdk/core/auditlog_ng/gen/**'
10+
- 'src/buf/**'
11+
- 'Makefile'
12+
push:
13+
branches: [main]
14+
paths:
15+
- 'src/sap_cloud_sdk/core/auditlog_ng/proto/**'
16+
- 'Makefile'
17+
18+
jobs:
19+
verify-proto:
20+
name: Verify generated proto code is up-to-date
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Check out repository
25+
uses: actions/checkout@v4
26+
27+
- name: Install buf
28+
uses: bufbuild/buf-setup-action@v1
29+
30+
- name: Regenerate proto code
31+
run: make proto
32+
33+
- name: Check for uncommitted changes
34+
run: git diff --exit-code

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Proto code generation for SAP Cloud SDK for Python
2+
# Requires: buf CLI (https://buf.build/docs/installation)
3+
4+
AUDITLOG_NG_DIR := src/sap_cloud_sdk/core/auditlog_ng
5+
GEN_DIR := $(AUDITLOG_NG_DIR)/gen
6+
BUF_DIR := src/buf
7+
8+
.PHONY: proto
9+
10+
proto:
11+
cd $(AUDITLOG_NG_DIR) && buf dep update && buf generate --include-imports
12+
find $(GEN_DIR) -type d -exec touch {}/__init__.py \;
13+
rm -rf $(BUF_DIR)
14+
mv $(GEN_DIR)/buf $(BUF_DIR)
15+
rm -rf $(GEN_DIR)/buf

pyproject.toml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ dependencies = [
2020
"opentelemetry-processor-baggage~=0.61b0",
2121
"traceloop-sdk~=0.52.0",
2222
"PyJWT~=2.10.1",
23+
"protobuf>=4.25.0",
24+
"protovalidate>=0.13.0",
25+
"grpcio>=1.60.0",
26+
"opentelemetry-api>=1.28.0",
27+
"opentelemetry-sdk>=1.28.0",
2328
]
2429

2530
[build-system]
2631
requires = ["hatchling"]
2732
build-backend = "hatchling.build"
2833

2934
[tool.hatch.build.targets.wheel]
30-
packages = ["src/sap_cloud_sdk"]
35+
packages = ["src/sap_cloud_sdk", "src/buf"]
3136

3237
[dependency-groups]
3338
dev = [
@@ -50,6 +55,8 @@ source = ["src"]
5055
omit = [
5156
"*/tests/*",
5257
"*/test_*",
58+
"*/sap_cloud_sdk/core/auditlog_ng/gen/*",
59+
"*/buf/*"
5360
]
5461
skip_empty = true
5562

@@ -64,7 +71,9 @@ exclude = [
6471
"build",
6572
"dist",
6673
"venv",
67-
"tests/"
74+
"tests/",
75+
"src/sap_cloud_sdk/core/auditlog_ng/gen",
76+
"src/buf"
6877
]
6978

7079
# Same as Black.
@@ -86,5 +95,14 @@ indent-style = "space"
8695
skip-magic-trailing-comma = false
8796
line-ending = "auto"
8897

98+
[tool.ty]
99+
89100
[tool.ty.environment]
90101
python-version = "3.11"
102+
103+
[tool.ty.src]
104+
include = ["src", "tests"]
105+
exclude = [
106+
"src/sap_cloud_sdk/core/auditlog_ng/gen",
107+
"src/buf",
108+
]

src/buf/__init__.py

Whitespace-only changes.

src/buf/validate/__init__.py

Whitespace-only changes.

src/buf/validate/validate_pb2.py

Lines changed: 465 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)