Skip to content

Commit

Permalink
Add hook for cel-python (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
o-murphy authored Jan 15, 2024
1 parent 62cf4a9 commit 4aa3285
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/687.new.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add hook for ``cel-python``.
1 change: 1 addition & 0 deletions requirements-test-libraries.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ freetype-py==2.4.0
vaderSentiment==3.3.2
langchain==0.1.0
seedir==0.4.2
cel-python==0.1.5

# ------------------- Platform (OS) specifics

Expand Down
24 changes: 24 additions & 0 deletions src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-celpy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ------------------------------------------------------------------
# Copyright (c) 2024 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ------------------------------------------------------------------
#
# cel-python is Pure Python implementation of Google Common Expression Language,
# https://opensource.google/projects/cel
# This implementation has minimal dependencies, runs quickly, and can be embedded into Python-based applications.
# Specifically, the intent is to be part of Cloud Custodian, C7N, as part of the security policy filter.
# https://github.com/cloud-custodian/cel-python
#
# Tested with cel-python 0.1.5

from PyInstaller.utils.hooks import collect_data_files

# Collect *.lark file(s) from the package
datas = collect_data_files('celpy')
7 changes: 7 additions & 0 deletions src/_pyinstaller_hooks_contrib/tests/test_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1874,3 +1874,10 @@ def test_PyTaskbar(pyi_builder):
pyi_builder.test_source("""
import PyTaskbar
""")


@importorskip('celpy')
def test_celpy(pyi_builder):
pyi_builder.test_source("""
import celpy
""")

0 comments on commit 4aa3285

Please sign in to comment.