Skip to content

✨ feat(config): add env_site_packages_dir_plat substitution#3784

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:feature/envsitepackagesdir-plat
Feb 20, 2026
Merged

✨ feat(config): add env_site_packages_dir_plat substitution#3784
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:feature/envsitepackagesdir-plat

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

@gaborbernat gaborbernat commented Feb 20, 2026

Since virtualenv 20.x, the lib64 directory is no longer symlinked to lib on Linux distributions like Fedora and RHEL (see virtualenv#1751). This means {env_site_packages_dir} (which returns purelib) doesn't cover the platform-specific lib64/pythonX.Y/site-packages path where compiled extensions live.

🔧 The new {env_site_packages_dir_plat} / {envsitepackagesdir_plat} substitution exposes the platlib path from virtualenv's Describe interface. On most platforms (macOS, Windows) this is identical to purelib, but on affected Linux distributions it correctly resolves to the lib64 directory. The base Python class provides a default implementation that returns purelib, so third-party runners like tox-uv continue to work without changes. The built-in VirtualEnv runner overrides it to return the actual platlib.

Closes #2302.

Expose the platform-specific site-packages directory (platlib) as a
substitution variable. On Fedora/RHEL where lib64 is no longer
symlinked to lib since virtualenv 20.x, this lets users reference
the correct path for compiled extensions.
@gaborbernat gaborbernat force-pushed the feature/envsitepackagesdir-plat branch from 4d68733 to e148fd8 Compare February 20, 2026 03:40
@gaborbernat gaborbernat enabled auto-merge (squash) February 20, 2026 03:41
@gaborbernat gaborbernat merged commit a8cc07f into tox-dev:main Feb 20, 2026
28 checks passed
@gaborbernat gaborbernat deleted the feature/envsitepackagesdir-plat branch February 20, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

{envsitepackagesdir} how to return lib64?

1 participant