Skip to content

Commit 39d930f

Browse files
authored
Merge pull request #11
Support Python 3.12+ as well as switching to the latest pint
2 parents 3a1e795 + 676f327 commit 39d930f

15 files changed

+28
-838
lines changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pint==0.19
1+
pint==0.24.1

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ package_dir =
2424
zip_safe = no
2525
include_package_data = true
2626
install_requires =
27-
pint==0.19
27+
pint==0.24.1
2828

2929
[options.extras_require]
3030
testing =

src/unit_parse/config.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def check_for_pint():
4848

4949
# if no pint found, load local
5050
import pint
51-
current_path = os.path.dirname(os.path.realpath(__file__))
52-
u_ = pint.UnitRegistry(autoconvert_offset_to_baseunit=True,
53-
filename=os.path.join(current_path, "support_files", "default_en.txt"))
51+
u_ = pint.UnitRegistry(autoconvert_offset_to_baseunit=True)
5452
u_.default_format = "~"
5553
return u_
5654

@@ -99,8 +97,8 @@ def __init__(self):
9997
["°C", "degC"], # eliminates issue with capitalization step
10098
["(?<=[0-9]{1})[ ]{0,1}X[ ]{0,1}(?=[0-9]{1})", "*"], # unify multiplication symbols
10199
["(?<=[0-9]{1})[ ]{0,1}x[ ]{0,1}(?=[0-9]{1})", "*"], # unify multiplication symbols
102-
["\[", "("], # noqa: W605 # make all brackets parenthesis
103-
["\]", ")"], # noqa: W605 # make all brackets parenthesis
100+
[r"\[", "("], # make all brackets parenthesis
101+
[r"\]", ")"], # make all brackets parenthesis
104102
["^.*={1}", ""], # delete everything in front of equal
105103
["^.*:{1}", ""], # delete everything in front of collen
106104
["( to )", "-"], # unify how range are represented

src/unit_parse/support_files/constants_en.txt

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)