Skip to content

Commit 6d025fb

Browse files
committed
bump min req to py 3.8
1 parent 5dd4323 commit 6d025fb

File tree

5 files changed

+37
-88
lines changed

5 files changed

+37
-88
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 4 additions & 3 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:
@@ -28,9 +28,10 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
python -m pip install wheel setuptools
31+
python -m pip install -e ".[lint,test]"
3132
- name: Lint with flake8
3233
run: |
33-
python setup.py -q lint
34+
python -W ignore::DeprecationWarning setup.py -q lint
3435
- name: Test with pytest
3536
run: |
36-
python setup.py -q test
37+
python -W ignore::DeprecationWarning setup.py -q test

.github/workflows/pythonpackage27.yml

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

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
77

88
### Changed
99

10-
* Updated `lark-parser` dependency to `lark>=1.3.1` for Python 3.8+ (migrated from deprecated `lark-parser` package to `lark`)
11-
* Python < 3.8 continues to use `lark-parser~=0.12.0` for backward compatibility
10+
* Updated `lark-parser` dependency to `lark>=1.3.1` (migrated from deprecated `lark-parser` package to `lark`)
1211
* Updated GitHub Actions workflows to use Python 3.8+ and newer action versions
12+
* Simplified dependencies by removing Python 2.7 and Python < 3.8 compatibility code
13+
14+
### Removed
15+
16+
* **BREAKING**: Dropped support for Python 2.7 and Python < 3.8. The minimum required Python version is now 3.8.
1317

1418
# Version 0.9.19
1519

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.

setup.py

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,24 @@
88
import io
99

1010
from setuptools import setup, Command
11-
from setuptools.command.test import test as TestCommand
1211

1312

1413
with io.open('eql/__init__.py', 'rt', encoding='utf8') as f:
1514
__version__ = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)
1615

1716
install_requires = [
18-
"lark>=1.3.1; python_version>='3.8'",
19-
"lark-parser~=0.12.0; python_version<'3.8'",
20-
"enum34; python_version<'3.4'",
21-
"ipaddress; python_version<'3'",
17+
"lark>=1.3.1",
2218
]
2319

2420
test_requires = [
25-
"mock~=1.3.0",
2621
"pytest~=3.8.2",
2722
"pytest-cov==2.4",
28-
"flake8==2.5.1; python_version<'3.8'",
29-
"flake8>=3.8.0; python_version>='3.8'",
23+
"flake8>=3.8.0",
3024
"pep257==0.7.0",
3125
"coverage==4.5.3",
32-
"flake8-pep257==1.0.5; python_version<'3.8'",
33-
"flake8-docstrings>=1.5.0; python_version>='3.8'",
34-
"PyYAML<6.0; python_version<'3.4'",
35-
"PyYAML; python_version>='3.4'",
26+
"flake8-docstrings>=1.5.0",
27+
"PyYAML",
3628
"toml~=0.10",
37-
"pluggy==1.0.0-dev0; python_version<'3.4'",
38-
"configparser<5.0; python_version<'3.4'",
39-
"contextlib2~=0.6.0",
40-
"more-itertools~=5.0; python_version<'3.4'",
41-
"importlib-metadata<3.0; python_version<'3.4'",
42-
"zipp<1.0; python_version<'3.4'",
4329
"attrs==21.4.0"
4430
]
4531
etc_files = [os.path.relpath(fn, 'eql') for fn in glob.glob('eql/etc/*') if not fn.endswith('.py')]
@@ -59,42 +45,32 @@ def finalize_options(self):
5945

6046
def run(self):
6147
"""Run the flake8 linter."""
62-
self.distribution.fetch_build_eggs(test_requires)
63-
self.distribution.packages.append('tests')
64-
65-
# Handle different flake8 API versions
66-
try:
67-
# Old flake8 API (2.x)
68-
from flake8.main import Flake8Command
69-
flake8cmd = Flake8Command(self.distribution)
70-
flake8cmd.options_dict = {}
71-
flake8cmd.run()
72-
except ImportError:
73-
# New flake8 API (3.x+)
74-
import subprocess
75-
# Run flake8 via command line (respects setup.cfg configuration)
76-
result = subprocess.run(
77-
[sys.executable, '-m', 'flake8', 'eql', 'tests'],
78-
cwd=os.path.dirname(os.path.abspath(__file__))
79-
)
80-
sys.exit(result.returncode)
81-
82-
83-
class Test(TestCommand):
48+
import subprocess
49+
# Run flake8 via command line (respects setup.cfg configuration)
50+
result = subprocess.run(
51+
[sys.executable, '-m', 'flake8', 'eql', 'tests'],
52+
cwd=os.path.dirname(os.path.abspath(__file__))
53+
)
54+
sys.exit(result.returncode)
55+
56+
57+
class Test(Command):
8458
"""Use pytest (http://pytest.org/latest/) in place of the standard unittest library."""
8559

8660
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
8761

8862
def initialize_options(self):
89-
"""Need to ensure pytest_args exists."""
90-
TestCommand.initialize_options(self)
63+
"""Initialize options."""
9164
self.pytest_args = []
9265

93-
def run_tests(self):
66+
def finalize_options(self):
67+
"""Finalize options."""
68+
pass
69+
70+
def run(self):
9471
"""Run pytest."""
9572
import pytest
9673
import eql
97-
9874
eql.parser.full_tracebacks = True
9975
sys.exit(pytest.main(self.pytest_args))
10076

@@ -113,19 +89,17 @@ def run_tests(self):
11389
'Intended Audience :: Science/Research',
11490
'Intended Audience :: System Administrators',
11591
'Natural Language :: English',
116-
'Programming Language :: Python :: 2',
117-
'Programming Language :: Python :: 2.7',
11892
'Programming Language :: Python :: 3',
119-
'Programming Language :: Python :: 3.4',
120-
'Programming Language :: Python :: 3.5',
121-
'Programming Language :: Python :: 3.6',
122-
'Programming Language :: Python :: 3.7',
93+
'Programming Language :: Python :: 3.8',
94+
'Programming Language :: Python :: 3.9',
95+
'Programming Language :: Python :: 3.10',
96+
'Programming Language :: Python :: 3.11',
97+
'Programming Language :: Python :: 3.12',
12398
'Topic :: Database',
12499
'Topic :: Internet :: Log Analysis',
125100
'Topic :: Scientific/Engineering :: Information Analysis',
126101
],
127102
url='https://eql.readthedocs.io',
128-
tests_require=install_requires + test_requires,
129103
cmdclass={
130104
'lint': Lint,
131105
'test': Test

0 commit comments

Comments
 (0)