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

Add support for files with interleaved sections #17

Merged
merged 2 commits into from
Jun 29, 2024
Merged

Conversation

claui
Copy link
Owner

@claui claui commented Jun 29, 2024

  • Add failing test with interleaved sections
  • Return a MutableMapping, not a concrete subclass

Turns out that interleaving the `project` and `tool` sections causes
the following error:

```
Expected TOMLKit table, found <class 'tomlkit.container.OutOfOrderTableProxy'>
```

Add a minimal failing variant of the default test.
This removes a dependency to TOMLKit’s implementation and allows it to
choose different MutableMapping implementations internally.

Fixes an issue where certain `pyproject.toml` files with interleaved
sections would cause the patcher module to bail with a failed assertion.

Closes #16. [1]

[1]: #16
@claui claui added the bug Something isn't working label Jun 29, 2024
@claui claui merged commit 60536c7 into main Jun 29, 2024
1 check passed
@claui claui deleted the fix-key-error branch June 29, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant