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

Support Python 3.12+ as well as switching to the latest pint #11

Merged
merged 8 commits into from
Jul 5, 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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.10", "3.11"]
python-version: ["3.8", "3.10", "3.11"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should 3.12 be added to the list?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add it to a new PR that I have coming


steps:
- uses: actions/checkout@v3
Expand All @@ -30,4 +30,4 @@ jobs:

- name: Test with pytest
run: |
pytest --cov --cov-report=html
pytest --cov --cov-report=html
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pint==0.19
pint==0.24.1
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = unit_parse
version = 0.1.7
version = 0.1.9
description = Parse units from strings. From mess to order!
long_description = file: README.md
long_description_content_type = text/markdown
Expand All @@ -24,7 +24,7 @@ package_dir =
zip_safe = no
include_package_data = true
install_requires =
pint==0.19
pint==0.24.1

[options.extras_require]
testing =
Expand Down
8 changes: 3 additions & 5 deletions src/unit_parse/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def check_for_pint():

# if no pint found, load local
import pint
current_path = os.path.dirname(os.path.realpath(__file__))
u_ = pint.UnitRegistry(autoconvert_offset_to_baseunit=True,
filename=os.path.join(current_path, "support_files", "default_en.txt"))
u_ = pint.UnitRegistry(autoconvert_offset_to_baseunit=True)
u_.default_format = "~"
return u_

Expand Down Expand Up @@ -99,8 +97,8 @@ def __init__(self):
["°C", "degC"], # eliminates issue with capitalization step
["(?<=[0-9]{1})[ ]{0,1}X[ ]{0,1}(?=[0-9]{1})", "*"], # unify multiplication symbols
["(?<=[0-9]{1})[ ]{0,1}x[ ]{0,1}(?=[0-9]{1})", "*"], # unify multiplication symbols
["\[", "("], # noqa: W605 # make all brackets parenthesis
["\]", ")"], # noqa: W605 # make all brackets parenthesis
[r"\[", "("], # make all brackets parenthesis
[r"\]", ")"], # make all brackets parenthesis
["^.*={1}", ""], # delete everything in front of equal
["^.*:{1}", ""], # delete everything in front of collen
["( to )", "-"], # unify how range are represented
Expand Down
74 changes: 0 additions & 74 deletions src/unit_parse/support_files/constants_en.txt

This file was deleted.

Loading