Skip to content

Commit d5a5c75

Browse files
committed
Merge branch 'dev'
2 parents 4b84d0c + 4db11f7 commit d5a5c75

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

MANIFEST.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ global-exclude *.py[cod] __pycache__ *.so *.dylib *.log
22

33
include LICENSE
44
include README.rst
5+
include CONTRIBUTING.md
56

6-
recursive-include tests *.py
77
recursive-include src *.py
8-
9-
recursive-include docs *.rst
8+
recursive-include src *.pyi
109

1110
recursive-include src *.in
1211
recursive-include src *.json
@@ -15,5 +14,9 @@ recursive-include src *.toml
1514
recursive-include src *.typed
1615
recursive-include src *.yaml
1716
recursive-include src *.txt
17+
18+
recursive-include tests *.py
1819
recursive-include tests *.json
1920
recursive-include tests *.txt
21+
22+
recursive-include docs *.rst

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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)

src/cookiecutter_python/hooks/pre_gen_project.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import re
22
import sys
3+
from typing import Callable, Union
4+
5+
6+
is_python_package: Union[Callable[[str], bool], None]
7+
38

49
try:
510
from ask_pypi import is_pypi_project
11+
is_python_package = is_pypi_project
612
except 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

3844
def 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'

0 commit comments

Comments
 (0)