Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install Instructions - Fail to Run Black #69

Open
jvanderaa opened this issue Jan 19, 2024 · 2 comments
Open

Install Instructions - Fail to Run Black #69

jvanderaa opened this issue Jan 19, 2024 · 2 comments

Comments

@jvanderaa
Copy link
Contributor

Environment

  • Python version: 3.11
  • cookiecutter-nautobot-app template version: Develop

Observed Behavior

When tried to run black . it failed to run due to the poetry environment not being installed yet

Expected Behavior

Black to run

Steps to Reproduce

  1. Follow the install instructions
  2. Get to the part about black . and get the failure.
@mattmiller87
Copy link

Additionally, when black runs in the CI, it comes up with the following error:

Run poetry run invoke black
--- /home/runner/work/nautobot-codename-ratchet/nautobot-codename-ratchet/tasks.py	2024-03-18 14:47:27.750691+00:00
+++ /home/runner/work/nautobot-codename-ratchet/nautobot-codename-ratchet/tasks.py	2024-03-18 14:47:43.549659+00:00
@@ -517,13 +517,15 @@
would reformat /home/runner/work/nautobot-codename-ratchet/nautobot-codename-ratchet/tasks.py
         command += [
             "mysql --user root --***",
             '--execute="',
             f"DROP DATABASE IF EXISTS {db_name};",
             f"CREATE DATABASE {db_name};",
-            ""
-            if db_name == "$MYSQL_DATABASE"
-            else f"GRANT ALL PRIVILEGES ON {db_name}.* TO $MYSQL_USER; FLUSH PRIVILEGES;",
+            (
+                ""
+                if db_name == "$MYSQL_DATABASE"
+                else f"GRANT ALL PRIVILEGES ON {db_name}.* TO $MYSQL_USER; FLUSH PRIVILEGES;"
+            ),
             '"',
             "&&",
             "mysql",
             f"--database={db_name}",
             "--user=$MYSQL_USER",

Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.

When I try to correct for that error, it spirals out of control.

Run poetry run invoke black
  
--- /home/runner/work/nautobot-codename-ratchet/nautobot-codename-ratchet/tasks.py	2024-03-18 14:55:45.603081+00:00
+++ /home/runner/work/nautobot-codename-ratchet/nautobot-codename-ratchet/tasks.py	2024-03-18 14:56:01.983142+00:00
@@ -517,15 +517,17 @@
would reformat /home/runner/work/nautobot-codename-ratchet/nautobot-codename-ratchet/tasks.py
         command += [
             "mysql --user root --***",
             '--execute="',
             f"DROP DATABASE IF EXISTS {db_name};",
             f"CREATE DATABASE {db_name};",
+            (
                 (
                     ""
                     if db_name == "$MYSQL_DATABASE"
-                    else f"GRANT ALL PRIVILEGES ON {db_name}.* TO $MYSQL_USER; FLUSH PRIVILEGES;",
+                    else f"GRANT ALL PRIVILEGES ON {db_name}.* TO $MYSQL_USER; FLUSH PRIVILEGES;"
                 ),
+            ),
             '"',
             "&&",
             "mysql",
             f"--database={db_name}",
             "--user=$MYSQL_USER",
Oh no! 💥 💔 💥
1 file would be reformatted, 17 files would be left unchanged.

@glennmatthews
Copy link
Contributor

Can we close this issue given the move from black to ruff for formatting? (Though see #119).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants