Skip to content

Commit 7d8a09c

Browse files
authored
[chore] Drop py27 support and update lark dependency from lark-parser to lark>=1.3.1 (#82)
This is a breaking change. Bumping to `1.0.0` to reflect `py2.7` dropped support.
1 parent 49d8d64 commit 7d8a09c

File tree

18 files changed

+174
-152
lines changed

18 files changed

+174
-152
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Build 3.X
4+
name: Build and Test
55

66
on:
77
push:
@@ -15,19 +15,20 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [3.7]
18+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
1919
fail-fast: false
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v5
2323
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
python -m pip install wheel
30+
python -m pip install wheel setuptools
31+
python -m pip install -e ".[lint,test]"
3132
- name: Lint with flake8
3233
run: |
3334
python setup.py -q lint

.github/workflows/pythonpackage27.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# Event Query Language - Changelog
22
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

4+
# Version 1.0.0
5+
6+
_Released 2025-11-17_
7+
8+
### Changed
9+
10+
* Updated `lark-parser` dependency to `lark>=1.3.1` (migrated from deprecated `lark-parser` package to `lark`)
11+
* Updated GitHub Actions workflows to use Python 3.8+ and newer action versions (`actions/checkout@v5`, `actions/setup-python@v5`)
12+
* Fixed compatibility issues with Lark 1.3.1:
13+
* Fixed parsing of macros with empty parameter lists (e.g., `macro TRUE()`)
14+
* Fixed parsing of pipes with no arguments (e.g., `| count`)
15+
* Fixed `Schema.current()` to always return a valid Schema object
16+
* Simplified dependencies by removing Python 2.7 and Python < 3.8 compatibility code
17+
* Removed Python 2.7 compatibility comments and code from source files
18+
* Updated documentation to reflect Python 3.8+ requirement
19+
20+
### Removed
21+
22+
* **BREAKING**: Dropped support for Python 2.7 and Python < 3.8. The minimum required Python version is now 3.8.
23+
* Removed Python 2.7 GitHub Actions workflow (`.github/workflows/pythonpackage27.yml`)
24+
425
# Version 0.9.19
526

627
_Released 2023-10-31_

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ Contributing to EQL is a simple five-step process facilitated by Git:
3030
* There is plenty of literature and resources out there to help you. A great place to start is [GitHub guides](https://guides.github.com/).
3131

3232
## Ways to contribute
33-
33+
3434
### Bug Fixes
35-
Bug fixes are a natural area to contribute. We only ask that you please use the [bug report issue](https://github.com/endgameinc/eql/issues) to track the bug. Please elaborate on how to reproduce the bug and what behavior you would have expected. Compatibility is a priority for EQL, so be sure to capture information about your operating system and version of python.
35+
Bug fixes are a natural area to contribute. We only ask that you please use the [bug report issue](https://github.com/endgameinc/eql/issues) to track the bug. Please elaborate on how to reproduce the bug and what behavior you would have expected. Compatibility is a priority for EQL, so be sure to capture information about your operating system and version of python.
3636

3737
### Language or Engine Changes
3838
For any changes within the language or the evaluation engine, propose your changes in a *Feature Request* issue to start a discussion. For new functionality function, be mindful of handling different edge cases, acceptable input, etc. We are happy to collaborate on such topics and encourage you to share ideas.
@@ -49,7 +49,7 @@ Anyone is encouraged to make a PR for open issues that have a clear path forward
4949
* Include end-to-end tests by updating the test [data](eql/etc/test_data.json) and [queries](eql/etc/test_queries.toml). These are used as the gold standard of expected behavior, and the queries should have a list of the serial_event_id of the events, in the expected order.
5050

5151
### CLI
52-
Finally, the CLI is an area we are always looking to expand. This may include new input file types, new processing features, new tables, etc. Some shell functionality, like tab completions ANSI coloring, and history often varies across different operating systems. If possible, please test new functionality across a few different operating systems if you have access, and Python 2.7 and 3.6+. If you find any unusual behavior in the shell related to compatibility, please let us know in an issue.
52+
Finally, the CLI is an area we are always looking to expand. This may include new input file types, new processing features, new tables, etc. Some shell functionality, like tab completions ANSI coloring, and history often varies across different operating systems. If possible, please test new functionality across a few different operating systems if you have access, and Python 3.8+. If you find any unusual behavior in the shell related to compatibility, please let us know in an issue.
5353

5454
## Resources
5555
See the [resources page](https://eql.readthedocs.io/en/latest/resources.html) on ReadTheDocs for a full list of resources

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Since Endgame [joined forced with Elastic](https://www.elastic.co/blog/endgame-j
1313

1414
# Getting Started
1515

16-
The EQL module current supports Python 2.7 and 3.5+. Assuming a supported Python version is installed, run the command:
16+
The EQL module requires Python 3.8 or higher. Assuming a supported Python version is installed, run the command:
1717

1818
```console
1919
$ pip install eql
@@ -23,7 +23,7 @@ If Python is configured and already in the PATH, then ``eql`` will be readily av
2323

2424
```console
2525
$ eql --version
26-
eql 0.9
26+
eql 0.9.20
2727
```
2828

2929
From there, try a [sample json file](docs/_static/example.json) and test it with EQL.

docs/_static/eql-crash-course.slides.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9181,15 +9181,15 @@
91819181
}
91829182
/* Flexible box model classes */
91839183
/* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */
9184-
/* This file is a compatability layer. It allows the usage of flexible box
9184+
/* This file is a compatability layer. It allows the usage of flexible box
91859185
model layouts accross multiple browsers, including older browsers. The newest,
91869186
universal implementation of the flexible box model is used when available (see
9187-
`Modern browsers` comments below). Browsers that are known to implement this
9187+
`Modern browsers` comments below). Browsers that are known to implement this
91889188
new spec completely include:
91899189
91909190
Firefox 28.0+
91919191
Chrome 29.0+
9192-
Internet Explorer 11+
9192+
Internet Explorer 11+
91939193
Opera 17.0+
91949194
91959195
Browsers not listed, including Safari, are supported via the styling under the
@@ -12571,7 +12571,7 @@
1257112571
background: #f7f7f7;
1257212572
border-top: 1px solid #cfcfcf;
1257312573
border-bottom: 1px solid #cfcfcf;
12574-
/* This injects handle bars (a short, wide = symbol) for
12574+
/* This injects handle bars (a short, wide = symbol) for
1257512575
the resize handle. */
1257612576
}
1257712577
div#pager .ui-resizable-handle::after {
@@ -13070,7 +13070,7 @@
1307013070
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
1307113071
</style>
1307213072
<style type="text/css">
13073-
13073+
1307413074
/* Temporary definitions which will become obsolete with Notebook release 5.0 */
1307513075
.ansi-black-fg { color: #3E424D; }
1307613076
.ansi-black-bg { background-color: #3E424D; }
@@ -13253,7 +13253,7 @@ <h1 id="Event-Query-Language">Event Query Language<a class="anchor-link" href="#
1325313253
</div><div class="inner_cell">
1325413254
<div class="text_cell_render border-box-sizing rendered_html">
1325513255
<h2 id="Getting-Started">Getting Started<a class="anchor-link" href="#Getting-Started">&#182;</a></h2><p><a href="https://eql.readthedocs.io/en/latest/index.html#getting-started">https://eql.readthedocs.io/en/latest/index.html#getting-started</a></p>
13256-
<p>Requires Python (confirmed with 2.7 and 3.5+)</p>
13256+
<p>Requires Python 3.8+</p>
1325713257
<div class="highlight"><pre><span></span><span class="gp">$</span> pip install eql
1325813258

1325913259
<span class="go">Collecting eql</span>

docs/cli.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ the console. First install Python and then use ``pip`` to install EQL.
1313
$ pip install eql
1414
1515
16-
For the optimal shell experience, use Python 3.6+ and install the optional dependencies for EQL:
16+
For the optimal shell experience, use Python 3.8+ and install the optional dependencies for EQL:
1717

1818
.. code-block:: console
1919
@@ -27,12 +27,6 @@ Type ``help`` within the shell to get a list of commands and ``exit`` when finis
2727
.. |asciicast| image:: https://asciinema.org/a/259453.svg
2828
:target: https://asciinema.org/a/259453
2929

30-
.. note::
31-
32-
In Python 2.7, the argument parsing is a little different. Instead of running ``eql`` directly
33-
to invoke the interactive shell, run ``eql shell``.
34-
35-
3630
In addition, the ``query`` command within EQL will stream over `JSON`_, and
3731
output as matches are found. An input file can be provided with ``-f`` in JSON
3832
or as lines of JSON (``.jsonl``). Lines of JSON can also be processed as streams from stdin.

docs/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ EQL also has a preprocessor that can perform parse and translation time evaluati
1414

1515
.. note::
1616
This documentation is about EQL for Elastic Endgame. Several syntax changes were made in Elasticsearch to `bring Event Query Language to the Elastic Stack <https://www.elastic.co/guide/en/elasticsearch/reference/current/eql.html>`_. The existing Python EQL implementation remains unchanged, but please keep the below differences in mind when switching between the two different versions of EQL.
17-
17+
1818
In the Elastic Stack:
19-
19+
2020
- Most operators are now case-sensitive. For example, ``process_name == "cmd.exe"`` is no longer equivalent to ``process_name == "Cmd.exe"``.
2121
- Functions are now case-sensitive. To use the case-insensitive variant, use ``~``, such as ``endsWith~(process_name, ".exe")``.
2222
- For case-insensitive equality comparisons, use the ``:`` operator. For example, ``process_name : "cmd.exe"`` is equivalent to ``process_name : "Cmd.exe"``.
@@ -27,12 +27,12 @@ EQL also has a preprocessor that can perform parse and translation time evaluati
2727
- ``=`` can no longer be substituted for the ``==`` operator.
2828
- ``'`` strings are no longer supported. Use ``"""`` or ``"`` to represent strings.
2929
- ``?"`` and ``?'`` no longer indicate raw strings. Use the ``"""..."""`` syntax instead.
30-
30+
3131
For more details, see the `limitations <https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-syntax.html#eql-syntax-limitations>`_ section of the Elasticsearch EQL documentation.
3232

3333
Getting Started
3434
^^^^^^^^^^^^^^^^
35-
The EQL module current supports Python 2.7 and 3.5+. Assuming a supported Python version is installed, run the command:
35+
The EQL module requires Python 3.8 or higher. Assuming a supported Python version is installed, run the command:
3636

3737
.. code-block:: console
3838
@@ -43,7 +43,7 @@ If Python is configured and already in the PATH, then ``eql`` will be readily av
4343
.. code-block:: console
4444
4545
$ eql --version
46-
eql 0.9
46+
eql 1.0.0
4747
4848
From there, try a :download:`sample json file <_static/example.json>` and test it with EQL.
4949

eql/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
Walker,
6767
)
6868

69-
__version__ = '0.9.19'
69+
__version__ = '1.0.0'
7070
__all__ = (
7171
"__version__",
7272
"AnalyticOutput",

eql/ast.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,7 @@ def __unicode__(self):
139139

140140
def __str__(self):
141141
"""Render the AST back as a valid EQL string."""
142-
unicoded = self.__unicode__()
143-
# Python 2.7
144-
if not isinstance(unicoded, str):
145-
unicoded = unicoded.encode('utf-8')
146-
return unicoded
142+
return self.__unicode__()
147143

148144

149145
# noinspection PyAbstractClass

0 commit comments

Comments
 (0)