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

deprecate python 3.8 support #194

Merged
merged 1 commit into from
Dec 21, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
1.15.0 (master)
---------------
* Dropped support for Python 3.7.
* Support for Python 3.8 has been deprecated and will be removed in the next
scheduled release.

1.14.0 (2023-11-01)
-------------------
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ disallow_untyped_defs = true
filterwarnings = [
"error",
"ignore:CSR support in pyOpenSSL is deprecated:DeprecationWarning",
# We ignore our own warning about dropping Python 3.8 support.
"ignore:Python 3.8 support will be dropped:DeprecationWarning",
]
norecursedirs = "*.egg .eggs dist build docs .tox"

Expand Down
10 changes: 10 additions & 0 deletions src/josepy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

"""

import sys
import warnings

# flake8: noqa
from josepy.b64 import b64decode, b64encode
from josepy.errors import (
Expand Down Expand Up @@ -73,3 +76,10 @@
ComparableX509,
ImmutableMap,
)

if sys.version_info[:2] == (3, 8):
warnings.warn(
"Python 3.8 support will be dropped in the next scheduled release of "
"josepy. Please upgrade your Python version.",
DeprecationWarning,
)
25 changes: 25 additions & 0 deletions tests/init_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import importlib
import re
import sys
import warnings

import pytest

import josepy


@pytest.mark.skipif(sys.version_info[:2] != (3, 8), reason="requires Python 3.8")
def test_warns() -> None:
with pytest.warns(DeprecationWarning, match=re.escape(r"Python 3.8 support")):
importlib.reload(josepy)


@pytest.mark.skipif(sys.version_info[:2] == (3, 8), reason="requires Python != 3.8")
def test_does_not_warn() -> None:
with warnings.catch_warnings():
warnings.simplefilter("error")
importlib.reload(josepy)


if __name__ == "__main__":
sys.exit(pytest.main(sys.argv[1:] + [__file__])) # pragma: no cover
Loading