Skip to content

Try pydantic-pint#173

Draft
mattwthompson wants to merge 4 commits intomainfrom
pydantic-pint
Draft

Try pydantic-pint#173
mattwthompson wants to merge 4 commits intomainfrom
pydantic-pint

Conversation

@mattwthompson
Copy link
Copy Markdown
Member

Description

Provide a brief description of the PR's purpose here.

Todos

Notable points that this PR has either accomplished or will accomplish.

  • TODO 1

Questions

  • Question1

Status

  • Ready to go

@mattwthompson
Copy link
Copy Markdown
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 =============================================

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.

1 participant