Repository navigation
Conversation
|
The failing Poetry tarfile regression test has been fixed upstream in python-poetry/poetry#11133, which is now merged. The failed Integration Tests run is still from October 9. Could you rerun it? |
There was a problem hiding this comment.
65 direct/reflected power checks matched Python numeric behavior for bases -10, -2, -1, 0, 1, 2 and 10 with negative/zero/positive exponents, float-base reflected dispatch, and zero-to-negative-power errors. I also checked the explicit integer reflected-power method and a custom __rpow__ operand. I used Python 3.12.14 against commit 7630f26.
Successful TOML wrapper results re-parsed to the same value with stdlib tomllib. In particular, tomlkit.item(2) ** -1 stays 0.5 rather than truncating to 0, and tomlkit.item(2) ** Reflected() reaches the custom operand after NotImplemented. Normal float-base dispatch can return a plain float, as Python does. These standalone assertions use fetched PR source; I did not run the full pytest/type-check suite.
Summary
Negative powers of integer items currently disagree with their serialized value:
item(2) ** -1compares equal to0, but renders as0.5. Fractional exponents also raise instead of allowing Python's reflected float operation.Keep floating-point power results as
Floatitems and passNotImplementedback to Python for reflected dispatch. Positive and modular integer powers retain their existing result type.Tests: 12 new cases pass (7 fail on the original implementation); the complete suite passes with 1109 tests on Python 3.12. Ruff and formatting checks pass, and both wheel and sdist build. Mypy reports the same five pre-existing errors on the original and patched source.
The downstream Poetry integration fails one extraction assertion on Python 3.12.15. A controlled replay with the official tarfile modules reproduces the difference without importing tomlkit: 3.12.15 normalizes the path and writes safely inside the destination, while the unchanged Poetry test expects OutsideDestinationError. The test expectation is addressed in python-poetry/poetry#11133.
Agent Drafting Metadata