Skip to content

Commit

Permalink
tests: exclude gmpy2 to get tests passing on python3.12
Browse files Browse the repository at this point in the history
gmpy2 does not currently build against Python 3.12.
Exclude it from the test suite for now.
  • Loading branch information
davvid committed Jan 13, 2024
1 parent db21c46 commit 73babb1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions jsonpickle/ext/gmpy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import gmpy2 as gmpy
try:
import gmpy2 as gmpy
except ImportError:
gmpy = None

from ..handlers import BaseHandler, register, unregister

Expand All @@ -15,8 +18,10 @@ def restore(self, data):


def register_handlers():
register(gmpy.mpz, GmpyMPZHandler, base=True)
if gmpy is not None:
register(gmpy.mpz, GmpyMPZHandler, base=True)


def unregister_handlers():
unregister(gmpy.mpz)
if gmpy is not None:
unregister(gmpy.mpz)
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ coverage<5
ecdsa
feedparser
flake8<5
gmpy2
gmpy2; python_version<"3.12"
numpy
pandas
pymongo
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ testing =
# local
ecdsa
feedparser
gmpy2
gmpy2; python_version<"3.12"
numpy
pandas
pymongo
Expand Down

0 comments on commit 73babb1

Please sign in to comment.