Skip to content

Latest commit

 

History

History
453 lines (265 loc) · 14.6 KB

File metadata and controls

453 lines (265 loc) · 14.6 KB

3.0.4 (2026-06-09)

Features & Improvements

  • Add Finder(pyenv_only=True) to restrict discovery to pyenv-managed Python installations. #3855

Bug Fixes

    • Convert away from pydantic to reduce complexity; simplify the path manipulation logics to use pathlib. #157
  • Fix full-version matching for Python installations discovered via the Windows py launcher.

    py --list-paths only reports major.minor (e.g. 3.11), so PyLauncherFinder was storing patch=None for every entry. Callers that searched for a specific full version such as 3.11.9 (e.g. from python_full_version in a Pipfile) received no match because matches(patch=9) evaluated None == 9 → False.

    The finder now queries each discovered executable for its real version string (e.g. 3.11.9) via get_python_version() after the py-launcher lookup, so that full-version searches succeed. If the executable cannot be queried the code falls back gracefully to the major.minor string reported by the py launcher. #158

  • Treat any Path.exists() OSError as an inaccessible path during discovery, allowing FUSE and network mount failures to be skipped cleanly. #4898

  • Refactor pythonfinder for improved efficiency and PEP 514 support Summary

    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. Motivation

    The original pythonfinder implementation had several issues:

    Complex object wrapping with paths as objects, leading to excessive recursion Tight coupling between classes making the code difficult to follow and maintain Broken Windows registry support (PEP 514) Performance issues due to redundant path scanning and inefficient caching

    Changes

    Architecture: Replaced inheritance-heavy design with a composition-based approach using specialized finders Data Model: Simplified the data model with a clean PythonInfo dataclass Windows Support: Implemented proper PEP 514 support for Windows registry Performance: Improved caching and reduced redundant operations Error Handling: Added more specific exceptions and better error handling

    Features

    The refactored implementation continues to support all required features:

    System and user PATH searches pyenv installations asdf installations Windows registry (PEP 514) - now working correctly

    Implementation Details

    The new implementation is organized into three main components:

    Finders: Specialized classes for finding Python in different locations

    SystemFinder: Searches in the system PATH PyenvFinder: Searches in pyenv installations AsdfFinder: Searches in asdf installations WindowsRegistryFinder: Implements PEP 514 for Windows registry

    Models: Simple data classes for storing Python information

    PythonInfo: Stores information about a Python installation

    Utils: Utility functions for path and version handling

    path_utils.py: Path-related utility functions version_utils.py: Version-related utility functions #rewrite-3.0

2.0.6 (2023-10-19)

No significant changes.

2.0.5 (2023-07-23)

No significant changes.

2.0.4 (2023-05-31)

No significant changes.

2.0.3 (2023-05-19)

Bug Fixes

  • Fix edge case from refactor to pydantic -- only search for any python version when a specific version was not requested. #139

2.0.2 (2023-05-19)

Bug Fixes

  • Fix edge case with windows git bash and environment variables having backslash. #138

2.0.1 (2023-05-16)

Bug Fixes

  • Corrected asdf and pyenv detection and usage which broke with the release of pythonfinder==2.0.0 #137

2.0.0 (2023-05-06)

Bug Fixes

  • Include tests and tests data into the sdist. #116

1.3.2 (2023-02-06)

Bug Fixes

  • Include tests and tests data into the sdist. #116
  • Fix: catch InvalidVersion instead of handling LegacyVersion #127

1.3.0 (2022-24-08)

Bug fixes

  • Fix permissions on WSL
  • Include tests and tests data into the sdist Close #116

Updates

  • Make click optional dependency
  • Remove six
  • Drop Python2 Support

1.2.10 (2022-02-19)

Bug Fixes

  • Check the permission as well as the existence of path when finding Pythons. #111
  • Fix an error of pythonfinder when PATH contains unreadable paths. #118

1.2.9 (2021-11-08)

Bug Fixes

  • Fix a bug that the version matcher ignores the version when patch number is 0. #110

1.2.8 (2021-07-27)

Bug Fixes

  • Ensure the path exists when initializing from the PATH env var. #105

1.2.7 (2021-06-24)

No significant changes.

1.2.6 (2021-04-01)

Removals and Deprecations

  • Remove the deprecated usage of cmp in attr. #94
  • Fix a bug that version sort is performed on None objects.

1.2.5 (2020-08-27)

Bug Fixes

  • Skip invalid entries from Windows registry. Ensure paths are normalized with forward slashes. #89

1.2.4 (2020-06-01)

Bug Fixes

  • Filter out the None results of Windows python finder. #87

1.2.3 (2020-04-21)

Bug Fixes

  • Unnest the mixed output from find_all_python_versions(). #85

1.2.2 (2020-03-25)

Features & Improvements

  • Non-core versions of python will no longer sort ahead of core python versions. #75
  • Reduced dependencies by removing vistir,, crayons and intermediate calls. #78

Bug Fixes

  • Fixed a bug which could cause python searches to fail when pyenv global was set with repeated identical versions. #71
  • pythonfinder will now avoid accidentally pathing into pythonw.exe on windows and using it as a python version. #73

1.2.1 (2019-05-13)

Features & Improvements

  • Added support for subprocess timeouts while discovering python paths. #62

1.2.0 (2019-03-02)

Features & Improvements

  • Dramatically improved performance and stability. #51
  • Added typehints and refactored mixins, updated shims to only attempt to remove themselves if they detect their respectve installations (fixes Hynek's issue). #52

Bug Fixes

  • Add resilient parsing to look only for major.minor(.patch)? as a fallback parser and allow more graceful continuation if a path is not a real path to python. #40
  • Added typehints and refactored mixins, updated shims to only attempt to remove themselves if they detect their respectve installations (fixes Hynek's issue). #52
  • Fixed a bug which prevented parsing of numeric versions as inputs to pythonfinder. #59
  • Windows path discovery now works correctly and does not attempt to assign cached properties. #61

1.1.10 (2018-11-22)

Bug Fixes

  • Fix a bug where version in version order file may not in global version paths #37
  • Added further resilient version parser functionality to python version parser. #44
  • Fixed an issue which prevented parsing single digit python versions as valid. #47

1.1.9 (2018-11-13)

Features & Improvements

  • Added performance enhancements and error handling to python search algorithms.
  • Added support for asdf installations via the ASDF_DATA_DIR environment variable. #35

1.1.8 (2018-11-12)

Bug Fixes

  • Fix a bug where pyenv cannot be found when PYENV_ROOT is not set #29
  • Fix a bug where pyenv python location is not properly got by sysconfig._get_default_scheme #31
  • Fix finding pyenv's python versions issue when pyenv root version is not present #33

1.1.7 (2018-11-04)

Features & Improvements

  • Pyenv paths will now be ordered respecting global version settings and pyenv shims will be removed from the search path. #27

Bug Fixes

  • Fixed an issue with unnesting paths when finding python versions. #24
  • Fixed a bug with searching windows registry entries which sometimes caused errors for uninstalled python instances. #26

1.1.6 (2018-10-26)

No significant changes.

1.1.5 (2018-10-25)

Bug Fixes

  • Fixed an issue with parsing python paths. #52

1.1.4 (2018-10-25)

Bug Fixes

  • Fixed a broken call to vistir.misc.run which returned a subprocess.Popen object instead of its output. #22

1.1.3 (2018-10-18)

Features & Improvements

  • Introduced lookup by name when searching for python versions, which allows searching for non-standard python releases such as anaconda3-5.3.0. #20
  • General improvements:
    • Improved pyenv support and architecture lookup support.
    • Improved overall performance and caching. #21

Bug Fixes

  • Switch to using --ignore-unsupported by default during lookups. #19

1.1.2 (2018-10-12)

Features & Improvements

  • Added support for non-CPython interpreters. #16

Bug Fixes

  • Added support for ignoring unsupported python versions during version search with the flag --ignore-unsupported. #14
  • Added support for pyenv virtualenvs. #15

1.1.1 (2018-10-11)

Bug Fixes

  • Fixed an issue which prevented graceful parsing of debug releases of python, which will now be sorted the same as prereleases. #12

1.1.0 (2018-10-06)

Bug Fixes

  • Fixed a bug which caused inadvertent inclusion of previously removed python installations on windows. #11

1.0.2 (2018-08-15)

Bug Fixes

  • Fix a bug which caused failures when parsing patch releases. #10

1.0.1 (2018-07-31)

Bug Fixes

  • Fix input string parser when architecture is specified. #9

1.0.0 (2018-07-25)

Features & Improvements

  • Add support for explicitly searching the global pythonpath using the global_search argument at initialization. #4
  • Allow bare calls to find_all_python_versions() to return all python versions without specifying a major version. #5
  • Added efficient crawling and caching when searching for python and other executables.
    • Carry architecture support all the way through the search stack to only return available python which matches the desired architecture.
    • Improve sub-path consolidations for searching for executables and pythons.
    • Use lazy loading of python versions to avoid unnecessary subprocess calls. #8

Bug Fixes

  • Fixed a bug which caused version checks on older python versions to fail due to encoding issues. #3
  • Prevent use of VIRTUAL_ENV as a search location when global_search is False. #4
  • Fixed an issue which sometimes caused pythonfinder to prefer prerelease versions. #7