Repository: jertel/elastalert2 (language: python)

Issue:
fix rules_test.py
## Description

<!--
Provide a description for your pull request. Note any breaking changes.
-->

I modified the modified test code in the pull request below.
https://github.com/jertel/elastalert2/pull/483

## Checklist

<!--
The following checklist items must be completed before PRs can be merged. 
-->

- [x] I have reviewed the [contributing guidelines](https://github.com/jertel/elastalert2/blob/master/CONTRIBUTING.md).
- [x] I have included unit tests for my changes or additions.
- [x] I have successfully run `make test-docker` with my changes.
- [ ] I have manually tested all relevant modes of the change in this PR.
- [ ] I have updated the [documentation](https://elastalert2.readthedocs.io).
- [ ] I have updated the [changelog](https://github.com/jertel/elastalert2/blob/master/CHANGELOG.md).


## Questions or Comments

<!--
If any of the checklist items do not apply, note the reasoning for each. If you're simply
upgrading a library version, you do not need to explain why the docs or unit tests checklist
items are not checked, however the changelog should be updated to reflect the new version.

If you have questions about completing this PR, or about the process, note them here.

If you are not ready for this PR to be reviewed please mention that here.
-->



Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 178f3b65..fad593da 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@
 
 ## Other changes
 - [Docs] Add exposed metrics documentation - [#498](https://github.com/jertel/elastalert2/pull/498) - @thisisxgp
+- Upgrade to Python 3.10 and Sphinx 4.2.0 - [#501](https://github.com/jertel/elastalert2/pull/501) - @jertel
 
 # 2.2.2
 
diff --git a/Dockerfile b/Dockerfile
index 3d7dfb15..71c2c720 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:slim-buster as builder
+FROM python:3-slim-buster as builder
 
 LABEL description="ElastAlert 2 Official Image"
 LABEL maintainer="Jason Ertel"
@@ -10,7 +10,7 @@ RUN mkdir -p /opt/elastalert && \
     pip install setuptools wheel && \
     python setup.py sdist bdist_wheel
 
-FROM python:slim-buster
+FROM python:3-slim-buster
 
 ARG GID=1000
 ARG UID=1000
@@ -18,12 +18,13 @@ ARG USERNAME=elastalert
 
 COPY --from=builder /tmp/elastalert/dist/*.tar.gz /tmp/
 
-RUN apt-get update && apt-get -y upgrade && \
-    apt-get install -y jq curl && \
-    apt-get -y autoremove && \
+RUN apt update && apt -y upgrade && \
+    apt -y install jq curl gcc libffi-dev && \
     rm -rf /var/lib/apt/lists/* && \
     pip install /tmp/*.tar.gz && \
     rm -rf /tmp/* && \
+    apt -y remove gcc libffi-dev && \
+    apt -y autoremove && \
     mkdir -p /opt/elastalert && \
     echo "#!/bin/sh" >> /opt/elastalert/run.sh && \
     echo "set -e" >> /opt/elastalert/run.sh && \
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 3f6c1813..e4a45631 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,15 +1,13 @@
 -r requirements.txt
-docutils<0.17
 flake8
 flake8-absolute-import
 m2r2
-pluggy>=0.12.0
 pre-commit
 pylint<2.10
 pytest==6.2.4
 pytest-cov==2.12.1
 pytest-xdist==2.3.0
 setuptools
-sphinx==4.1.2
+sphinx==4.2.0
 sphinx_rtd_theme
 tox==3.24.1
diff --git a/requirements.txt b/requirements.txt
index b3884b29..02d3a2c8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,6 +20,5 @@ stomp.py>=4.1.17
 texttable>=0.8.8
 statsd-tags==3.2.1.post1
 twilio>=6.0.0,<6.58
-tzlocal<3.0
 tencentcloud-sdk-python>=3.0.484
 jsonpointer>=2.1
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 57ee114b..c52551bb 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
         "Discussion Forum": "https://github.com/jertel/elastalert2/discussions",
     },
     classifiers=[
-        'Programming Language :: Python :: 3.9',
+        'Programming Language :: Python :: 3.10',
         'License :: OSI Approved :: Apache Software License',
         'Operating System :: OS Independent',
     ],
@@ -55,7 +55,6 @@
         'twilio>=6.0.0,<6.58',
         'cffi>=1.11.5',
         'statsd-tags==3.2.1.post1',
-        'tzlocal<3.0',
         'tencentcloud-sdk-python>=3.0.484',
         'jsonpointer>=2.1'
     ]


Test patch:
diff --git a/tests/Dockerfile-test b/tests/Dockerfile-test
index 99f7485b..38949446 100644
--- a/tests/Dockerfile-test
+++ b/tests/Dockerfile-test
@@ -1,8 +1,10 @@
 FROM python:3-slim-buster
 
 RUN apt update && apt upgrade -y
+RUN apt install -y gcc libffi-dev
 
 WORKDIR /home/elastalert
 
 ADD requirements*.txt ./
+
 RUN pip3 install -r requirements-dev.txt
diff --git a/tests/tox.ini b/tests/tox.ini
index 8b977a3d..c5487d68 100644
--- a/tests/tox.ini
+++ b/tests/tox.ini
@@ -1,6 +1,6 @@
 [tox]
 project = elastalert
-envlist = py39,docs
+envlist = py310,docs
 setupdir = ..
 
 [testenv]