Skip to content

Conversation

@esafak
Copy link
Contributor

@esafak esafak commented Oct 9, 2025

  • Patch get_interpreter in src/virtualenv/discovery/builtin.py to handle missing cache and app_data arguments.
  • Add a new test case to tests/unit/discovery/test_discovery.py to ensure get_interpreter works without cache and app_data arguments.

Fixes #2972

  • 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 and others added 2 commits October 8, 2025 21:58
* Patch `get_interpreter` in `src/virtualenv/discovery/builtin.py` to handle
  missing `cache` and `app_data` arguments.
* Add a new test case to `tests/unit/discovery/test_discovery.py` to ensure `get_interpreter` works without `cache` and `app_data` arguments.

Signed-off-by: Emre Şafak <3928300+esafak@users.noreply.github.com>
:param env: the environment to use
:return: the interpreter if found, otherwise None
"""
if cache is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this make the extraction of the discovery not possible?

Copy link
Contributor Author

@esafak esafak Oct 9, 2025

Choose a reason for hiding this comment

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

Do you have a suggestion? We can sleep on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not on top of my mind, but perhaps is indicative that we cannot extract discovery?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could keep this for a breaking change requiring the cache. Maybe other users will have ideas.

Copy link
Contributor

@gaborbernat gaborbernat Oct 9, 2025

Choose a reason for hiding this comment

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

But if you don't have a good use case why introduce the breaking changes? We could revert this set of changes into a single commit and if anyone has good ideas to solve it in the future they can always revert our revert and we can cross that bridge at that point?

Sorry for bringing this up only now my bad I definitely should have realized earlier that this is a lot more breaking than I initially expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The use case was extraction of discovery in order to reduce the package's footprint, was it not?

Copy link
Contributor

Choose a reason for hiding this comment

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

The use case was extraction of discovery in order to reduce the package's footprint, was it not?

Not entirely, the goal was to allow other people use it without deepending on the heavier size of the virtualenv project. If we're not going to achieve that goal today the benefit of this separation significantly decreases too. Not to mention, originally was requested pipx, whose development now stalled due to poeple moving to uv tool.

@gaborbernat gaborbernat merged commit de1820d into pypa:main Oct 9, 2025
51 checks passed
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.

cache issue: virtualenv 20.35.0 breaks hatch 1.14.2

2 participants