Skip to content

Commit 8323306

Browse files
committed
fix: include proto file in build
Signed-off-by: Federico Bond <federicobond@gmail.com>
1 parent 1e35a08 commit 8323306

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
proto/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: v1
2+
managed:
3+
enabled: true
4+
plugins:
5+
- plugin: buf.build/protocolbuffers/python:v23.4
6+
out: proto
7+
- plugin: buf.build/grpc/python:v1.56.0
8+
out: proto

providers/openfeature-provider-flagd/pyproject.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pyproject.toml
22
[build-system]
3-
requires = ["hatchling"]
3+
requires = ["hatchling", "hatch-build-scripts"]
44
build-backend = "hatchling.build"
55

66
[project]
@@ -28,13 +28,21 @@ Homepage = "https://github.com/open-feature/python-sdk-contrib"
2828

2929
[tool.hatch]
3030

31+
[[tool.hatch.build.hooks.build-scripts.scripts]]
32+
commands = [
33+
"./scripts/gen_protos.sh",
34+
]
35+
artifacts = ["proto/**/*.py"]
36+
out_dir = "src/openfeature/contrib/provider/flagd"
37+
3138
[tool.hatch.envs.default]
3239
dependencies = [
3340
"coverage[toml]>=6.5",
3441
"pytest",
3542
]
3643
post-install-commands = [
37-
"./scripts/gen_protos.sh"
44+
"./scripts/gen_protos.sh",
45+
"rm -r src/openfeature/contrib/provider/flagd/proto && mv proto src/openfeature/contrib/provider/flagd",
3846
]
3947

4048
[tool.hatch.envs.default.scripts]

providers/openfeature-provider-flagd/scripts/gen_protos.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
set -e
44

5-
buf generate buf.build/open-feature/flagd --template schemas/protobuf/buf.gen.python.yaml --output schemas
6-
rm -rf openfeature/contrib/provider/flagd/proto
7-
sed -i.bak 's/^from schema.v1 import/from . import/' proto/python/schema/v1/*.py
8-
rm proto/python/schema/v1/*.bak
9-
mv proto/python src/openfeature/contrib/provider/flagd/proto
10-
rmdir proto
5+
buf generate buf.build/open-feature/flagd --template buf.gen.python.yaml
6+
sed -i.bak 's/^from schema.v1 import/from . import/' proto/schema/v1/*.py
7+
rm proto/schema/v1/*.bak

0 commit comments

Comments
 (0)