generated from worldbank/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to ease usage and packaging
- Loading branch information
1 parent
49b7f2a
commit 01cecd1
Showing
30 changed files
with
977 additions
and
288 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
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 |
---|---|---|
|
@@ -104,4 +104,6 @@ db.env | |
space2stats_api/space2stats_env | ||
*.env | ||
cdk.out | ||
lambda_layer | ||
lambda_layer | ||
|
||
.benchmarks/ |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
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 @@ | ||
## space2stats |
Empty file.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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,51 @@ | ||
[project] | ||
name = "space2stats" | ||
description = "Space 2 Stats" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = {file = "LICENSE"} | ||
authors = [ | ||
{name = "Zac Deziel", email = "[email protected]"}, | ||
] | ||
dynamic = ["version"] | ||
dependencies = [ | ||
"fastapi>=0.112.0", | ||
"pandas", | ||
"shapely", | ||
"h3", | ||
"psycopg[binary]", | ||
"psycopg[pool]", | ||
"httpx", | ||
"geojson-pydantic", | ||
"shapely", | ||
"pydantic-settings>=2.0.0", | ||
"typing_extensions", | ||
] | ||
|
||
[project.optional-dependencies] | ||
test = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-postgresql", | ||
"httpx", | ||
] | ||
lambda = [ | ||
"mangum", | ||
] | ||
server = [ | ||
"uvicorn", | ||
] | ||
|
||
[tool.hatch.version] | ||
path = "space2stats/__init__.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
"/tests", | ||
".pytest_cache", | ||
".local_db.env", | ||
] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" |
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,5 @@ | ||
"""space2stats.""" | ||
|
||
from .main import fields, summaries # noqa | ||
|
||
__version__ = "0.1.0" |
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 @@ | ||
|
||
import os | ||
|
||
from .app import app | ||
|
||
try: | ||
import uvicorn # noqa | ||
|
||
except ImportError: # pragma: nocover | ||
uvicorn = None # type: ignore | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
assert uvicorn is not None, "uvicorn must be installed: `python -m pip install 'space2stats[server]'`" | ||
|
||
uvicorn.run( | ||
app=app, | ||
host=os.getenv("UVICORN_HOST", "127.0.0.1"), | ||
port=os.getenv("UVICORN_PORT", "8000"), | ||
root_path=os.getenv("UVICORN_ROOT_PATH", ""), | ||
log_level="info", | ||
) |
Oops, something went wrong.