Skip to content

Commit 4a5f026

Browse files
dmitriplotnikovcopybara-github
authored andcommitted
Rename py_cel to cel_expr_python. Part II
PiperOrigin-RevId: 869231554
1 parent 543649b commit 4a5f026

6 files changed

Lines changed: 43 additions & 28 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ To define a custom extension in C++, define a class extending
236236
`cel_python::CelExtension`. There are two methods you will need to implement:
237237
`ConfigureCompiler` and `ConfigureRuntime`. The implementations of these methods
238238
use the same API as extensions written for the C++ CEL runtime. In fact,
239-
extensions written for the C++ runtime can be used unchanged with PyCEL - you
240-
would just need to write a trivial wrapper class invoking the registration
241-
functions defined by the C++ extension.
239+
extensions written for the C++ runtime can be used unchanged with
240+
cel-expr-python - you would just need to write a trivial wrapper class invoking
241+
the registration functions defined by the C++ extension.
242242

243243
```cpp
244244
absl::Status ConfigureCompiler(

codelab/index.lab.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cel.expr.python (CEL for Python) Codelab: Fast, safe, embedded expressions
1+
# cel-expr-python (CEL for Python) Codelab: Fast, safe, embedded expressions
22

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

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

144144
</summary>
145145

146-
Before we can start using cel.expr.python, let's install it in the Python environment:
146+
Before we can start using cel-expr-python, let's install it in the Python environment:
147147
```
148148
pip install cel-expr-python
149149
```

release/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To build the py_cel wheel locally for testing:
1919
Go to the parent directory of the one containing this file, e.g.
2020

2121
```
22-
cd py-cel-git-repo
22+
cd cel-git-repo
2323
```
2424

2525
- Update release version

release/build_wheel.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
#!/bin/bash
22
set -e
33

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

8-
9-
# Find the installation directory of cibuildwheel
10-
CIBWHEEL_DIR=$(pip show cibuildwheel | grep Location: | awk '{print $2}')
11-
# Derive the cibuildwheel binary path from the site-packages directory.
12-
# Example: "/.../lib/python3.11/site-packages" -> "/.../bin/cibuildwheel"
13-
CIBWHEEL_BIN=$(echo "${CIBWHEEL_DIR}" | sed 's/\/lib\/python[0-9.]*\/site-packages/\/bin/')/cibuildwheel
14-
158
SRC_DIR=$(pwd)
16-
echo "PyCEL source directory: ${SRC_DIR}"
9+
echo "cel-expr-python source directory: ${SRC_DIR}"
1710

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

2316
cp -r "${SRC_DIR}"/{*,.*} .
2417
cp "${SRC_DIR}"/release/* .
18+
rm -rf cel_expr_python/*_test.py
2519

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

2923
echo "Running cibuildwheel: ${CIBWHEEL_BIN}"
30-
"${CIBWHEEL_BIN}" "$@"
24+
python -m cibuildwheel "$@"
3125

3226
echo "Copying generated wheels to ${SRC_DIR}/wheelhouse"
3327
mkdir -p "${SRC_DIR}"/wheelhouse
34-
cp wheelhouse/cel-expr-python-*.whl "${SRC_DIR}"/wheelhouse/
28+
cp wheelhouse/cel_expr_python-*.whl "${SRC_DIR}"/wheelhouse/
3529

3630
echo "Cleaning up build directory: ${TMP_DIR}"
3731
rm -rf "${TMP_DIR}"

release/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ license = "Apache-2.0"
2626

2727
[tool.setuptools.packages.find]
2828
where = ["."]
29-
exclude = ["wheelhouse*", "conformance*", "custom_ext*"]
29+
exclude = ["codelab*", "conformance*", "custom_ext*", "release*", "testing*", "wheelhouse*"]
3030

3131
[tool.cibuildwheel]
3232
build = "cp311-* cp312-* cp313-*"

release/setup.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,36 @@ def build_extension(self, ext):
107107

108108

109109
setuptools.setup(
110-
name='py-cel',
110+
name='cel-expr-python',
111111
ext_modules=[
112-
BazelExtension('py_cel.py_cel', '//py_cel:py_cel'),
113-
BazelExtension('py_cel.ext.ext_bindings', '//py_cel/ext:ext_bindings'),
114-
BazelExtension('py_cel.ext.ext_encoders', '//py_cel/ext:ext_encoders'),
115-
BazelExtension('py_cel.ext.ext_math', '//py_cel/ext:ext_math'),
116-
BazelExtension('py_cel.ext.ext_optional', '//py_cel/ext:ext_optional'),
117-
BazelExtension('py_cel.ext.ext_proto', '//py_cel/ext:ext_proto'),
118-
BazelExtension('py_cel.ext.ext_string', '//py_cel/ext:ext_string'),
112+
BazelExtension(
113+
'cel_expr_python.cel',
114+
'//cel_expr_python:cel',
115+
),
116+
BazelExtension(
117+
'cel_expr_python.ext.ext_bindings',
118+
'//cel_expr_python/ext:ext_bindings',
119+
),
120+
BazelExtension(
121+
'cel_expr_python.ext.ext_encoders',
122+
'//cel_expr_python/ext:ext_encoders',
123+
),
124+
BazelExtension(
125+
'cel_expr_python.ext.ext_math',
126+
'//cel_expr_python/ext:ext_math',
127+
),
128+
BazelExtension(
129+
'cel_expr_python.ext.ext_optional',
130+
'//cel_expr_python/ext:ext_optional',
131+
),
132+
BazelExtension(
133+
'cel_expr_python.ext.ext_proto',
134+
'//cel_expr_python/ext:ext_proto',
135+
),
136+
BazelExtension(
137+
'cel_expr_python.ext.ext_string',
138+
'//cel_expr_python/ext:ext_string',
139+
),
119140
],
120141
cmdclass={'build_ext': BazelBuild},
121142
zip_safe=False,

0 commit comments

Comments
 (0)