Try pydantic-pint#173
Draft
mattwthompson wants to merge 4 commits intomainfrom
Draft
Conversation
Member
Author
|
Unfortunately this would require a change in the toolkit under current construction: $ pixi run -e py313pint25 python -m pytest downstream_dummy/tests/ pydantic-pint ✭
=========================================== test session starts ===========================================
platform darwin -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
Using --randomly-seed=4038091971
rootdir: /Users/mattthompson/software/openff-units
configfile: pyproject.toml
plugins: cov-7.1.0, xdist-3.8.0, randomly-3.15.0
collected 0 items / 1 error
================================================= ERRORS ==================================================
__________________________ ERROR collecting downstream_dummy/tests/test_dummy.py __________________________
downstream_dummy/tests/test_dummy.py:2: in <module>
from dummy import object_to_quantity
downstream_dummy/dummy.py:113: in <module>
@object_to_quantity.register(type[Quantity])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.pixi/envs/py313pint25/lib/python3.13/functools.py:896: in register
raise TypeError(
E TypeError: Invalid first argument to `register()`: type[typing.Annotated[pint.registry.Quantity, <pydantic_pint.quantity.PydanticPintQuantity object at 0x10edebe00>]]. Use either `@register(some_class)` or plain `@register` on an annotated function.
========================================= short test summary info =========================================
ERROR downstream_dummy/tests/test_dummy.py - TypeError: Invalid first argument to `register()`: type[typing.Annotated[pint.registry.Quantity, <pyda...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================ 1 error in 0.23s ============================================= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Provide a brief description of the PR's purpose here.
Todos
Notable points that this PR has either accomplished or will accomplish.
Questions
Status