Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a Python wrapper for the CEL C++ implementation.
### Importing CEL module

```python
import py_cel
from py_cel import py_cel
```

### Creating and configuring Cel
Expand Down
14 changes: 7 additions & 7 deletions conformance/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ py_test(
deps = [
"@com_google_cel_spec//proto/cel/expr:checked_py_pb2",
"@com_google_cel_spec//proto/cel/expr:value_py_pb2",
"//:py_cel",
"//ext:ext_bindings",
"//ext:ext_encoders",
"//ext:ext_math",
"//ext:ext_optional",
"//ext:ext_proto",
"//ext:ext_string",
"//py_cel",
"//py_cel/ext:ext_bindings",
"//py_cel/ext:ext_encoders",
"//py_cel/ext:ext_math",
"//py_cel/ext:ext_optional",
"//py_cel/ext:ext_proto",
"//py_cel/ext:ext_string",
"@com_google_absl_py//absl/testing:absltest",
"//testing:proto2_test_all_types_py_pb2",
"//testing:proto3_test_all_types_py_pb2",
Expand Down
23 changes: 15 additions & 8 deletions conformance/conformance_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
from cel.expr import value_pb2 as value_pb
from absl.testing import absltest
from python.runfiles import runfiles
import py_cel as cel
from ext import ext_bindings
from ext import ext_encoders
from ext import ext_math
from ext import ext_optional
from ext import ext_proto
from ext import ext_string
from py_cel import py_cel as cel
from py_cel.ext import ext_bindings
from py_cel.ext import ext_encoders
from py_cel.ext import ext_math
from py_cel.ext import ext_optional
from py_cel.ext import ext_proto
from py_cel.ext import ext_string
from cel.expr.conformance.proto2 import test_all_types_extensions_pb2 as test_all_types_extensions_proto2 # pylint: disable=unused-import
from cel.expr.conformance.proto2 import test_all_types_pb2 as test_all_types_proto2 # pylint: disable=unused-import
from cel.expr.conformance.proto3 import test_all_types_pb2 as test_all_types_proto3 # pylint: disable=unused-import
Expand Down Expand Up @@ -65,6 +65,13 @@ class ConformanceTestSuite(unittest.TestSuite):
"parse/bytes_literals/triple_single_quoted_unescaped_punctuation",
"parse/string_literals/triple_double_quoted_unescaped_punctuation",
"parse/string_literals/triple_single_quoted_unescaped_punctuation",
# TODO(b/481818110): fix support for optional types.
"optionals/optionals/empty_struct_optindex_hasValue",
"optionals/optionals/optional_empty_struct_optindex_hasValue",
"optionals/optionals/optional_struct_optindex_index_value",
"optionals/optionals/optional_struct_optindex_index_value",
"optionals/optionals/optional_struct_optindex_value",
"optionals/optionals/struct_optindex_value",
]

def __init__(self):
Expand All @@ -89,7 +96,7 @@ def _load_tests(self):
them to the test suite.
"""
testfiles = self._all_test_files(
"google3/third_party/cel/spec/tests/simple/testdata"
"cel-spec+/tests/simple/testdata"
)

for testfile in testfiles:
Expand Down
12 changes: 6 additions & 6 deletions custom_ext/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ pybind_extension(
name = "sample_cel_ext_cc",
srcs = ["sample_cel_ext.cc"],
data = [
"//:py_cel",
"//py_cel",
],
deps = [
"//:py_cel",
"//:py_cel_extension",
"//:status_macros",
"//py_cel",
"//py_cel:py_cel_extension",
"//py_cel:status_macros",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand All @@ -33,7 +33,7 @@ py_library(
name = "sample_cel_ext_py",
srcs = ["sample_cel_ext.py"],
deps = [
"//:py_cel",
"//py_cel",
],
)

Expand All @@ -43,7 +43,7 @@ py_test(
deps = [
":sample_cel_ext_cc",
":sample_cel_ext_py",
"//:py_cel",
"//py_cel",
"@com_google_absl_py//absl/testing:absltest",
"@com_google_absl_py//absl/testing:parameterized",
"@com_google_protobuf//:protobuf_python",
Expand Down
2 changes: 1 addition & 1 deletion custom_ext/custom_ext_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from absl.testing import absltest
from absl.testing import parameterized
import py_cel as cel
from py_cel import py_cel as cel
from custom_ext import sample_cel_ext
from custom_ext import sample_cel_ext_cc

Expand Down
4 changes: 2 additions & 2 deletions custom_ext/sample_cel_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include "runtime/function_adapter.h"
#include "runtime/runtime_builder.h"
#include "runtime/runtime_options.h"
#include "py_cel_extension.h"
#include "status_macros.h"
#include "py_cel/py_cel_extension.h"
#include "py_cel/status_macros.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/message.h"
Expand Down
2 changes: 1 addition & 1 deletion custom_ext/sample_cel_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from typing import Any

import py_cel as cel
from py_cel import py_cel as cel


class SampleCelExtension(cel.CelExtension):
Expand Down
File renamed without changes.
26 changes: 13 additions & 13 deletions ext/BUILD → py_cel/ext/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ pybind_extension(
"ext_bindings.cc",
],
data = [
"//:py_cel",
"//py_cel",
],
visibility = ["//visibility:public"],
deps = [
"//:py_cel_extension",
"//py_cel:py_cel_extension",
"@com_google_absl//absl/status",
"@com_google_cel_cpp//compiler",
"@com_google_cel_cpp//extensions:bindings_ext",
Expand All @@ -26,11 +26,11 @@ pybind_extension(
"ext_encoders.cc",
],
data = [
"//:py_cel",
"//py_cel",
],
visibility = ["//visibility:public"],
deps = [
"//:py_cel_extension",
"//py_cel:py_cel_extension",
"@com_google_absl//absl/status",
"@com_google_cel_cpp//checker:type_checker_builder",
"@com_google_cel_cpp//compiler",
Expand All @@ -47,12 +47,12 @@ pybind_extension(
"ext_math.cc",
],
data = [
"//:py_cel",
"//py_cel",
],
visibility = ["//visibility:public"],
deps = [
"//:py_cel_extension",
"//:status_macros",
"//py_cel:py_cel_extension",
"//py_cel:status_macros",
"@com_google_absl//absl/base:nullability",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
Expand Down Expand Up @@ -80,11 +80,11 @@ pybind_extension(
"ext_optional.cc",
],
data = [
"//:py_cel",
"//py_cel",
],
visibility = ["//visibility:public"],
deps = [
"//:py_cel_extension",
"//py_cel:py_cel_extension",
"@com_google_absl//absl/status",
"@com_google_cel_cpp//compiler",
"@com_google_cel_cpp//compiler:optional",
Expand All @@ -101,11 +101,11 @@ pybind_extension(
"ext_proto.cc",
],
data = [
"//:py_cel",
"//py_cel",
],
visibility = ["//visibility:public"],
deps = [
"//:py_cel_extension",
"//py_cel:py_cel_extension",
"@com_google_absl//absl/status",
"@com_google_cel_cpp//compiler",
"@com_google_cel_cpp//extensions:proto_ext",
Expand All @@ -119,11 +119,11 @@ pybind_extension(
"ext_string.cc",
],
data = [
"//:py_cel",
"//py_cel",
],
visibility = ["//visibility:public"],
deps = [
"//:py_cel_extension",
"//py_cel:py_cel_extension",
"@com_google_absl//absl/status",
"@com_google_cel_cpp//compiler",
"@com_google_cel_cpp//extensions:strings",
Expand Down
2 changes: 1 addition & 1 deletion ext/ext_bindings.cc → py_cel/ext/ext_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "absl/status/status.h"
#include "compiler/compiler.h"
#include "extensions/bindings_ext.h"
#include "py_cel_extension.h"
#include "py_cel/py_cel_extension.h"
#include "google/protobuf/descriptor.h"

namespace cel_python {
Expand Down
2 changes: 1 addition & 1 deletion ext/ext_encoders.cc → py_cel/ext/ext_encoders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "extensions/encoders.h"
#include "runtime/runtime_builder.h"
#include "runtime/runtime_options.h"
#include "py_cel_extension.h"
#include "py_cel/py_cel_extension.h"
#include "google/protobuf/descriptor.h"

namespace cel_python {
Expand Down
4 changes: 2 additions & 2 deletions ext/ext_math.cc → py_cel/ext/ext_math.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "extensions/math_ext_decls.h"
#include "runtime/runtime_builder.h"
#include "runtime/runtime_options.h"
#include "py_cel_extension.h"
#include "status_macros.h"
#include "py_cel/py_cel_extension.h"
#include "py_cel/status_macros.h"
#include "google/protobuf/descriptor.h"

namespace cel_python {
Expand Down
2 changes: 1 addition & 1 deletion ext/ext_optional.cc → py_cel/ext/ext_optional.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "runtime/optional_types.h"
#include "runtime/runtime_builder.h"
#include "runtime/runtime_options.h"
#include "py_cel_extension.h"
#include "py_cel/py_cel_extension.h"
#include "google/protobuf/descriptor.h"

namespace cel_python {
Expand Down
2 changes: 1 addition & 1 deletion ext/ext_proto.cc → py_cel/ext/ext_proto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "absl/status/status.h"
#include "compiler/compiler.h"
#include "extensions/proto_ext.h"
#include "py_cel_extension.h"
#include "py_cel/py_cel_extension.h"
#include "google/protobuf/descriptor.h"

namespace cel_python {
Expand Down
2 changes: 1 addition & 1 deletion ext/ext_string.cc → py_cel/ext/ext_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "extensions/strings.h"
#include "runtime/runtime_builder.h"
#include "runtime/runtime_options.h"
#include "py_cel_extension.h"
#include "py_cel/py_cel_extension.h"
#include "google/protobuf/descriptor.h"

namespace cel_python {
Expand Down
10 changes: 5 additions & 5 deletions py_cel_activation.cc → py_cel/py_cel_activation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "py_cel_activation.h"
#include "py_cel/py_cel_activation.h"

#include <Python.h> // IWYU pragma: keep - Needed for PyObject

Expand All @@ -26,10 +26,10 @@
#include "absl/strings/string_view.h"
#include "common/function_descriptor.h"
#include "common/kind.h"
#include "py_cel_arena.h"
#include "py_cel_env_internal.h"
#include "py_cel_function.h"
#include "py_cel_value_provider.h"
#include "py_cel/py_cel_arena.h"
#include "py_cel/py_cel_env_internal.h"
#include "py_cel/py_cel_function.h"
#include "py_cel/py_cel_value_provider.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/message.h"
Expand Down
2 changes: 1 addition & 1 deletion py_cel_activation.h → py_cel/py_cel_activation.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <vector>

#include "runtime/activation.h"
#include "py_cel_arena.h"
#include "py_cel/py_cel_arena.h"
#include <pybind11/pybind11.h>

namespace cel_python {
Expand Down
2 changes: 1 addition & 1 deletion py_cel_arena.cc → py_cel/py_cel_arena.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "py_cel_arena.h"
#include "py_cel/py_cel_arena.h"

#include <Python.h> // IWYU pragma: keep - Needed for PyObject

Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions py_cel_env.cc → py_cel/py_cel_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "py_cel_env.h"
#include "py_cel/py_cel_env.h"

#include <Python.h> // IWYU pragma: keep - Needed for PyObject

Expand All @@ -25,12 +25,12 @@
#include <vector>

#include "absl/log/absl_check.h"
#include "py_cel_activation.h"
#include "py_cel_arena.h"
#include "py_cel_env_internal.h"
#include "py_cel_expression.h"
#include "py_cel_type.h"
#include "py_error_status.h"
#include "py_cel/py_cel_activation.h"
#include "py_cel/py_cel_arena.h"
#include "py_cel/py_cel_env_internal.h"
#include "py_cel/py_cel_expression.h"
#include "py_cel/py_cel_type.h"
#include "py_cel/py_error_status.h"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

Expand Down
10 changes: 5 additions & 5 deletions py_cel_env.h → py_cel/py_cel_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#include <unordered_map>
#include <vector>

#include "py_cel_activation.h"
#include "py_cel_arena.h"
#include "py_cel_expression.h"
#include "py_cel_function.h"
#include "py_cel_type.h"
#include "py_cel/py_cel_activation.h"
#include "py_cel/py_cel_arena.h"
#include "py_cel/py_cel_expression.h"
#include "py_cel/py_cel_function.h"
#include "py_cel/py_cel_type.h"
#include <pybind11/pybind11.h>

namespace cel {
Expand Down
14 changes: 7 additions & 7 deletions py_cel_env_internal.cc → py_cel/py_cel_env_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "py_cel_env_internal.h"
#include "py_cel/py_cel_env_internal.h"

#include <memory>
#include <string>
Expand All @@ -35,12 +35,12 @@
#include "runtime/runtime_builder.h"
#include "runtime/runtime_options.h"
#include "runtime/standard_runtime_builder_factory.h"
#include "py_cel_extension.h"
#include "py_cel_python_extension.h"
#include "py_cel_type.h"
#include "py_descriptor_database.h"
#include "py_message_factory.h"
#include "status_macros.h"
#include "py_cel/py_cel_extension.h"
#include "py_cel/py_cel_python_extension.h"
#include "py_cel/py_cel_type.h"
#include "py_cel/py_descriptor_database.h"
#include "py_cel/py_message_factory.h"
#include "py_cel/status_macros.h"
#include "google/protobuf/arena.h"
#include "google/protobuf/descriptor.h"
#include <pybind11/pybind11.h>
Expand Down
Loading