Skip to content

Commit 66e3b36

Browse files
adhami3310picklelo
andauthored
ruff (#1219)
Co-authored-by: Nikhil Rao <[email protected]>
1 parent 3d58272 commit 66e3b36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+511
-425
lines changed

alembic/env.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ def run_migrations_online() -> None:
6565
)
6666

6767
with connectable.connect() as connection:
68-
context.configure(
69-
connection=connection, target_metadata=target_metadata
70-
)
68+
context.configure(connection=connection, target_metadata=target_metadata)
7169

7270
with context.begin_transaction():
7371
context.run_migrations()

alembic/versions/0e2da5026c00_.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
11
"""empty message
22
33
Revision ID: 0e2da5026c00
4-
Revises:
4+
Revises:
55
Create Date: 2024-05-22 17:31:15.245402
66
77
"""
8+
89
from typing import Sequence, Union
910

1011
from alembic import op
1112
import sqlalchemy as sa
1213
import sqlmodel
1314

1415
# revision identifiers, used by Alembic.
15-
revision: str = '0e2da5026c00'
16+
revision: str = "0e2da5026c00"
1617
down_revision: Union[str, None] = None
1718
branch_labels: Union[str, Sequence[str], None] = None
1819
depends_on: Union[str, Sequence[str], None] = None
1920

2021

2122
def upgrade() -> None:
2223
# ### commands auto generated by Alembic - please adjust! ###
23-
op.create_table('customer',
24-
sa.Column('id', sa.Integer(), nullable=False),
25-
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
26-
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
27-
sa.Column('phone', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
28-
sa.Column('address', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
29-
sa.PrimaryKeyConstraint('id')
24+
op.create_table(
25+
"customer",
26+
sa.Column("id", sa.Integer(), nullable=False),
27+
sa.Column("name", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
28+
sa.Column("email", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
29+
sa.Column("phone", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
30+
sa.Column("address", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
31+
sa.PrimaryKeyConstraint("id"),
3032
)
31-
op.create_table('feedback',
32-
sa.Column('id', sa.Integer(), nullable=False),
33-
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
34-
sa.Column('feedback', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
35-
sa.Column('score', sa.Integer(), nullable=True),
36-
sa.Column('date_created', sa.DateTime(), nullable=False),
37-
sa.Column('page', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
38-
sa.PrimaryKeyConstraint('id')
33+
op.create_table(
34+
"feedback",
35+
sa.Column("id", sa.Integer(), nullable=False),
36+
sa.Column("email", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
37+
sa.Column("feedback", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
38+
sa.Column("score", sa.Integer(), nullable=True),
39+
sa.Column("date_created", sa.DateTime(), nullable=False),
40+
sa.Column("page", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
41+
sa.PrimaryKeyConstraint("id"),
3942
)
40-
op.create_table('waitlist',
41-
sa.Column('id', sa.Integer(), nullable=False),
42-
sa.Column('email', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
43-
sa.Column('date_created', sa.DateTime(), nullable=False),
44-
sa.PrimaryKeyConstraint('id')
43+
op.create_table(
44+
"waitlist",
45+
sa.Column("id", sa.Integer(), nullable=False),
46+
sa.Column("email", sqlmodel.sql.sqltypes.AutoString(), nullable=False),
47+
sa.Column("date_created", sa.DateTime(), nullable=False),
48+
sa.PrimaryKeyConstraint("id"),
4549
)
4650
# ### end Alembic commands ###
4751

@@ -58,9 +62,10 @@ def upgrade() -> None:
5862
('Hank Brown', '[email protected]', '012-345-6789', '707 Oak Street, Springfield');
5963
""")
6064

65+
6166
def downgrade() -> None:
6267
# ### commands auto generated by Alembic - please adjust! ###
63-
op.drop_table('waitlist')
64-
op.drop_table('feedback')
65-
op.drop_table('customer')
68+
op.drop_table("waitlist")
69+
op.drop_table("feedback")
70+
op.drop_table("customer")
6671
# ### end Alembic commands ###

pcweb/components/docpage/navbar/inkeep.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""UI and logic inkeep chat component."""
22

3-
from typing import List, Set
3+
from typing import List
44

55
import reflex as rx
66
from reflex.event import EventHandler

pcweb/components/docpage/navbar/navbar.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
styling,
88
custom_components as custom_c,
99
getting_started,
10-
hosting,
1110
)
1211
from pcweb.components.button import button
1312
from pcweb.pages.docs.library import library
@@ -19,14 +18,10 @@
1918
from .buttons.sidebar import navbar_sidebar_button
2019
from .search import search_bar
2120

22-
from pcweb.pages.docs import getting_started, hosting
2321
from pcweb.pages.faq import faq
24-
from pcweb.pages.pricing.pricing import pricing
2522
from pcweb.pages.errors import errors
26-
from pcweb.pages.docs.library import library
2723
from pcweb.pages.blog import blogs
2824
from pcweb.pages.changelog import changelog
29-
from pcweb.pages.gallery import gallery
3025
from pcweb.components.hosting_banner import hosting_banner
3126
from pcweb.pages.blog.paths import blog_data
3227

@@ -142,7 +137,7 @@ def blog_section() -> rx.Component:
142137
class_name="z-[2] flex flex-row justify-between px-[1.125rem] pb-[0.875rem] w-full",
143138
),
144139
rx.box(
145-
background_image=f'linear-gradient(to top, rgba(0, 0, 0, 3) 0%, rgba(0, 0, 0, 0) 35%), url({list(blog_data.values())[0].metadata["image"]})',
140+
background_image=f"linear-gradient(to top, rgba(0, 0, 0, 3) 0%, rgba(0, 0, 0, 0) 35%), url({list(blog_data.values())[0].metadata['image']})",
146141
class_name="group-hover:scale-105 absolute inset-0 bg-cover bg-no-repeat bg-center rounded-md transition-all duration-150 ease-out brightness-[0.8] group-hover:brightness-100",
147142
),
148143
href="/" + list(blog_data.keys())[0],
@@ -370,6 +365,7 @@ def new_component_section() -> rx.Component:
370365
),
371366
)
372367

368+
373369
@rx.memo
374370
def navbar() -> rx.Component:
375371
return rx.box(

pcweb/components/docpage/navbar/navmenu/navmenu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Reflex custom component NavMenu."""
22

33
import reflex as rx
4-
from typing import Any, Dict, List, Literal, Optional, Union
4+
from typing import Any, Dict, Literal
55
from reflex.vars import Var
66

77

pcweb/components/docpage/navbar/search.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import reflex as rx
44
from .inkeep import inkeep
55

6+
67
@rx.memo
78
def search_bar() -> rx.Component:
8-
return rx.box(inkeep(), class_name="w-full h-full min-w-0 max-w-[256px] max-h-[32px]")
9+
return rx.box(
10+
inkeep(), class_name="w-full h-full min-w-0 max-w-[256px] max-h-[32px]"
11+
)

pcweb/components/docpage/navbar/state.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
"""The state for the navbar component."""
2-
import os
32

43
import reflex as rx
54

pcweb/components/docpage/sidebar/sidebar.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import reflex_chakra as rc
77
from pcweb.components.docpage.navbar.state import NavbarState
88
from .state import SidebarState, SideBarItem, SideBarBase
9-
import reflex_chakra as rc
109

1110
from .sidebar_items.learn import learn, frontend, backend, hosting
1211
from .sidebar_items.component_lib import (
@@ -354,7 +353,9 @@ def sidebar_comp(
354353
"Learn", getting_started.introduction.path, "graduation-cap", 0
355354
),
356355
sidebar_category("Components", library.path, "layout-panel-left", 1),
357-
sidebar_category("Deploy", hosting_page.deploy_quick_start.path, "cloud", 2),
356+
sidebar_category(
357+
"Deploy", hosting_page.deploy_quick_start.path, "cloud", 2
358+
),
358359
sidebar_category("API Reference", pages[0].path, "book-text", 3),
359360
class_name="flex flex-col items-start gap-1 w-full list-none",
360361
),
@@ -378,7 +379,11 @@ def sidebar_comp(
378379
url,
379380
),
380381
create_sidebar_section(
381-
"State", state.overview.path, filter_out_non_sidebar_items(backend), backend_index, url
382+
"State",
383+
state.overview.path,
384+
filter_out_non_sidebar_items(backend),
385+
backend_index,
386+
url,
382387
),
383388
create_sidebar_section(
384389
"Recipes", overview.path, recipes, recipes_index, url
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .component_lib import get_component_link
1+
from .component_lib import get_component_link as get_component_link

pcweb/components/docpage/sidebar/sidebar_items/component_lib.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def get_category_children(category, category_list, prefix=""):
3838

3939
def get_sidebar_items_component_lib():
4040
from pcweb.pages.docs import component_list
41-
from pcweb.pages.docs.library import library
4241

4342
library_item_children = []
4443

@@ -61,9 +60,8 @@ def get_sidebar_items_graphings():
6160
)
6261
graphing_children.append(category_item)
6362

64-
return [
65-
*graphing_children
66-
]
63+
return [*graphing_children]
64+
6765

6866
component_lib = get_sidebar_items_component_lib()
6967
graphing_libs = get_sidebar_items_graphings()

0 commit comments

Comments
 (0)