-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves #8 BREAKING CHANGE: Database initialization is no longer handled by init_db.py in the project root; instead, install the package and use the console script invenflask-init-db. BREAKING CHANGE: A development server can no longer be started by the invocation "flask app.py"; instead, install the package and use the invocation "flask --app invenflask.app run".
- Loading branch information
1 parent
58f2d5f
commit 4042326
Showing
17 changed files
with
75 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include src/invenflask/schema.sql | ||
include src/invenflask/templates/*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[project] | ||
name = "invenflask" | ||
version = "2.0.0" | ||
authors = [ | ||
{ name = "Daniel Rahamim" } | ||
] | ||
description = "A Flask-based asset checkin/checkout system" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
|
||
dependencies = [ | ||
"flask >=2.2.2, <3" | ||
] | ||
|
||
[project.scripts] | ||
invenflask-init-db = "invenflask.init_db:main" | ||
|
||
[project.urls] | ||
"Bug Tracker" = "https://github.com/drahamim/invenflask/issues" | ||
|
||
[build-system] | ||
requires = ["setuptools>=61.0"] | ||
build-backend = "setuptools.build_meta" |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import argparse | ||
from importlib.resources import files | ||
import sqlite3 | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
prog="invenflask-init-db", | ||
description="Initialize the database for an invenflask instance" | ||
) | ||
parser.add_argument( | ||
'--database', | ||
default="database.db", | ||
help="Database file to (re)initialize" | ||
) | ||
args = parser.parse_args() | ||
|
||
schema_sql = files("invenflask").joinpath("schema.sql").read_text() | ||
connection = sqlite3.connect(args.database) | ||
try: | ||
connection.executescript(schema_sql) | ||
connection.commit() | ||
finally: | ||
connection.close() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.