|
10 | 10 | from jinja2.ext import Extension |
11 | 11 | from rich.text import Text |
12 | 12 |
|
13 | | -from sprout import GitDefaultsExtension, Question, Style, validate_repository_url, |
| 13 | +from sprout import GitDefaultsExtension, Question, Style, validate_repository_url |
14 | 14 | from sprout.cli import render_templates |
15 | 15 | from sprout.prompt import console |
16 | 16 |
|
@@ -48,16 +48,24 @@ def should_skip(relative_path: Path, answers: dict[str, Any]) -> bool: |
48 | 48 |
|
49 | 49 | if as_posix == "LICENSE.jinja" and answers.get("copyright_license") == "None": |
50 | 50 | return True |
51 | | - if as_posix == ".github/workflows/tests.yml.jinja" and "tests" not in github_actions: |
| 51 | + if ( |
| 52 | + as_posix == ".github/workflows/tests.yml.jinja" |
| 53 | + and "tests" not in github_actions |
| 54 | + ): |
52 | 55 | return True |
53 | 56 | if as_posix == ".github/workflows/lint.yml.jinja" and "lint" not in github_actions: |
54 | 57 | return True |
55 | | - if as_posix == ".github/workflows/publish.yml.jinja" and "publish" not in github_actions: |
| 58 | + if ( |
| 59 | + as_posix == ".github/workflows/publish.yml.jinja" |
| 60 | + and "publish" not in github_actions |
| 61 | + ): |
56 | 62 | return True |
57 | 63 | return False |
58 | 64 |
|
59 | 65 |
|
60 | | -def validate_package_name(value: str, answers: dict[str, Any]) -> tuple[bool, str | None]: |
| 66 | +def validate_package_name( |
| 67 | + value: str, answers: dict[str, Any] |
| 68 | +) -> tuple[bool, str | None]: |
61 | 69 | name = value.strip() |
62 | 70 | if not name: |
63 | 71 | return False, "Package name is required." |
@@ -86,9 +94,15 @@ def validate_versions(value: str, answers: dict[str, Any]) -> tuple[bool, str | |
86 | 94 | if not required.issubset(answers): |
87 | 95 | return True, None |
88 | 96 |
|
89 | | - min_version = tuple(int(part) for part in str(answers["python_min_version"]).split(".")) |
90 | | - max_version = tuple(int(part) for part in str(answers["python_max_version"]).split(".")) |
91 | | - default_version = tuple(int(part) for part in str(answers["python_default_version"]).split(".")) |
| 97 | + min_version = tuple( |
| 98 | + int(part) for part in str(answers["python_min_version"]).split(".") |
| 99 | + ) |
| 100 | + max_version = tuple( |
| 101 | + int(part) for part in str(answers["python_max_version"]).split(".") |
| 102 | + ) |
| 103 | + default_version = tuple( |
| 104 | + int(part) for part in str(answers["python_default_version"]).split(".") |
| 105 | + ) |
92 | 106 |
|
93 | 107 | if min_version > max_version: |
94 | 108 | return ( |
|
0 commit comments