Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run = "ruff format"
depends = ["python:format"]
description = "Check for dead Python code"
run = """
vulture \
uvx vulture \
--min-confidence 80 \
--exclude '.flox,.venv,target' \
.
Expand All @@ -26,6 +26,7 @@ run = """
ruff check \
--output-format=github \
.
uvx ty check
"""

[tasks."python:test"]
Expand Down
7 changes: 3 additions & 4 deletions application/datamanager/src/datamanager/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@


class Polygon(BaseModel):
api_key: str = Field(default=os.getenv("POLYGON_API_KEY"))
api_key: str | None = Field(default=os.getenv("POLYGON_API_KEY"))
base_url: str = "https://api.polygon.io"
daily_bars: str = "/v2/aggs/grouped/locale/us/market/stocks/"


class Bucket(BaseModel):
name: str = Field(default=os.getenv("DATA_BUCKET"))
project: str = Field(default=os.getenv("GCP_PROJECT"))

@computed_field
def daily_bars_path(self) -> str:
if self.name is None:
raise ValueError("DATA_BUCKET environment variable is required")
return f"gs://{self.name}/equity/bars/"


Expand Down
6 changes: 3 additions & 3 deletions application/positionmanager/src/positionmanager/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
class AlpacaClient:
def __init__(
self,
api_key: str = "",
api_secret: str = "",
api_key: str | None = None,
api_secret: str | None = None,
paper: bool = True,
) -> None:
if not api_key or not api_secret:
Expand Down Expand Up @@ -54,7 +54,7 @@ def clear_positions(self) -> Dict[str, Any]:


class DataClient:
def __init__(self, datamanager_base_url: str):
def __init__(self, datamanager_base_url: str | None):
self.datamanager_base_url = datamanager_base_url
Comment thread
chrisaddy marked this conversation as resolved.

def get_data(
Expand Down
4 changes: 3 additions & 1 deletion infrastructure/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,7 @@
"pubsub-token-access",
project=PROJECT,
role="roles/pubsub.subscriber",
member=platform_service_account.email.apply(lambda e: f"serviceAccount:{e}"),
member=platform_service_account.email.apply(
lambda e: f"serviceAccount:{e}"
), # ty: ignore[missing-argument]
)
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ version = "0.1.0"
description = "Open source quantitative hedge fund 🍊"
requires-python = ">=3.12"
dependencies = [
"flytekit>=1.15.4",
"httpx>=0.28.1",
"pulumi-docker-build>=0.0.12",
"pulumi-gcp>=8.32.0",
]

[tool.uv.workspace]
Expand Down Expand Up @@ -61,3 +64,6 @@ skip_covered = true

[tool.coverage.xml]
output = ".python_coverage.xml"

[tool.ty.rules]
unresolved-import = "ignore"
10 changes: 9 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.