File tree Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Expand file tree Collapse file tree 4 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ Changelog
4
4
2.2.0 (main)
5
5
------------
6
6
7
+ * Support for Python 3.9 has been deprecated and will be removed in the next
8
+ scheduled release.
9
+
7
10
2.1.0 (2025-07-08)
8
11
------------
9
12
Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ disallow_untyped_defs = true
96
96
[tool .pytest .ini_options ]
97
97
filterwarnings = [
98
98
" error" ,
99
+ # We ignore our own warning about dropping Python 3.9 support.
100
+ " ignore:Python 3.9 support will be dropped:DeprecationWarning" ,
99
101
]
100
102
norecursedirs = " *.egg .eggs dist build docs .tox"
101
103
Original file line number Diff line number Diff line change 26
26
27
27
"""
28
28
29
+ import sys
30
+ import warnings
31
+
29
32
# flake8: noqa
30
33
from josepy .b64 import b64decode , b64encode
31
34
from josepy .errors import (
72
75
ComparableRSAKey ,
73
76
ImmutableMap ,
74
77
)
78
+
79
+ if sys .version_info [:2 ] == (3 , 9 ):
80
+ warnings .warn (
81
+ "Python 3.9 support will be dropped in the next scheduled release of "
82
+ "josepy. Please upgrade your Python version." ,
83
+ DeprecationWarning ,
84
+ )
Original file line number Diff line number Diff line change
1
+ import importlib
2
+ import re
3
+ import sys
4
+ import warnings
5
+
6
+ import pytest
7
+
8
+ import josepy
9
+
10
+
11
+ @pytest .mark .skipif (sys .version_info [:2 ] != (3 , 9 ), reason = "requires Python 3.9" )
12
+ def test_warns () -> None :
13
+ with pytest .warns (DeprecationWarning , match = re .escape (r"Python 3.9 support" )):
14
+ importlib .reload (josepy )
15
+
16
+
17
+ @pytest .mark .skipif (sys .version_info [:2 ] == (3 , 9 ), reason = "requires Python != 3.9" )
18
+ def test_does_not_warn () -> None :
19
+ with warnings .catch_warnings ():
20
+ warnings .simplefilter ("error" )
21
+ importlib .reload (josepy )
22
+
23
+
24
+ if __name__ == "__main__" :
25
+ sys .exit (pytest .main (sys .argv [1 :] + [__file__ ])) # pragma: no cover
You can’t perform that action at this time.
0 commit comments