Skip to content

Fix: Accept lists in gen_preprocess_options for TOML compatibility#5188

Open
realMelTuc wants to merge 2 commits intopypa:mainfrom
realMelTuc:fix/issue-4810-macro-list-to-tuple
Open

Fix: Accept lists in gen_preprocess_options for TOML compatibility#5188
realMelTuc wants to merge 2 commits intopypa:mainfrom
realMelTuc:fix/issue-4810-macro-list-to-tuple

Conversation

@realMelTuc
Copy link

Summary

This PR fixes issue #4810 by modifying the gen_preprocess_options function to accept lists (as provided by TOML/pyproject.toml format) and convert them to tuples before processing.

Problem

When defining define-macros in pyproject.toml using the array syntax, the build would fail with TypeError because the function only accepted tuples, not lists.

Solution

Added list-to-tuple conversion before validation in the gen_preprocess_options function. This maintains backward compatibility while supporting TOML format.

Testing

Added comprehensive test coverage to verify both lists and tuples work correctly.

MelTuc added 2 commits February 19, 2026 18:41
- Change distutils reference in extension.rst to point to setuptools.pypa.io
- Remove workaround in docs/conf.py that pinned Python docs to 3.11
- This resolves the issue where docs builds were failing due to broken
  references to distutils in CPython docs for Python 3.12+.
- Convert lists to tuples to support pyproject.toml format
- Fixes issue pypa#4810 where define-macros in TOML format caused TypeError
- Added test to verify list-to-tuple conversion works correctly
- Maintains backward compatibility with tuple format
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