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

Conversation

bramp
Copy link
Contributor

@bramp bramp commented Jun 30, 2024

unit_parse did not work with Python 3.12 (due to #9 / hgrecco/pint#1974), which required bumping to the latest version of Pint.

I made appropriate changes, and ensured all tests continue to pass.

Fixes #9

dylanwal and others added 8 commits June 30, 2024 21:05
In python 3.12 these are now Syntax Errors instead of Deprecation warnings.
…a unify dash.

The tests previously weren't working correctly. Specifically when doing Quantity('-123') with a unify dash, pint would actually return the Quantity('123'). The test doesn't catch this, as the test is effectively doing Quantity($input) == Quantity($input).

With Python 3.12, the internals of Quantity changed, to explictly reject unify dashes, instead of silently skipping them.
In pint 0.21 ppm was officially added, named ppm, instead of parts_per_million.
Copy link
Owner

@dylanwal dylanwal left a comment

Choose a reason for hiding this comment

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

Look good! Thanks for the fix!

@dylanwal dylanwal merged commit 39d930f into dylanwal:master Jul 5, 2024
@@ -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

@bramp bramp deleted the py312 branch July 5, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Derived dimensions cannot have aliases." if pint is updated
2 participants