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
22 changes: 12 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,23 @@ jobs:
fi
fi

if [[ "${{ github.event_name }}" != "pull_request" ]]; then
RESULT=1
echo "$CHANGED_FILES" | grep -q -E '^(src/hyperscan/|README.md|CMakeLists.txt|pyproject.toml|MANIFEST.in|cmake/|build_tools/)' || RESULT=$?
RESULT=1
echo "$CHANGED_FILES" | grep -q -E '^(src/hyperscan/|README.md|CMakeLists.txt|pyproject.toml|MANIFEST.in|cmake/|build_tools/)' || RESULT=$?

if [[ "$RESULT" -eq 0 ]]; then
echo "should_build=true" >> "$GITHUB_OUTPUT"
if [[ "$RESULT" -eq 0 ]]; then
echo "should_build=true" >> "$GITHUB_OUTPUT"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Running build because PR touches relevant files"
else
echo "Running build because relevant files were changed"
fi
else
echo "should_build=false" >> "$GITHUB_OUTPUT"
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Skipping build because PR does not change build-relevant files and lacks [build] tag"
else
echo "should_build=false" >> "$GITHUB_OUTPUT"
echo "Skipping build because no relevant files were changed and commit doesn't have [build] tag"
fi
else
# For pull requests, always build (after checking for [build] tag above)
echo "should_build=true" >> "$GITHUB_OUTPUT"
echo "Running build for pull request"
fi

sdist:
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $ cd vectorscan
$ # PCRE1 (8.xx series) is required for Chimera support
$ wget -qO- https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz/download | tar xvz
$ git checkout v5.4.0
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DBUILD_STATIC_AND_SHARED=ON \
-DFAT_RUNTIME=ON \
Expand Down
15 changes: 9 additions & 6 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ print(db.info().decode())

## Match Event Handling

Match handler callbacks will be invoked with exactly the same parameters
as their analog from the Hyperscan C API:
Match handler callbacks will be invoked with parameters mirroring the
Hyperscan C API.

The match offset argument is exposed as ``from_`` in Python to avoid the
reserved keyword ``from``:

```python
# Type annotated Hyperscan match handler signature
def on_match(
id: int,
from: int,
to: int,
def on_match(
id: int,
from_: int,
to: int,
flags: int,
context: Optional[Any] = None
) -> Optional[bool]:
Expand Down
Loading