Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: "pip"

- uses: bufbuild/buf-action@v1
with:
github_token: ${{ github.token }}
setup_only: true

- name: Install hatch
run: pip install hatch

- name: Building first to generate files
run: hatch build
working-directory: ${{ matrix.package }}

- name: Test with pytest
run: hatch run cov
run: hatch test -c
working-directory: ${{ matrix.package }}

- if: matrix.python-version == '3.11'
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "schemas"]
path = providers/openfeature-provider-flagd/schemas
path = providers/openfeature-provider-flagd/openfeature/schemas
url = https://github.com/open-feature/schemas
[submodule "providers/openfeature-provider-flagd/test-harness"]
path = providers/openfeature-provider-flagd/test-harness
path = providers/openfeature-provider-flagd/openfeature/test-harness
url = [email protected]:open-feature/flagd-testbed.git
[submodule "providers/openfeature-provider-flagd/spec"]
path = providers/openfeature-provider-flagd/spec
path = providers/openfeature-provider-flagd/openfeature/spec
url = https://github.com/open-feature/spec
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ To install Hatch, just run `pip install hatch`.

You will also need to setup the `pre-commit` hooks. Run `pre-commit install` in the root directory of the repository. If you don't have `pre-commit` installed, you can install it with `pip install pre-commit`.

> **Note**
> Currently our protobuf files will be generated during `hatch build`
> Please run this command once, to generate all necessary files.
### Testing

Run tests by entering the package directory and running `hatch run test`.
Run tests by entering the package directory and running `hatch test`.

We use `pytest` for our unit testing, making use of `parametrized` to inject cases at scale.

Expand Down
1 change: 1 addition & 0 deletions providers/openfeature-provider-flagd/openfeature/schemas
Submodule schemas added at 76d611
35 changes: 28 additions & 7 deletions providers/openfeature-provider-flagd/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Homepage = "https://github.com/open-feature/python-sdk-contrib"

[tool.hatch]

[tool.hatch.envs.default]
[tool.hatch.envs.hatch-test]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -41,26 +41,47 @@ dependencies = [
"asserts",
"grpcio-health-checking==1.60.0",
]
post-install-commands = [
"./scripts/gen_protos.sh"
pre-install-commands = [
"hatch build",
]

[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
[tool.hatch.envs.hatch-test.scripts]
run = "pytest {args:tests}"
run-cov = "coverage run -m pytest {args:tests}"
cov-combine = "coverage combine"
cov-report = [
"coverage xml",
"coverage html",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]

[tool.hatch.build.hooks.protobuf]
generate_pyi = false
dependencies = [
"hatch-protobuf",
"mypy-protobuf~=3.0",
]
proto_paths = [
".",
]
output_path = "src/"

[[tool.hatch.build.hooks.protobuf.generators]]
name = "mypy"
outputs = ["{proto_path}/{proto_name}_pb2.pyi"]

[[tool.hatch.build.hooks.protobuf.generators]]
name = "mypy_grpc"
outputs = ["{proto_path}/{proto_name}_pb2_grpc.pyi"]

[tool.hatch.build.targets.sdist]
exclude = [
".gitignore",
"schemas",
"/openfeature",
]

[tool.hatch.build.targets.wheel]
Expand Down
1 change: 0 additions & 1 deletion providers/openfeature-provider-flagd/schemas
Submodule schemas deleted from d897c2
10 changes: 0 additions & 10 deletions providers/openfeature-provider-flagd/scripts/gen_protos.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

schemas

This file was deleted.

Loading
Loading