-
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.
Merge pull request #12 from cite-reader/packaging
Makes the app an installable package
- Loading branch information
Showing
18 changed files
with
77 additions
and
23 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 |
---|---|---|
|
@@ -105,9 +105,10 @@ venv.bak/ | |
|
||
# code editor stuff | ||
.vscode | ||
.idea/ | ||
|
||
database.db | ||
|
||
.DS_Store | ||
|
||
config.toml | ||
config.toml |
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.