Skip to content

Commit

Permalink
Formatting, gitignore, and poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Enkidu93 committed Oct 23, 2023
1 parent e205576 commit 8c65019
Show file tree
Hide file tree
Showing 6 changed files with 324 additions and 123 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ lib/
.vs
appsettings.user.json
artifacts

.db
25 changes: 19 additions & 6 deletions samples/ServalApp/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,41 @@
from sqlalchemy import Column, MetaData, String, Enum, create_engine
import enum


class State(enum.Enum):
Pending = 0
Active = 1
Completed = 2
Faulted = 3


metadata = MetaData()
Base = declarative_base(metadata=metadata)


class Build(Base):
__tablename__ = "builds"
build_id = Column("build_id",String,primary_key=True)
engine_id = Column("engine_id",String,primary_key=True)
email = Column("email",String)
state = Column("state",Enum(State))
corpus_id = Column("corpus_id",String)
build_id = Column("build_id", String, primary_key=True)
engine_id = Column("engine_id", String, primary_key=True)
email = Column("email", String)
state = Column("state", Enum(State))
corpus_id = Column("corpus_id", String)

def __str__(self):
return str({'build_id':self.build_id, 'engine_id':self.engine_id,'email':self.email,'state':self.state,'corpus_id':self.corpus_id})
return str(
{
"build_id": self.build_id,
"engine_id": self.engine_id,
"email": self.email,
"state": self.state,
"corpus_id": self.corpus_id,
}
)

def __repr__(self):
return self.__str__()


def clear_and_regenerate_tables():
engine = create_engine("sqlite:///builds.db")
metadata.drop_all(bind=engine)
Expand Down
18 changes: 18 additions & 0 deletions samples/ServalApp/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "servalapp"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.8,<3.9.7 || >3.9.7,<4.0"
email = "^4.0.2"
streamlit = "^1.27.2"
requests = "^2.31.0"
SQLAlchemy = "^2.0.22"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading

0 comments on commit 8c65019

Please sign in to comment.