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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ To define a custom extension in C++, define a class extending
`cel_python::CelExtension`. There are two methods you will need to implement:
`ConfigureCompiler` and `ConfigureRuntime`. The implementations of these methods
use the same API as extensions written for the C++ CEL runtime. In fact,
extensions written for the C++ runtime can be used unchanged with PyCEL - you
would just need to write a trivial wrapper class invoking the registration
functions defined by the C++ extension.
extensions written for the C++ runtime can be used unchanged with
cel-expr-python - you would just need to write a trivial wrapper class invoking
the registration functions defined by the C++ extension.

```cpp
absl::Status ConfigureCompiler(
Expand Down
6 changes: 3 additions & 3 deletions codelab/index.lab.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cel.expr.python (CEL for Python) Codelab: Fast, safe, embedded expressions
# cel-expr-python (CEL for Python) Codelab: Fast, safe, embedded expressions

<details>
<summary>
Expand All @@ -24,7 +24,7 @@ lambda expressions. While CEL is commonly used for boolean decisions,
it can also be used to construct more complex objects like JSON or
protobuf messages.

### cel.expr.python - CEL runtime for Python
### cel-expr-python - CEL runtime for Python
Cel.expr.python is a collection of Python APIs for compilation, validation and
evaluation of CEL expressions. It also includes support for CEL extensions,
written either in Python or C++.
Expand Down Expand Up @@ -143,7 +143,7 @@ function bindings being used across the lifetime of a process (a common case).

</summary>

Before we can start using cel.expr.python, let's install it in the Python environment:
Before we can start using cel-expr-python, let's install it in the Python environment:
```
pip install cel-expr-python
```
Expand Down
2 changes: 1 addition & 1 deletion release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To build the py_cel wheel locally for testing:
Go to the parent directory of the one containing this file, e.g.

```
cd py-cel-git-repo
cd cel-git-repo
```

- Update release version
Expand Down
18 changes: 6 additions & 12 deletions release/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
#!/bin/bash
set -e

# Version of pycel to build.
# Version of cel-expr-python to build.
# IMPORTANT: Update this to the latest version before building.
VERSION="0.0.1"


# Find the installation directory of cibuildwheel
CIBWHEEL_DIR=$(pip show cibuildwheel | grep Location: | awk '{print $2}')
# Derive the cibuildwheel binary path from the site-packages directory.
# Example: "/.../lib/python3.11/site-packages" -> "/.../bin/cibuildwheel"
CIBWHEEL_BIN=$(echo "${CIBWHEEL_DIR}" | sed 's/\/lib\/python[0-9.]*\/site-packages/\/bin/')/cibuildwheel

SRC_DIR=$(pwd)
echo "PyCEL source directory: ${SRC_DIR}"
echo "cel-expr-python source directory: ${SRC_DIR}"

TMP_DIR=$(mktemp -d)
echo "Build directory: ${TMP_DIR}"
Expand All @@ -22,16 +15,17 @@ pushd "${TMP_DIR}"

cp -r "${SRC_DIR}"/{*,.*} .
cp "${SRC_DIR}"/release/* .
rm -rf cel_expr_python/*_test.py

# Substitute $VERSION in pyproject.toml with the value of VRS.
# Substitute $VERSION in pyproject.toml with the value of VERSION.
sed -i "s/\$VERSION/${VERSION}/g" pyproject.toml

echo "Running cibuildwheel: ${CIBWHEEL_BIN}"
"${CIBWHEEL_BIN}" "$@"
python -m cibuildwheel "$@"

echo "Copying generated wheels to ${SRC_DIR}/wheelhouse"
mkdir -p "${SRC_DIR}"/wheelhouse
cp wheelhouse/cel-expr-python-*.whl "${SRC_DIR}"/wheelhouse/
cp wheelhouse/cel_expr_python-*.whl "${SRC_DIR}"/wheelhouse/

echo "Cleaning up build directory: ${TMP_DIR}"
rm -rf "${TMP_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion release/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ license = "Apache-2.0"

[tool.setuptools.packages.find]
where = ["."]
exclude = ["wheelhouse*", "conformance*", "custom_ext*"]
exclude = ["codelab*", "conformance*", "custom_ext*", "release*", "testing*", "wheelhouse*"]

[tool.cibuildwheel]
build = "cp311-* cp312-* cp313-*"
Expand Down
37 changes: 29 additions & 8 deletions release/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,36 @@ def build_extension(self, ext):


setuptools.setup(
name='py-cel',
name='cel-expr-python',
ext_modules=[
BazelExtension('py_cel.py_cel', '//py_cel:py_cel'),
BazelExtension('py_cel.ext.ext_bindings', '//py_cel/ext:ext_bindings'),
BazelExtension('py_cel.ext.ext_encoders', '//py_cel/ext:ext_encoders'),
BazelExtension('py_cel.ext.ext_math', '//py_cel/ext:ext_math'),
BazelExtension('py_cel.ext.ext_optional', '//py_cel/ext:ext_optional'),
BazelExtension('py_cel.ext.ext_proto', '//py_cel/ext:ext_proto'),
BazelExtension('py_cel.ext.ext_string', '//py_cel/ext:ext_string'),
BazelExtension(
'cel_expr_python.cel',
'//cel_expr_python:cel',
),
BazelExtension(
'cel_expr_python.ext.ext_bindings',
'//cel_expr_python/ext:ext_bindings',
),
BazelExtension(
'cel_expr_python.ext.ext_encoders',
'//cel_expr_python/ext:ext_encoders',
),
BazelExtension(
'cel_expr_python.ext.ext_math',
'//cel_expr_python/ext:ext_math',
),
BazelExtension(
'cel_expr_python.ext.ext_optional',
'//cel_expr_python/ext:ext_optional',
),
BazelExtension(
'cel_expr_python.ext.ext_proto',
'//cel_expr_python/ext:ext_proto',
),
BazelExtension(
'cel_expr_python.ext.ext_string',
'//cel_expr_python/ext:ext_string',
),
],
cmdclass={'build_ext': BazelBuild},
zip_safe=False,
Expand Down