Skip to content

Commit 0fa6b38

Browse files
committed
Update build for python 3.12
1 parent a4177fe commit 0fa6b38

File tree

9 files changed

+24
-17
lines changed

9 files changed

+24
-17
lines changed

Diff for: .github/workflows/build.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
17+
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1818

1919
steps:
2020
- uses: actions/checkout@v2
21-
with:
22-
path: code42cli
2321
- name: Setup Python
2422
uses: actions/setup-python@v1
2523
with:
2624
python-version: ${{ matrix.python }}
2725
- name: Install tox
28-
run: pip install tox==3.17.1
26+
run: |
27+
pip install tox==3.17.1
28+
pip install .
2929
- name: Run Unit tests
30-
run: cd code42cli; tox -e py # Run tox using the version of Python in `PATH`
30+
run: tox -e py # Run tox using the version of Python in `PATH`
3131
- name: Submit coverage report
3232
uses: codecov/[email protected]
3333
with:

Diff for: .github/workflows/docs.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
with:
2121
python-version: '3.x'
2222
- name: Install tox
23-
run: pip install tox==3.17.1
23+
run: |
24+
pip install tox==3.17.1
25+
pip install .
2426
- name: Build docs
2527
run: tox -e docs

Diff for: .github/workflows/nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
14+
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1515

1616
steps:
1717
- uses: actions/checkout@v2

Diff for: .github/workflows/style.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
with:
2121
python-version: '3.x'
2222
- name: Install tox
23-
run: pip install tox==3.17.1
23+
run: |
24+
pip install tox==3.17.1
25+
pip install .
2426
- name: Run style checks
2527
run: tox -e style

Diff for: .pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
hooks:
1515
- id: black
1616
- repo: https://github.com/pycqa/flake8
17-
rev: 3.8.3
17+
rev: 6.1.0
1818
hooks:
1919
- id: flake8
2020
additional_dependencies:

Diff for: setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ ignore =
3131
B904
3232
# manual quoting
3333
B907
34+
# assertRaises-type
35+
B908
3436
# up to 88 allowed by bugbear B950
3537
max-line-length = 80

Diff for: setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@
4141
"ipython>=8.10.0;python_version>='3.8'",
4242
"pandas>=1.1.3",
4343
"py42>=1.26.0",
44+
"setuptools>=66.0.0",
4445
],
4546
extras_require={
4647
"dev": [
47-
"flake8==3.8.3",
48+
"flake8>=4.0.0",
4849
"pytest==4.6.11",
4950
"pytest-cov==2.10.0",
5051
"pytest-mock==2.0.0",
5152
"tox>=3.17.1",
53+
"importlib-metadata<5.0",
5254
],
5355
"docs": [
5456
"sphinx==4.4.0",

Diff for: tests/logger/test_init.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,21 @@ def test_get_logger_for_server_when_given_cef_format_uses_cef_formatter():
7777
logger = get_logger_for_server(
7878
"example.com", ServerProtocol.TCP, SendToFileEventsOutputFormat.CEF, None
7979
)
80-
assert type(logger.handlers[0].formatter) == FileEventDictToCEFFormatter
80+
assert isinstance(logger.handlers[0].formatter, FileEventDictToCEFFormatter)
8181

8282

8383
def test_get_logger_for_server_when_given_json_format_uses_json_formatter():
8484
logger = get_logger_for_server(
8585
"example.com", ServerProtocol.TCP, OutputFormat.JSON, None
8686
)
87-
actual = type(logger.handlers[0].formatter)
88-
assert actual == FileEventDictToJSONFormatter
87+
assert isinstance(logger.handlers[0].formatter, FileEventDictToJSONFormatter)
8988

9089

9190
def test_get_logger_for_server_when_given_raw_json_format_uses_raw_json_formatter():
9291
logger = get_logger_for_server(
9392
"example.com", ServerProtocol.TCP, OutputFormat.RAW, None
9493
)
95-
actual = type(logger.handlers[0].formatter)
96-
assert actual == FileEventDictToRawJSONFormatter
94+
assert isinstance(logger.handlers[0].formatter, FileEventDictToRawJSONFormatter)
9795

9896

9997
def test_get_logger_for_server_when_called_twice_only_has_one_handler():
@@ -108,7 +106,7 @@ def test_get_logger_for_server_uses_no_priority_syslog_handler():
108106
logger = get_logger_for_server(
109107
"example.com", ServerProtocol.TCP, SendToFileEventsOutputFormat.CEF, None
110108
)
111-
assert type(logger.handlers[0]) == NoPrioritySysLogHandler
109+
assert isinstance(logger.handlers[0], NoPrioritySysLogHandler)
112110

113111

114112
def test_get_logger_for_server_constructs_handler_with_expected_args(

Diff for: tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{311,310,39,38,37}
3+
py{312,311,310,39,38,37}
44
docs
55
style
66
skip_missing_interpreters = true
@@ -12,6 +12,7 @@ deps =
1212
pytest-cov == 4.0.0
1313
pandas >= 1.1.3
1414
pexpect == 4.8.0
15+
setuptools >= 66.0.0
1516

1617
commands =
1718
# -v: verbose

0 commit comments

Comments
 (0)