File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/cookiecutter_python/hooks Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 11import re
22import sys
3+ from typing import Callable , Union
4+
5+
6+ is_python_package : Union [Callable [[str ], bool ], None ]
7+
38
49try :
510 from ask_pypi import is_pypi_project
11+ is_python_package = is_pypi_project
612except ImportError :
7- is_pypi_project = None
13+ is_python_package = None
814
915
1016# Templated Variables should be centralized here for easier inspection
@@ -36,9 +42,9 @@ def check_version_is_semver(version: str):
3642
3743
3844def available_package_name (package_name : str ) -> str :
39- if is_pypi_project :
45+ if is_python_package is not None :
4046 try :
41- return {True : 'not-available' , False : 'available' }[is_pypi_project (package_name )]
47+ return {True : 'not-available' , False : 'available' }[is_python_package (package_name )]
4248 except Exception as error : # ie network failure
4349 print (str (error ), file = sys .stderr )
4450 return 'unknown'
You can’t perform that action at this time.
0 commit comments