Skip to content

Commit 642642a

Browse files
authored
Overhaul pythonfinder (#135)
* Overhaul pythonfinder to use pydantic and eliminate the WindowsFinder code paths; remove attrs library. * add missing file * Corrected imports * addressing build error * address import issue with tests * address import issue with tests * Try casting to Path in test * Try casting to PythonFinder in test * remove not necessary validator that may be causing test failures. * Refactor imports based on pydantic bug report. * apply simiilar fix to this test * remove nonexistent method. * Remove unused class * iterate on last two tests * factor tests away from importlib * Assertion was checking that it mocked itself. * Remove confusing and bad test cases * PR feedback
1 parent d1f4a91 commit 642642a

20 files changed

+673
-1727
lines changed

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ package_data =
3737
LICENSE*
3838
README*
3939
install_requires =
40-
attrs
4140
cached-property
4241
packaging>=22.0
42+
pydantic>=1.10.7
4343

4444
[options.packages.find]
4545
where = src
@@ -113,7 +113,7 @@ skip = src/pythonfinder/_vendor
113113
line_length = 90
114114
indent = ' '
115115
multi_line_output = 3
116-
known_third_party = attr,cached_property,click,invoke,packaging,parver,pytest,requests,setuptools,six,towncrier
116+
known_third_party = cached_property,click,invoke,packaging,parver,pydantic,pytest,requests,setuptools,six,towncrier
117117
known_first_party = pythonfinder,tests
118118
combine_as_imports=True
119119
include_trailing_comma = True

src/pythonfinder/__init__.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
1-
# Add NullHandler to "pythonfinder" logger, because Python2's default root
2-
# logger has no handler and warnings like this would be reported:
3-
#
4-
# > No handlers could be found for logger "pythonfinder.models.pyenv"
5-
from __future__ import annotations
6-
7-
import logging
8-
91
from .exceptions import InvalidPythonVersion
10-
from .models import SystemPath, WindowsFinder
2+
from .models import SystemPath
113
from .pythonfinder import Finder
124

135
__version__ = "1.3.3.dev0"
146

157

16-
logger = logging.getLogger(__name__)
17-
logger.addHandler(logging.NullHandler())
18-
19-
__all__ = ["Finder", "WindowsFinder", "SystemPath", "InvalidPythonVersion"]
8+
__all__ = ["Finder", "SystemPath", "InvalidPythonVersion"]

src/pythonfinder/_vendor/pep514tools/LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/pythonfinder/_vendor/pep514tools/__init__.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/pythonfinder/_vendor/pep514tools/__main__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/pythonfinder/_vendor/pep514tools/_registry.py

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)