Skip to content

fix: do not duplicate site dirs in Unix.iter_{config,site}_dirs() when use_site_for_root is active#469

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
viccie30:fix_duplicate_site_dirs
Mar 28, 2026
Merged

fix: do not duplicate site dirs in Unix.iter_{config,site}_dirs() when use_site_for_root is active#469
gaborbernat merged 1 commit into
tox-dev:mainfrom
viccie30:fix_duplicate_site_dirs

Conversation

@viccie30

Copy link
Copy Markdown
Contributor

I did not see the pull request template that CONTRIBUTING.md refers to, so I'm just sending this in as-is.

Unix.iter_config_dirs() and Unix.iter_data_dirs() yield both the user config/data dir and the site config/data dirs. When use_site_for_root is set and active, the user property is redirected to the first site property. This means that the iter-functions return the first site property twice.

This PR adds a check to skip yielding the user property if use_site_for_root is set and active, fixing the duplication.

@gaborbernat gaborbernat enabled auto-merge (squash) March 26, 2026 18:39

@gaborbernat gaborbernat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the CI?

@gaborbernat gaborbernat marked this pull request as draft March 26, 2026 18:43
auto-merge was automatically disabled March 26, 2026 18:43

Pull request was converted to draft

@viccie30

viccie30 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

I'll fix the test I added to run on Windows as well. Since it was a test for Unix-specific code, I hadn't thought that it'd run on Windows.
I'll test on Windows and Linux before pushing again. I don't have a Mac system to test on, but it looks like it passed on Mac anyway.

@viccie30 viccie30 force-pushed the fix_duplicate_site_dirs branch from 77b923f to 7b0aa58 Compare March 26, 2026 22:15
@viccie30 viccie30 marked this pull request as ready for review March 26, 2026 22:16
@viccie30

Copy link
Copy Markdown
Contributor Author

I was unable to get anything to run on Windows, getting all kinds of permission errors from some overenthusiastic security system. The test now looks like the one above, so I hope this makes the CI pass.

@gaborbernat gaborbernat merged commit 3ce0f50 into tox-dev:main Mar 28, 2026
29 checks passed
@viccie30 viccie30 deleted the fix_duplicate_site_dirs branch March 28, 2026 15:50
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.

2 participants