|
| 1 | +3.0.4 (2026-06-09) |
| 2 | +================== |
| 3 | + |
| 4 | +Features & Improvements |
| 5 | +----------------------- |
| 6 | + |
| 7 | +- Add ``Finder(pyenv_only=True)`` to restrict discovery to pyenv-managed Python installations. `#3855 <https://github.com/sarugaku/pythonfinder/issues/3855>`_ |
| 8 | + |
| 9 | + |
| 10 | +Bug Fixes |
| 11 | +--------- |
| 12 | + |
| 13 | +- * Convert away from pydantic to reduce complexity; simplify the path manipulation logics to use pathlib. `#157 <https://github.com/sarugaku/pythonfinder/issues/157>`_ |
| 14 | + |
| 15 | +- Fix full-version matching for Python installations discovered via the Windows |
| 16 | + py launcher. |
| 17 | + |
| 18 | + ``py --list-paths`` only reports ``major.minor`` (e.g. ``3.11``), so |
| 19 | + ``PyLauncherFinder`` was storing ``patch=None`` for every entry. Callers that |
| 20 | + searched for a specific full version such as ``3.11.9`` (e.g. from |
| 21 | + ``python_full_version`` in a Pipfile) received no match because |
| 22 | + ``matches(patch=9)`` evaluated ``None == 9 → False``. |
| 23 | + |
| 24 | + The finder now queries each discovered executable for its real version string |
| 25 | + (e.g. ``3.11.9``) via ``get_python_version()`` after the py-launcher lookup, |
| 26 | + so that full-version searches succeed. If the executable cannot be queried the |
| 27 | + code falls back gracefully to the ``major.minor`` string reported by the py |
| 28 | + launcher. `#158 <https://github.com/sarugaku/pythonfinder/issues/158>`_ |
| 29 | + |
| 30 | +- Treat any ``Path.exists()`` ``OSError`` as an inaccessible path during discovery, allowing FUSE and network mount failures to be skipped cleanly. `#4898 <https://github.com/sarugaku/pythonfinder/issues/4898>`_ |
| 31 | + |
| 32 | +- Refactor pythonfinder for improved efficiency and PEP 514 support |
| 33 | + Summary |
| 34 | + |
| 35 | + This PR completely refactors the pythonfinder module to improve efficiency, reduce logical errors, and fix support for PEP 514 (Python registration in the Windows registry). The refactoring replaces the complex object hierarchy with a more modular, composition-based approach that is easier to maintain and extend. |
| 36 | + Motivation |
| 37 | + |
| 38 | + The original pythonfinder implementation had several issues: |
| 39 | + |
| 40 | + Complex object wrapping with paths as objects, leading to excessive recursion |
| 41 | + Tight coupling between classes making the code difficult to follow and maintain |
| 42 | + Broken Windows registry support (PEP 514) |
| 43 | + Performance issues due to redundant path scanning and inefficient caching |
| 44 | + |
| 45 | + Changes |
| 46 | + |
| 47 | + Architecture: Replaced inheritance-heavy design with a composition-based approach using specialized finders |
| 48 | + Data Model: Simplified the data model with a clean PythonInfo dataclass |
| 49 | + Windows Support: Implemented proper PEP 514 support for Windows registry |
| 50 | + Performance: Improved caching and reduced redundant operations |
| 51 | + Error Handling: Added more specific exceptions and better error handling |
| 52 | + |
| 53 | + Features |
| 54 | + |
| 55 | + The refactored implementation continues to support all required features: |
| 56 | + |
| 57 | + System and user PATH searches |
| 58 | + pyenv installations |
| 59 | + asdf installations |
| 60 | + Windows registry (PEP 514) - now working correctly |
| 61 | + |
| 62 | + Implementation Details |
| 63 | + |
| 64 | + The new implementation is organized into three main components: |
| 65 | + |
| 66 | + Finders: Specialized classes for finding Python in different locations |
| 67 | + SystemFinder: Searches in the system PATH |
| 68 | + PyenvFinder: Searches in pyenv installations |
| 69 | + AsdfFinder: Searches in asdf installations |
| 70 | + WindowsRegistryFinder: Implements PEP 514 for Windows registry |
| 71 | + |
| 72 | + Models: Simple data classes for storing Python information |
| 73 | + PythonInfo: Stores information about a Python installation |
| 74 | + |
| 75 | + Utils: Utility functions for path and version handling |
| 76 | + path_utils.py: Path-related utility functions |
| 77 | + version_utils.py: Version-related utility functions `#rewrite-3.0 <https://github.com/sarugaku/pythonfinder/issues/rewrite-3.0>`_ |
| 78 | + |
1 | 79 | 2.0.6 (2023-10-19) |
2 | 80 | ================== |
3 | 81 |
|
|
0 commit comments