Skip to content

♻️ refactor(api): share use_site iteration - #606

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:use-site-iter-base
Sep 29, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:use-site-iter-base

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

After #604 moved site path and list handling into the base class, Unix still overrode all six _iter_*_dirs methods. ♻️ Each copy differed from the base in one condition. As root with use_site_for_root, it skipped the user directory.

That condition now lives in the base iterators behind _use_site, which stays False everywhere except Unix, where it checks for uid 0. Runtime keeps its inverted rule. Root drops the site directory there, because site_runtime_dir reads the invoking user's XDG_RUNTIME_DIR.

No platform yields different directories, hence skip news.

Unix overrode all six _iter_*_dirs only to skip the user dir as root
with use_site_for_root, while tox-dev#604 moved the rest of the iteration
into the base class. The base iterators now carry that skip behind
_use_site, which returns False outside Unix, so the overrides go.
Results do not change on any platform.
@gaborbernat
gaborbernat requested a review from ofek as a code owner September 29, 2026 18:18
@gaborbernat gaborbernat added enhancement New feature or request skip news No news fragment needed labels Sep 29, 2026
@gaborbernat
gaborbernat merged commit bdafa67 into tox-dev:main Sep 29, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request skip news No news fragment needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant