Fix database_setup and main lint smells.
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
"""
|
||||
Small script to create the database if it doesn't already exist.
|
||||
"""
|
||||
"""Small script to create the database if it doesn't already exist."""
|
||||
|
||||
import sqlite3
|
||||
from os.path import exists
|
||||
from pathlib import Path
|
||||
|
||||
if not exists("database/dakiny.db"):
|
||||
if not Path("database/dakiny.db").exists():
|
||||
with sqlite3.connect("database/dakiny.db") as con:
|
||||
cur = con.cursor()
|
||||
|
||||
with open("database_setup/database.sql", encoding="utf-8") as file:
|
||||
with Path("database_setup/database.sql", encoding="utf-8").open() as file:
|
||||
database_script = file.read()
|
||||
cur.executescript(database_script)
|
||||
con.commit()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
[tool.ruff]
|
||||
# Extend the `pyproject.toml` file in the parent directory...
|
||||
extend = "../pyproject.toml"
|
||||
|
||||
[tool.ruff.lint]
|
||||
# ignore implicit-namespace-package in this directory.
|
||||
ignore = ["INP001"]
|
||||
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
Simple file to set up the sqlalchemy connection to database.
|
||||
"""
|
||||
"""Simple file to set up the sqlalchemy connection to database."""
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.ext.automap import automap_base
|
||||
|
||||
Reference in New Issue
Block a user