File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
src/cookiecutter_python/hooks Expand file tree Collapse file tree 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,10 @@ global-exclude *.py[cod] __pycache__ *.so *.dylib *.log
22
33include LICENSE
44include README.rst
5+ include CONTRIBUTING.md
56
6- recursive-include tests *.py
77recursive-include src *.py
8-
9- recursive-include docs *.rst
8+ recursive-include src *.pyi
109
1110recursive-include src *.in
1211recursive-include src *.json
@@ -15,5 +14,9 @@ recursive-include src *.toml
1514recursive-include src *.typed
1615recursive-include src *.yaml
1716recursive-include src *.txt
17+
18+ recursive-include tests *.py
1819recursive-include tests *.json
1920recursive-include tests *.txt
21+
22+ recursive-include docs *.rst
Original file line number Diff line number Diff line change @@ -86,13 +86,13 @@ typing =
8686
8787
8888[options.package_data]
89- cookiecutter_python_package =
89+ cookiecutter_python =
9090 py.typed
9191
9292
9393; [options.entry_points]
9494; console_scripts =
95- ; <executable_name> = cookiecutter_python_package .__main__:entrypoint
95+ ; <executable_name> = cookiecutter_python .__main__:entrypoint
9696
9797
9898# Influence what should be not flagged as an error, if not included in the distribution (ie sdist distribution)
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