-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v1.0.2 * fully switched to beanie * update pyproject.toml * versioning hatch scripts * commit message with release bump * OpenAPI metadata updates
- Loading branch information
1 parent
6fa2ea9
commit 67d2038
Showing
9 changed files
with
114 additions
and
126 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,38 @@ | ||
# updates the version number in the __about__.py file | ||
import subprocess | ||
|
||
|
||
def update_version(version_type): | ||
with open("src/api/__about__.py", "r") as f: | ||
version = f.read().split("=")[1].replace('"', "").strip() | ||
patch_version = version.split(".")[2] | ||
minor_version = version.split(".")[1] | ||
major_version = version.split(".")[0] | ||
if version_type == "major": | ||
major_version = str(int(major_version) + 1) | ||
minor_version = "0" | ||
patch_version = "0" | ||
elif version_type == "minor": | ||
minor_version = str(int(minor_version) + 1) | ||
patch_version = "0" | ||
elif version_type == "patch": | ||
patch_version = str(int(patch_version) + 1) | ||
else: | ||
raise ValueError("Invalid version type. Please use major, minor, or patch.") | ||
with open("src/api/__about__.py", "w") as f: | ||
new_version = f"{major_version}.{minor_version}.{patch_version}" | ||
f.write(f'__version__ = "{new_version}"\n') | ||
return f"v{new_version}" | ||
|
||
|
||
# passes the command line argument to the function | ||
if __name__ == "__main__": | ||
import sys | ||
|
||
new_version = update_version(sys.argv[1]) | ||
message = input(f"Version updated to {new_version}. Enter commit message: \n") | ||
subprocess.run(["git", "add", "."]) | ||
subprocess.run(["git", "commit", "-m", message.strip()]) | ||
subprocess.run(["git", "push"]) | ||
subprocess.run(["git", "tag", "-a", new_version, "-m", message.strip()]) | ||
subprocess.run(["git", "push", "origin", new_version]) |
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 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.0.1" | ||
__version__ = "1.0.4" |
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 |
---|---|---|
|
@@ -6,20 +6,36 @@ | |
load_dotenv(os.path.join(os.getcwd(), ".env")) | ||
|
||
from beanie import init_beanie | ||
from core.models.shoes import Sneaker | ||
from fastapi import FastAPI | ||
from mangum import Mangum | ||
from starlette.middleware.sessions import SessionMiddleware | ||
|
||
from api.data.instance import DATABASE_NAME, client | ||
from api.routes import auth, sneakers | ||
from core.models.shoes import Sneaker | ||
|
||
desc = """ | ||
# SoleSearch | ||
## The sneaker reseller's Bloomberg Terminal | ||
### 👟 Find product information, from every brand, fast. | ||
### 📅 Never miss another release date. | ||
### 💵 Never buy bricks. Stay ahead of the game with our comprehensive price history and trends. | ||
""" | ||
|
||
app = FastAPI( | ||
redoc_url=None, | ||
title="SoleSearch", | ||
summary="The sneaker reseller's Bloomberg Terminal.", | ||
version=api.__about__.__version__, | ||
contact={ | ||
"name": "SoleSearch Developer Support", | ||
"email": "[email protected]" | ||
}, | ||
description=desc, | ||
responses={404: {"description": "Not found"}}, | ||
) | ||
|
||
app.add_middleware(SessionMiddleware, secret_key="some secret key here") | ||
app.add_middleware(SessionMiddleware, secret_key="vT!y!r5s#bwcDxDG") | ||
|
||
|
||
@app.on_event("startup") | ||
|
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
Empty file.
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