Skip to content

Conversation

esafak
Copy link
Contributor

@esafak esafak commented Aug 11, 2025

This change decouples the discovery module from the main virtualenv module by duplicating utility functions from virtualenv.info into the virtualenv.discovery module.

  • A new virtualenv.discovery.info module was created with a copy of fs_is_case_sensitive, fs_path_id, and IS_WIN.
  • virtualenv.info is left unchanged to maintain its functionality for the core library.
  • The discovery-related files (py_info.py, builtin.py) now use their own private copy of these utilities from discovery.info.
  • The dependency of cached_py_info.py on virtualenv.util.subprocess was removed.
  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

esafak added 2 commits August 11, 2025 16:05
This change decouples the discovery module from the main virtualenv module by duplicating utility functions from `virtualenv.info` into the `virtualenv.discovery` module.

- A new `virtualenv.discovery.info` module was created with a copy of `fs_is_case_sensitive`, `fs_path_id`, and `IS_WIN`.
- `virtualenv.info` is left unchanged to maintain its functionality for the core library.
- The discovery-related files (`py_info.py`, `builtin.py`) now use their own private copy of these utilities from `discovery.info`.
- The dependency of `cached_py_info.py` on `virtualenv.util.subprocess` was removed.

This approach uses code duplication to achieve a clean separation, preparing the `discovery` module for extraction into its own package without creating a hard dependency from the core library.

Signed-off-by: Emre Şafak <[email protected]>
@gaborbernat gaborbernat enabled auto-merge (squash) August 11, 2025 20:29
@gaborbernat gaborbernat merged commit 1f4c76e into pypa:main Aug 11, 2025
45 checks passed
@esafak esafak deleted the refactor/decouple-discovery-with-duplication branch August 11, 2025 20:39
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