Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#361 - Add deprecation warning for python 3.8 #384

Merged
merged 1 commit into from
Jan 14, 2025
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
12 changes: 12 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys

import pytest

from thehive4py import _warn_old_py_version


def test_warn_old_py_version():
actual_py_version = sys.version_info
dummy_min_py_version = (actual_py_version[0], actual_py_version[1] + 1)
with pytest.deprecated_call():
_warn_old_py_version(min_py_version=dummy_min_py_version)
19 changes: 19 additions & 0 deletions thehive4py/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
from thehive4py.client import TheHiveApi


def _warn_old_py_version(min_py_version=(3, 9)):
import sys
import warnings

if sys.version_info < min_py_version:
warnings.warn(
message=(
"thehive4py will drop support for Python versions below "
f"{min_py_version[0]}.{min_py_version[1]}, as they have reached their "
"end of life. Please upgrade to a newer version as soon as possible."
),
category=DeprecationWarning,
stacklevel=3,
)


_warn_old_py_version()
Loading