Skip to content

Commit

Permalink
fix: check in generated proto files
Browse files Browse the repository at this point in the history
  • Loading branch information
federicobond committed Feb 23, 2024
1 parent 8323306 commit d09e9b5
Show file tree
Hide file tree
Showing 14 changed files with 981 additions and 27 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ var/
.installed.cfg
*.egg

# Protobuf files
*_pb2.py
*_pb2_grpc.py

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand Down
1 change: 0 additions & 1 deletion providers/openfeature-provider-flagd/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions providers/openfeature-provider-flagd/buf.gen.python.yaml

This file was deleted.

12 changes: 2 additions & 10 deletions providers/openfeature-provider-flagd/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pyproject.toml
[build-system]
requires = ["hatchling", "hatch-build-scripts"]
requires = ["hatchling"]
build-backend = "hatchling.build"

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

[tool.hatch]

[[tool.hatch.build.hooks.build-scripts.scripts]]
commands = [
"./scripts/gen_protos.sh",
]
artifacts = ["proto/**/*.py"]
out_dir = "src/openfeature/contrib/provider/flagd"

[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
post-install-commands = [
"./scripts/gen_protos.sh",
"rm -r src/openfeature/contrib/provider/flagd/proto && mv proto src/openfeature/contrib/provider/flagd",
"./scripts/gen_protos.sh"
]

[tool.hatch.envs.default.scripts]
Expand Down
9 changes: 6 additions & 3 deletions providers/openfeature-provider-flagd/scripts/gen_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -e

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d09e9b5

Please sign in to comment.