Skip to content

Commit 226942c

Browse files
authored
Merge pull request #201 from CitrineInformatics/maintain/pint-0-23
Add compatibility for latest Pint release
2 parents 1a9f032 + 30fe1f7 commit 226942c

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

gemd/units/impl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
from typing import Union, List, Tuple, Generator, Any
99

1010
from pint import UnitRegistry, Unit, register_unit_format
11-
from pint.compat import tokenizer
11+
try: # Pint 0.23 migrated the location of this method, and augmented it
12+
from pint.pint_eval import tokenizer
13+
except ImportError: # pragma: no cover
14+
from pint.compat import tokenizer
1215
from tokenize import NAME, NUMBER, OP, ERRORTOKEN, TokenInfo
1316
# alias the error that is thrown when units are incompatible
1417
# this helps to isolate the dependence on pint

requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
pint==0.20
2-
sphinx==4.3.0
3-
sphinxcontrib-apidoc==0.3.0
4-
sphinx-rtd-theme==1.0.0
52
deprecation==2.1.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
packages.append("")
55

66
setup(name='gemd',
7-
version='1.16.7',
7+
version='1.16.8',
88
python_requires='>=3.8',
99
url='http://github.com/CitrineInformatics/gemd-python',
1010
description="Python binding for Citrine's GEMD data model",
@@ -23,7 +23,7 @@
2323
'tests.units': ['test_units.txt']
2424
},
2525
install_requires=[
26-
"pint>=0.20,<0.23",
26+
"pint>=0.20,<0.24",
2727
"deprecation>=2.1.0,<3"
2828
],
2929
extras_require={

test_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ pytest-cov==4.0.0
55
pandas==1.5.0
66
toolz==0.12.0
77
derp==0.1.1
8+
sphinx==4.3.0
9+
sphinxcontrib-apidoc==0.3.0
10+
sphinx-rtd-theme==1.0.0

0 commit comments

Comments
 (0)