From 194c1d457da48ef4e8d3e1fd6fad2df9f5e69630 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sat, 9 Aug 2025 14:23:29 -0300 Subject: [PATCH 1/3] rm setup --- setup.py | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 4d7fd57a..00000000 --- a/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name="routstr", - version="0.1.0", - packages=find_packages(), - install_requires=[ - "fastapi[standard]>=0.115", - "aiosqlite>=0.20", - "sqlmodel>=0.0.24", - "httpx[socks]>=0.25.2", - "greenlet>=3.2.1", - "python-json-logger>=2.0.0", - "cashu", - "secp256k1", - "marshmallow>=3.13,<4.0", - ], - python_requires=">=3.11", -) \ No newline at end of file From 1cfa8cbee4b8919a065a14386ead676eb80ada8c Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sat, 9 Aug 2025 14:28:41 -0300 Subject: [PATCH 2/3] only run if not there yet --- migrations/versions/f6ce1348e266_init.py | 33 +++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/migrations/versions/f6ce1348e266_init.py b/migrations/versions/f6ce1348e266_init.py index 479676c5..80222218 100644 --- a/migrations/versions/f6ce1348e266_init.py +++ b/migrations/versions/f6ce1348e266_init.py @@ -17,21 +17,24 @@ depends_on = None def upgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.create_table( - "api_keys", - sa.Column("hashed_key", sqlm.sql.sqltypes.AutoString(), nullable=False), - sa.Column("balance", sa.Integer(), nullable=False), - sa.Column("refund_address", sqlm.sql.sqltypes.AutoString(), nullable=True), - sa.Column("key_expiry_time", sa.Integer(), nullable=True), - sa.Column("total_spent", sa.Integer(), nullable=False), - sa.Column("total_requests", sa.Integer(), nullable=False), - sa.PrimaryKeyConstraint("hashed_key"), - ) - # ### end Alembic commands ### + if "api_keys" not in sa.inspect(op.get_bind()).get_table_names(): + op.create_table( + "api_keys", + sa.Column("hashed_key", sqlm.sql.sqltypes.AutoString(), nullable=False), + sa.Column("balance", sa.Integer(), nullable=False), + sa.Column("refund_address", sqlm.sql.sqltypes.AutoString(), nullable=True), + sa.Column("key_expiry_time", sa.Integer(), nullable=True), + sa.Column("total_spent", sa.Integer(), nullable=False), + sa.Column("total_requests", sa.Integer(), nullable=False), + sa.PrimaryKeyConstraint("hashed_key"), + ) def downgrade() -> None: - # ### commands auto generated by Alembic - please adjust! ### - op.drop_table("api_keys") - # ### end Alembic commands ### + # Only drop the table if it exists + conn = op.get_bind() + inspector = sa.inspect(conn) + tables = inspector.get_table_names() + + if "api_keys" in tables: + op.drop_table("api_keys") From 88a0a412014d7756b9030d7a50ae35112200d8b2 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sat, 9 Aug 2025 14:57:55 -0300 Subject: [PATCH 3/3] fix --- setup.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 setup.py diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..c6f07fec --- /dev/null +++ b/setup.py @@ -0,0 +1,19 @@ +from setuptools import find_packages, setup + +setup( + name="routstr", + version="0.1.0", + packages=find_packages(), + install_requires=[ + "fastapi[standard]>=0.115", + "aiosqlite>=0.20", + "sqlmodel>=0.0.24", + "httpx[socks]>=0.25.2", + "greenlet>=3.2.1", + "python-json-logger>=2.0.0", + "cashu", + "secp256k1", + "marshmallow>=3.13,<4.0", + ], + python_requires=">=3.11", +)