diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ad1c29d8..ffcbd843 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -284,6 +284,10 @@ def set_flag(file_path, flag, value=None, formatted=None, *args, **kwargs): if value is None: random_string = generate_random_string(*args, **kwargs) if random_string is None: + print( + "We couldn't find a secure pseudo-random number generator on your " + f"system. Please, make sure to manually {flag} later.", + ) random_string = flag if formatted is not None: random_string = formatted.format(random_string) @@ -451,7 +455,11 @@ def main(): # noqa: C901, PLR0912, PLR0915 if "{{ cookiecutter.use_docker }}".lower() == "n" and "{{ cookiecutter.use_heroku }}".lower() == "n": if "{{ cookiecutter.keep_local_envs_in_vcs }}".lower() == "y": - pass + print( + INFO + ".env(s) are only utilized when Docker Compose and/or " + "Heroku support is enabled so keeping them does not make sense " + "given your current setup." + TERMINATOR, + ) remove_envs_and_associated_files() else: append_to_gitignore_file(".env") @@ -475,7 +483,10 @@ def main(): # noqa: C901, PLR0912, PLR0915 ) if "{{ cookiecutter.cloud_provider }}" == "None" and "{{ cookiecutter.use_docker }}".lower() == "n": # noqa: PLR0133 - pass + print( + WARNING + "You chose to not use any cloud providers nor Docker, " + "media files won't be served in production." + TERMINATOR, + ) if "{{ cookiecutter.use_celery }}".lower() == "n": remove_celery_files() @@ -500,6 +511,8 @@ def main(): # noqa: C901, PLR0912, PLR0915 if "{{ cookiecutter.use_async }}".lower() == "n": remove_async_files() + print(SUCCESS + "Project initialized, keep up the good work!" + TERMINATOR) + if __name__ == "__main__": main() diff --git a/hooks/pre_gen_project.py b/hooks/pre_gen_project.py index 0ab357de..1c8b7389 100644 --- a/hooks/pre_gen_project.py +++ b/hooks/pre_gen_project.py @@ -23,7 +23,9 @@ assert project_slug == project_slug.lower(), f"'{project_slug}' project slug sho assert "\\" not in "{{ cookiecutter.author_name }}", "Don't include backslashes in author name." # noqa: PLR0133 if "{{ cookiecutter.use_whitenoise }}".lower() == "n" and "{{ cookiecutter.cloud_provider }}" == "None": # noqa: PLR0133 + print("You should either use Whitenoise or select a Cloud Provider to serve static files") sys.exit(1) if "{{ cookiecutter.mail_service }}" == "Amazon SES" and "{{ cookiecutter.cloud_provider }}" != "AWS": # noqa: PLR0133 + print("You should either use AWS or select a different Mail Service for sending emails.") sys.exit(1) diff --git a/pyproject.toml b/pyproject.toml index fe6fcca9..8c7b2f5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,7 +111,6 @@ lint.select = [ "SLF", "SLOT", "T10", - "T20", "TCH", "TID", "TRY",