Skip to content

✨ feat(api): add site_bin_dir property#443

Merged
gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat:434
Feb 14, 2026
Merged

✨ feat(api): add site_bin_dir property#443
gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat:434

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

Applications that install system-wide executables need a standard location that mirrors user_bin_dir. Currently, user_bin_dir provides ~/.local/bin on Unix/macOS and %LOCALAPPDATA%\Programs on Windows, but there's no corresponding site-wide equivalent. This creates API inconsistency since all other directory types (data, config, cache, state, log, runtime) have both user and site variants. ✨ Package managers like Chocolatey, pip, and uv need a consistent answer for where to install system-wide binaries.

The implementation follows platform conventions researched from official documentation. Unix/Linux uses /usr/local/bin per FHS 3.0, which designates this path for locally-installed software distinct from distribution packages in /usr/bin. macOS uses /usr/local/bin as the standard Homebrew and user installation location, since /usr/bin is read-only on modern macOS per Apple's documentation. Windows uses %ProgramData%\bin to mirror the site_data_dir pattern, following Chocolatey's precedent of using %ProgramData%\Chocolatey\bin for system-wide package binaries. Android aliases to user_bin_dir since the platform has no system-wide installation concept per Android's storage documentation. 🔍

The change also implements use_site_for_root support on Unix, allowing user_bin_dir to redirect to site_bin_dir when running as root. This matches the behavior of other user_* properties and provides a consistent experience for tools that need to install binaries differently based on privilege level.

Closes #434

@gaborbernat gaborbernat requested a review from ofek as a code owner February 14, 2026 16:47
Applications that install system-wide executables need a standard location
that mirrors user_bin_dir. Currently, user_bin_dir provides ~/.local/bin
(Unix/macOS) or %LOCALAPPDATA%\Programs (Windows), but there's no
corresponding site-wide equivalent.

This creates API inconsistency since all other directory types (data,
config, cache, state, log, runtime) have both user and site variants.
Package managers like Chocolatey, pip, and uv need a consistent answer
for system-wide binary installation.

Add site_bin_dir following platform conventions:
- Unix/Linux: /usr/local/bin (per FHS 3.0 for locally-installed software)
- macOS: /usr/local/bin (standard Homebrew/user installation location)
- Windows: %ProgramData%\bin (consistent with site_data_dir pattern)
- Android: alias to user_bin_dir (no system-wide installation concept)

Also implement use_site_for_root support on Unix, allowing user_bin_dir
to redirect to site_bin_dir when running as root, matching the behavior
of other user_* properties.

Closes tox-dev#434
Add documentation for the new site_bin_dir property with platform-specific
paths and links to official standards (FHS 3.0 for Unix/Linux, Chocolatey
for Windows precedent).
@gaborbernat gaborbernat enabled auto-merge (squash) February 14, 2026 16:50
@gaborbernat gaborbernat merged commit 816747e into tox-dev:main Feb 14, 2026
29 checks passed
@gaborbernat gaborbernat deleted the 434 branch February 14, 2026 16:51
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.

Add site_bin_dir counterpart for user_bin_dir

1 participant