Skip to content

🐛 fix(macos): yield individual site dirs in iter_*_dirs#429

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:347
Feb 14, 2026
Merged

🐛 fix(macos): yield individual site dirs in iter_*_dirs#429
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:347

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

@gaborbernat gaborbernat commented Feb 14, 2026

On macOS, iter_data_dirs() and iter_config_dirs() were falling back to the base class implementation which yields site_data_dir as a single string. When XDG_DATA_DIRS is set with multiple paths (common on NixOS and similar setups) or under Homebrew where multiple site directories exist, this produced a colon-joined string like /path1:/path2 instead of yielding each directory individually. 🐛

The Unix platform already overrides both methods to yield from self._site_data_dirs / self._site_config_dirs, correctly producing individual paths. macOS has the same _site_data_dirs and _site_config_dirs properties (Homebrew-aware + XDG mixin) but was missing the matching overrides. This adds the identical overrides to _MacOSDefaults, consistent with the existing Unix approach.

Windows is unaffected since it only has single-value site directories with no _site_data_dirs property.

Fixes #377

The base class iter_data_dirs/iter_config_dirs yields site_data_dir as a
single string, which on macOS with multipath or XDG_DATA_DIRS set is a
colon-joined string rather than individual paths. Unix already overrides
these to yield from _site_data_dirs/_site_config_dirs, but macOS was
missing the same overrides despite having multi-path site directory
support (Homebrew-aware + XDG).

Fixes tox-dev#377
@gaborbernat gaborbernat requested a review from ofek as a code owner February 14, 2026 00:12
@gaborbernat gaborbernat enabled auto-merge (squash) February 14, 2026 00:13
@gaborbernat gaborbernat merged commit 3f29817 into tox-dev:main Feb 14, 2026
29 checks passed
@gaborbernat gaborbernat changed the title 🐛 fix(macos): yield individual site dirs in iter_*_dirs ✨ feat(api): add user_bin_dir and fix macOS iter_*_dirs Feb 14, 2026
@gaborbernat gaborbernat changed the title ✨ feat(api): add user_bin_dir and fix macOS iter_*_dirs 🐛 fix(macos): yield individual site dirs in iter_*_dirs Feb 14, 2026
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.

iter_data_dirs doesn't consider all site dirs

1 participant