From c28b79a4c5abe0382f156817db1aae7ab0b722a8 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Thu, 10 Apr 2025 00:00:32 -0400 Subject: [PATCH 01/29] dockerize haskell --- .mise.toml | 25 +++++++++++++++++++++++++ platform/Dockerfile | 21 +++++++++++++++++++++ platform/compose.yaml | 10 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 platform/Dockerfile create mode 100644 platform/compose.yaml diff --git a/.mise.toml b/.mise.toml index c674f42ae..256607736 100644 --- a/.mise.toml +++ b/.mise.toml @@ -24,5 +24,30 @@ run = "uvx ruff format" depends = ["python:check", "python:dead-code", "python:format"] description="run python code quality checks across the full repository" +[tasks."platform:run"] +description = "run platform in docker compose" +run = "cd platform && docker compose up" +[tasks."platform:build"] +description = "build platform image to dockerhub" +run = """ +TIMESTAMP=$(date +%Y%m%d) +cd platform +docker build -t pocketsizefund/platform:latest \ + -t pocketsizefund/platform:${TIMESTAMP} \ + . +""" + +[tasks."platform:push"] +description = "push platform image to dockerhub" +depends = ["platform:build"] +run = """ +TIMESTAMP=$(date +%Y%m%d) +cd platform +docker push pocketsizefund/platform:latest +docker push pocketsizefund/platform:${TIMESTAMP} +""" +[tasks."infrastructure:up"] +description = "launch infrastructure" +run = "cd infrastructure && uv run pulumi up" diff --git a/platform/Dockerfile b/platform/Dockerfile new file mode 100644 index 000000000..30952d320 --- /dev/null +++ b/platform/Dockerfile @@ -0,0 +1,21 @@ +FROM haskell:9.8.4 AS builder + +WORKDIR /app + +RUN mkdir -p src app test && touch README.md + +COPY stack.yaml stack.yaml.lock package.yaml ./ +RUN stack setup && stack build --only-dependencies + +COPY . . + +RUN stack build +RUN cp "$(stack path --local-install-root)/bin/platform-exe" /app/platform-exe + +FROM debian:bullseye-slim AS production + +RUN apt-get update && apt-get install -y libgmp10 ca-certificates && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /app/platform-exe /usr/local/bin/app + +ENTRYPOINT ["/usr/local/bin/app"] diff --git a/platform/compose.yaml b/platform/compose.yaml new file mode 100644 index 000000000..1f8fbe5db --- /dev/null +++ b/platform/compose.yaml @@ -0,0 +1,10 @@ +services: + platform: + build: + context: . + dockerfile: Dockerfile + platform: linux/amd64 + container_name: platform + ports: + - "8080:8080" + restart: unless-stopped From 5e9ede32df202120f99346e0faa18a05f3b66ade Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Mon, 14 Apr 2025 21:24:38 -0400 Subject: [PATCH 02/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..7530e875b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pocketsize.fund \ No newline at end of file From dd27753df697bd68c11f47818a4641abfd53aba2 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Mon, 14 Apr 2025 22:23:25 -0400 Subject: [PATCH 03/29] Add stale check GitHub Action --- .github/workflows/stale.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/stale.yaml diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 000000000..b5db8b9ce --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,20 @@ +name: Close stale issues and pull requests +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + stale-issue-message: 'Marked stale due to inactivity. Remove stale label or comment or this will be closed.' + stale-pr-message: 'Marked stale due to inactivity. Remove stale label or comment or this will be closed.' + stale-issue-label: stale + stale-pr-label: stale + close-issue-message: 'Closed due to inactivity.' + close-pr-message: 'Closed due to inactivity.' + days-before-stale: 7 + days-before-close: 7 + exempt-draft-pr: true From 5248b476947fb45361f393d3f4846d559d6ccf38 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Thu, 10 Apr 2025 13:49:25 -0400 Subject: [PATCH 04/29] pulumi for infra --- .flox/env/manifest.lock | 398 +++++++++++++++++++++++++------- .flox/env/manifest.toml | 2 + .gitignore | 45 ++++ .mise.toml | 4 +- infrastructure/Pulumi.prod.yaml | 19 ++ infrastructure/Pulumi.yaml | 3 + infrastructure/__main__.py | 2 + infrastructure/cloud_run.py | 62 +++++ infrastructure/project.py | 24 ++ infrastructure/pyproject.toml | 8 + infrastructure/topics.py | 3 + pyproject.toml | 10 + uv.lock | 201 ++++++++++++++++ 13 files changed, 700 insertions(+), 81 deletions(-) create mode 100644 infrastructure/Pulumi.prod.yaml create mode 100644 infrastructure/Pulumi.yaml create mode 100644 infrastructure/__main__.py create mode 100644 infrastructure/cloud_run.py create mode 100644 infrastructure/project.py create mode 100644 infrastructure/pyproject.toml create mode 100644 infrastructure/topics.py create mode 100644 pyproject.toml create mode 100644 uv.lock diff --git a/.flox/env/manifest.lock b/.flox/env/manifest.lock index 9939d9f0c..9c8b74848 100644 --- a/.flox/env/manifest.lock +++ b/.flox/env/manifest.lock @@ -9,6 +9,12 @@ "pulumi": { "pkg-path": "pulumi" }, + "pulumi-language-python": { + "pkg-path": "pulumiPackages.pulumi-language-python" + }, + "pulumi-python": { + "pkg-path": "pulumiPackages.pulumi-python" + }, "stack": { "pkg-path": "stack" }, @@ -39,13 +45,13 @@ "description": "Front-end to your dev env", "install_id": "mise", "license": "MIT", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "mise-2025.3.11", "pname": "mise", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:14:40.404019Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:10:57.660902Z", "stabilities": [ "unstable" ], @@ -68,13 +74,13 @@ "description": "Front-end to your dev env", "install_id": "mise", "license": "MIT", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "mise-2025.3.11", "pname": "mise", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:35:37.992381Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:27:46.904416Z", "stabilities": [ "unstable" ], @@ -97,13 +103,13 @@ "description": "Front-end to your dev env", "install_id": "mise", "license": "MIT", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "mise-2025.3.11", "pname": "mise", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:54:09.752917Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:06.796396Z", "stabilities": [ "unstable" ], @@ -126,13 +132,13 @@ "description": "Front-end to your dev env", "install_id": "mise", "license": "MIT", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "mise-2025.3.11", "pname": "mise", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T02:16:26.468426Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:01:27.691760Z", "stabilities": [ "unstable" ], @@ -155,13 +161,13 @@ "description": "Pulumi is a cloud development platform that makes creating cloud programs easy and productive", "install_id": "pulumi", "license": "Apache-2.0", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "pulumi-3.156.0", "pname": "pulumi", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:14:46.698085Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:03.963221Z", "stabilities": [ "unstable" ], @@ -184,13 +190,13 @@ "description": "Pulumi is a cloud development platform that makes creating cloud programs easy and productive", "install_id": "pulumi", "license": "Apache-2.0", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "pulumi-3.156.0", "pname": "pulumi", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:35:50.048107Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:27:58.867334Z", "stabilities": [ "unstable" ], @@ -213,13 +219,13 @@ "description": "Pulumi is a cloud development platform that makes creating cloud programs easy and productive", "install_id": "pulumi", "license": "Apache-2.0", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "pulumi-3.156.0", "pname": "pulumi", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:54:16.116358Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:13.157620Z", "stabilities": [ "unstable" ], @@ -242,13 +248,13 @@ "description": "Pulumi is a cloud development platform that makes creating cloud programs easy and productive", "install_id": "pulumi", "license": "Apache-2.0", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "pulumi-3.156.0", "pname": "pulumi", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T02:16:39.507298Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:01:40.716123Z", "stabilities": [ "unstable" ], @@ -264,6 +270,238 @@ "group": "toplevel", "priority": 5 }, + { + "attr_path": "pulumiPackages.pulumi-language-python", + "broken": false, + "derivation": "/nix/store/56rk3vvk8wx7nfww0r0xm3546zc3f4wg-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-language-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-language-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:03.970604Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/lhj7hrxrarc3jricwhsbh0lbq7d7kj7w-pulumi-python-3.156.0" + }, + "system": "aarch64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-language-python", + "broken": false, + "derivation": "/nix/store/8fz1fjm951jdcm1bdij1b3bybsqql8vh-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-language-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-language-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:27:58.878743Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/571fgbhc4qkv42xipf78r736b7nkg8m6-pulumi-python-3.156.0" + }, + "system": "aarch64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-language-python", + "broken": false, + "derivation": "/nix/store/a9x2v2zh3j5awg4x1sfciwmpjkcf1wv5-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-language-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-language-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:13.165089Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/ds72iyr177cfda94cfqnxabynrh1lrfl-pulumi-python-3.156.0" + }, + "system": "x86_64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-language-python", + "broken": false, + "derivation": "/nix/store/31sib2km9mgjmxciqxz67z0mis2s9dhf-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-language-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-language-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:01:40.728310Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/wkxlrbjmpdcwyhiwx9q542yk2kyb0md9-pulumi-python-3.156.0" + }, + "system": "x86_64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-python", + "broken": false, + "derivation": "/nix/store/56rk3vvk8wx7nfww0r0xm3546zc3f4wg-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:03.972083Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/lhj7hrxrarc3jricwhsbh0lbq7d7kj7w-pulumi-python-3.156.0" + }, + "system": "aarch64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-python", + "broken": false, + "derivation": "/nix/store/8fz1fjm951jdcm1bdij1b3bybsqql8vh-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:27:58.881041Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/571fgbhc4qkv42xipf78r736b7nkg8m6-pulumi-python-3.156.0" + }, + "system": "aarch64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-python", + "broken": false, + "derivation": "/nix/store/a9x2v2zh3j5awg4x1sfciwmpjkcf1wv5-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:13.166583Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/ds72iyr177cfda94cfqnxabynrh1lrfl-pulumi-python-3.156.0" + }, + "system": "x86_64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "pulumiPackages.pulumi-python", + "broken": false, + "derivation": "/nix/store/31sib2km9mgjmxciqxz67z0mis2s9dhf-pulumi-python-3.156.0.drv", + "description": "Language host for Pulumi programs written in Python", + "install_id": "pulumi-python", + "license": "Apache-2.0", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "pulumi-python-3.156.0", + "pname": "pulumi-python", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:01:40.730748Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.156.0", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/wkxlrbjmpdcwyhiwx9q542yk2kyb0md9-pulumi-python-3.156.0" + }, + "system": "x86_64-linux", + "group": "toplevel", + "priority": 5 + }, { "attr_path": "stack", "broken": false, @@ -271,13 +509,13 @@ "description": "The Haskell Tool Stack", "install_id": "stack", "license": "BSD-3-Clause", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "stack-3.1.1", "pname": "stack", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:15:17.259563Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:34.508407Z", "stabilities": [ "unstable" ], @@ -301,13 +539,13 @@ "description": "The Haskell Tool Stack", "install_id": "stack", "license": "BSD-3-Clause", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "stack-3.1.1", "pname": "stack", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:36:34.907738Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:28:43.273475Z", "stabilities": [ "unstable" ], @@ -330,13 +568,13 @@ "description": "The Haskell Tool Stack", "install_id": "stack", "license": "BSD-3-Clause", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "stack-3.1.1", "pname": "stack", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:54:46.666003Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:43.747150Z", "stabilities": [ "unstable" ], @@ -359,13 +597,13 @@ "description": "The Haskell Tool Stack", "install_id": "stack", "license": "BSD-3-Clause", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "stack-3.1.1", "pname": "stack", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T02:17:26.687913Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:02:27.830908Z", "stabilities": [ "unstable" ], @@ -388,13 +626,13 @@ "description": "Extremely fast Python package installer and resolver, written in Rust", "install_id": "uv", "license": "[ Apache-2.0, MIT ]", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "uv-0.6.12", "pname": "uv", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:15:27.734186Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:44.987063Z", "stabilities": [ "unstable" ], @@ -417,13 +655,13 @@ "description": "Extremely fast Python package installer and resolver, written in Rust", "install_id": "uv", "license": "[ Apache-2.0, MIT ]", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "uv-0.6.12", "pname": "uv", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:36:49.738441Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:28:57.932781Z", "stabilities": [ "unstable" ], @@ -446,13 +684,13 @@ "description": "Extremely fast Python package installer and resolver, written in Rust", "install_id": "uv", "license": "[ Apache-2.0, MIT ]", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "uv-0.6.12", "pname": "uv", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T01:54:57.177922Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:54.280618Z", "stabilities": [ "unstable" ], @@ -475,13 +713,13 @@ "description": "Extremely fast Python package installer and resolver, written in Rust", "install_id": "uv", "license": "[ Apache-2.0, MIT ]", - "locked_url": "https://github.com/flox/nixpkgs?rev=063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "name": "uv-0.6.12", "pname": "uv", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", - "rev_count": 780010, - "rev_date": "2025-04-06T18:34:07Z", - "scrape_date": "2025-04-08T02:17:42.244484Z", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:02:43.334041Z", "stabilities": [ "unstable" ], diff --git a/.flox/env/manifest.toml b/.flox/env/manifest.toml index 953b6477d..b01c10941 100644 --- a/.flox/env/manifest.toml +++ b/.flox/env/manifest.toml @@ -6,6 +6,8 @@ stack.pkg-path = "stack" uv.pkg-path = "uv" mise.pkg-path = "mise" pulumi.pkg-path = "pulumi" +pulumi-language-python.pkg-path = "pulumiPackages.pulumi-language-python" +pulumi-python.pkg-path = "pulumiPackages.pulumi-python" [vars] diff --git a/.gitignore b/.gitignore index e43b0f988..331a5c6bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,46 @@ .DS_Store + +dist/ +dist-newstyle/ +.stack-work/ +*.hi +*.o +*.dyn_o +*.dyn_hi +*.prof +*.aux +*.hp +*.eventlog +*.tmp +*.tix +tags +.hsenv/ +.cabal-sandbox/ +cabal.sandbox.config +cabal.project.local +.ghc.environment.* + +__pycache__/ +*.py[cod] +*.so +*.egg-info/ +.eggs/ +*.pyo +*.pyd +*.pyc +.Python +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +*.env +*.venv + +*.log +*.DS_Store +*.swp +*.swo +.idea/ +.vscode/ +*.bak diff --git a/.mise.toml b/.mise.toml index 256607736..a5ae717e1 100644 --- a/.mise.toml +++ b/.mise.toml @@ -33,7 +33,9 @@ description = "build platform image to dockerhub" run = """ TIMESTAMP=$(date +%Y%m%d) cd platform -docker build -t pocketsizefund/platform:latest \ +docker build \ + --platform linux/amd64 \ + -t pocketsizefund/platform:latest \ -t pocketsizefund/platform:${TIMESTAMP} \ . """ diff --git a/infrastructure/Pulumi.prod.yaml b/infrastructure/Pulumi.prod.yaml new file mode 100644 index 000000000..9fc1f957c --- /dev/null +++ b/infrastructure/Pulumi.prod.yaml @@ -0,0 +1,19 @@ +config: + gcp:project: fund-alpha + gcp:region: us-east1 + infrastructure:APCA_API_KEY_ID: + secure: AAABAL4Pf1v0bFNaWB8npMFBxRUM5X5ADUDcuKlUd5KExEXo + infrastructure:APCA_API_SECRET_KEY: + secure: AAABAIzzpf1IyF7YqyYKI3NtAi603uYGbiTL0+Ou8dGiaVpI + infrastructure:chronos_sa_email: + secure: AAABAD6XqhuU4EDHYEkqYz+tQuXXIkDFhHkSw9PsdI6mek7jp+SyLkrAEWm0HoWL69PWZT8lRQDbsc21 + infrastructure:DISCORD_WEBHOOK_URL: + secure: AAABAC6A1clbC8HYuadFIoFUPr4ASFHq1iF8h9Bs6EWveR0UhUCZTGUBwt7EychS+VryumayiImJp50s+UNDpyiCRTTD+9wVSf9riaNT7UPKUPtOX6hwRpfJIzHymtcF+zKa5NVqIT5zTIr5HBALV+J+H9H42F5HXyTgEUBU7lyFr2SQ1O5gSxLoCSQZ+tPyaciPyKWpOv27IG9b + infrastructure:ALPACA_API_KEY: + secure: AAABAKPT/AhVsvKumR5W6tttPBUoC83gOzttBJyuqhs39Nld3tyEKkhBSWWpK7yZXYeYRw== + infrastructure:ALPACA_API_SECRET: + secure: AAABAOsh0I7XOMQVgKBalZASyrXKIpVikadYcbBxCSzWZXvh/WYyItYJtUF7s6o1u5Zz2a+s3uXiSzIDBcdc6KId0bzLoQ8Q + infrastructure:DARQUBE_API_KEY: + secure: AAABACFsUUn2GR8jW/RsDK/IHzT+EFeUs/XvtheT49QNUl7V2NbKIpUFry7XWnhhfT49xJIhEol/GOQFPQemAw== + infrastructure:ENVIRONMENT: + secure: AAABAAsWTAV03APxmcX4ZeT4YA4OoSP3LGmAFWPpeDfs/Yxf diff --git a/infrastructure/Pulumi.yaml b/infrastructure/Pulumi.yaml new file mode 100644 index 000000000..75c4493e4 --- /dev/null +++ b/infrastructure/Pulumi.yaml @@ -0,0 +1,3 @@ +name: pocketsizefund-infrastructure +runtime: python +description: Pocket Size Fund Infrastructure \ No newline at end of file diff --git a/infrastructure/__main__.py b/infrastructure/__main__.py new file mode 100644 index 000000000..f363eecc7 --- /dev/null +++ b/infrastructure/__main__.py @@ -0,0 +1,2 @@ +import topics +import cloud_run diff --git a/infrastructure/cloud_run.py b/infrastructure/cloud_run.py new file mode 100644 index 000000000..c7a2f0ba9 --- /dev/null +++ b/infrastructure/cloud_run.py @@ -0,0 +1,62 @@ +from pulumi_gcp import serviceaccount, cloudrun, pubsub, cloudscheduler +import base64 +from pulumi import Config +import topics + +config = Config() + +alpaca_api_key = config.require_secret("ALPACA_API_KEY_ID") +alpaca_api_secret = config.require_secret("ALPACA_API_SECRET_KEY") + + +service_account = serviceaccount.Account( + "platform-sa", + account_id="platform-sa", + display_name="platform cloud run service account", +) + + +service = cloudrun.Service( + "platformservice", + location="us-central1", + template=cloudrun.ServiceTemplateArgs( + spec=cloudrun.ServiceTemplateSpecArgs( + service_account_name=service_account.email, + containers=[ + cloudrun.ServiceTemplateSpecContainerArgs( + image="pocketsizefund/platform:latest", + args=["--period=1"], + envs=[ + cloudrun.ServiceTemplateSpecContainerEnvArgs( + name="ALPACA_API_KEY_ID", value=api_key + ), + cloudrun.ServiceTemplateSpecContainerEnvArgs( + name="ALPACA_API_SECRET_KEY", value=api_secret + ), + ], + ) + ], + ), + ), +) + +sub = pubsub.Subscription( + "platform-sub", + topic=topics.platform_ping.id, + push_config=pubsub.SubscriptionPushConfigArgs( + push_endpoint=service.statuses[0].url, + oidc_token=pubsub.SubscriptionPushConfigOidcTokenArgs( + service_account_email=service_account.email + ), + ), +) + +job = cloudscheduler.Job( + "platform-job", + schedule="0 * * * *", + time_zone="UTC", + pubsub_target=cloudscheduler.JobPubsubTargetArgs( + topic_name=topics.platform_ping.id, + data=base64.b64encode(b"{}").decode("utf-8"), + ), +) diff --git a/infrastructure/project.py b/infrastructure/project.py new file mode 100644 index 000000000..b84eba956 --- /dev/null +++ b/infrastructure/project.py @@ -0,0 +1,24 @@ +import pulumi +from pulumi_gcp.projects import Service, IAMMember +from pulumi_gcp.serviceaccount import Account + +PROJECT = pulumi.Config("gcp").require("project") +REGION = pulumi.Config("gcp").require("region") + +Service("enable-run", project=PROJECT, service="run.googleapis.com") +Service("enable-eventarc", project=PROJECT, service="eventarc.googleapis.com") +Service("enable-secretmanager", project=PROJECT, service="secretmanager.googleapis.com") +Service("enable-pubsub", project=PROJECT, service="pubsub.googleapis.com") + +service_account = Account( + "platform-service-acct", + account_id="platform", + display_name="Cloud Run Price Model Service Account", +) + +IAMMember( + "pubsub-token-access", + project=PROJECT, + role="roles/pubsub.subscriber", + member=service_account.email.apply(lambda e: f"serviceAccount:{e}"), +) diff --git a/infrastructure/pyproject.toml b/infrastructure/pyproject.toml new file mode 100644 index 000000000..e47111084 --- /dev/null +++ b/infrastructure/pyproject.toml @@ -0,0 +1,8 @@ +[project] +name = "infrastructure" +version = "0.1.0" +requires-python = ">=3.12" +dependencies = [ + "pulumi>=3.162.0", + "pulumi-gcp>=8.25.1", +] diff --git a/infrastructure/topics.py b/infrastructure/topics.py new file mode 100644 index 000000000..e539023d9 --- /dev/null +++ b/infrastructure/topics.py @@ -0,0 +1,3 @@ +from pulumi_gcp.pubsub import Topic + +platform_ping = Topic("platform-ping") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..7df77f820 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,10 @@ +[project] +name = "pocketsizefund" +version = "0.1.0" +description = "open source quantitative hedge fund 🍊" +readme = "README.md" +requires-python = ">=3.12" +dependencies = [] + +[tool.uv.workspace] +members = ["infrastructure"] diff --git a/uv.lock b/uv.lock new file mode 100644 index 000000000..d5946baa2 --- /dev/null +++ b/uv.lock @@ -0,0 +1,201 @@ +version = 1 +revision = 1 +requires-python = ">=3.12" + +[manifest] +members = [ + "infrastructure", + "pocketsizefund", +] + +[[package]] +name = "arpeggio" +version = "2.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/12/c4/516bb54456f85ad1947702ea4cef543a59de66d31a9887dbc3d9df36e3e1/Arpeggio-2.0.2.tar.gz", hash = "sha256:c790b2b06e226d2dd468e4fbfb5b7f506cec66416031fde1441cf1de2a0ba700", size = 766643 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f7/4f/d28bf30a19d4649b40b501d531b44e73afada99044df100380fd9567e92f/Arpeggio-2.0.2-py2.py3-none-any.whl", hash = "sha256:f7c8ae4f4056a89e020c24c7202ac8df3e2bc84e416746f20b0da35bb1de0250", size = 55287 }, +] + +[[package]] +name = "attrs" +version = "25.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/b0/1367933a8532ee6ff8d63537de4f1177af4bff9f3e829baf7331f595bb24/attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b", size = 812032 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815 }, +] + +[[package]] +name = "debugpy" +version = "1.8.13" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/51/d4/f35f539e11c9344652f362c22413ec5078f677ac71229dc9b4f6f85ccaa3/debugpy-1.8.13.tar.gz", hash = "sha256:837e7bef95bdefba426ae38b9a94821ebdc5bea55627879cd48165c90b9e50ce", size = 1641193 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/ad/dff929b6b5403feaab0af0e5bb460fd723f9c62538b718a9af819b8fff20/debugpy-1.8.13-cp312-cp312-macosx_14_0_universal2.whl", hash = "sha256:2b8de94c5c78aa0d0ed79023eb27c7c56a64c68217d881bee2ffbcb13951d0c1", size = 2501004 }, + { url = "https://files.pythonhosted.org/packages/d6/4f/b7d42e6679f0bb525888c278b0c0d2b6dff26ed42795230bb46eaae4f9b3/debugpy-1.8.13-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:887d54276cefbe7290a754424b077e41efa405a3e07122d8897de54709dbe522", size = 4222346 }, + { url = "https://files.pythonhosted.org/packages/ec/18/d9b3e88e85d41f68f77235112adc31012a784e45a3fcdbb039777d570a0f/debugpy-1.8.13-cp312-cp312-win32.whl", hash = "sha256:3872ce5453b17837ef47fb9f3edc25085ff998ce63543f45ba7af41e7f7d370f", size = 5226639 }, + { url = "https://files.pythonhosted.org/packages/c9/f7/0df18a4f530ed3cc06f0060f548efe9e3316102101e311739d906f5650be/debugpy-1.8.13-cp312-cp312-win_amd64.whl", hash = "sha256:63ca7670563c320503fea26ac688988d9d6b9c6a12abc8a8cf2e7dd8e5f6b6ea", size = 5268735 }, + { url = "https://files.pythonhosted.org/packages/b1/db/ae7cd645c1826aae557cebccbc448f0cc9a818d364efb88f8d80e7a03f41/debugpy-1.8.13-cp313-cp313-macosx_14_0_universal2.whl", hash = "sha256:31abc9618be4edad0b3e3a85277bc9ab51a2d9f708ead0d99ffb5bb750e18503", size = 2485416 }, + { url = "https://files.pythonhosted.org/packages/ec/ed/db4b10ff3b5bb30fe41d9e86444a08bb6448e4d8265e7768450b8408dd36/debugpy-1.8.13-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0bd87557f97bced5513a74088af0b84982b6ccb2e254b9312e29e8a5c4270eb", size = 4218784 }, + { url = "https://files.pythonhosted.org/packages/82/82/ed81852a8d94086f51664d032d83c7f87cd2b087c6ea70dabec7c1ba813d/debugpy-1.8.13-cp313-cp313-win32.whl", hash = "sha256:5268ae7fdca75f526d04465931cb0bd24577477ff50e8bb03dab90983f4ebd02", size = 5226270 }, + { url = "https://files.pythonhosted.org/packages/15/63/aa92fb341a78ec40f1c414ec7a7885c2ee17032eee00d12cee0cdc502af4/debugpy-1.8.13-cp313-cp313-win_amd64.whl", hash = "sha256:79ce4ed40966c4c1631d0131606b055a5a2f8e430e3f7bf8fd3744b09943e8e8", size = 5268621 }, + { url = "https://files.pythonhosted.org/packages/37/4f/0b65410a08b6452bfd3f7ed6f3610f1a31fb127f46836e82d31797065dcb/debugpy-1.8.13-py2.py3-none-any.whl", hash = "sha256:d4ba115cdd0e3a70942bd562adba9ec8c651fe69ddde2298a1be296fc331906f", size = 5229306 }, +] + +[[package]] +name = "dill" +version = "0.3.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/70/43/86fe3f9e130c4137b0f1b50784dd70a5087b911fe07fa81e53e0c4c47fea/dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c", size = 187000 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/46/d1/e73b6ad76f0b1fb7f23c35c6d95dbc506a9c8804f43dda8cb5b0fa6331fd/dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a", size = 119418 }, +] + +[[package]] +name = "grpcio" +version = "1.66.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/71/d1/49a96df4eb1d805cf546247df40636515416d2d5c66665e5129c8b4162a8/grpcio-1.66.2.tar.gz", hash = "sha256:563588c587b75c34b928bc428548e5b00ea38c46972181a4d8b75ba7e3f24231", size = 12489713 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6b/5c/c4da36b7a77dbb15c4bc72228dff7161874752b2c6bddf7bb046d9da1b90/grpcio-1.66.2-cp312-cp312-linux_armv7l.whl", hash = "sha256:802d84fd3d50614170649853d121baaaa305de7b65b3e01759247e768d691ddf", size = 5002933 }, + { url = "https://files.pythonhosted.org/packages/a0/d5/b631445dff250a5301f51ff56c5fc917c7f955cd02fa55379f158a89abeb/grpcio-1.66.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:80fd702ba7e432994df208f27514280b4b5c6843e12a48759c9255679ad38db8", size = 10793953 }, + { url = "https://files.pythonhosted.org/packages/c8/1c/2179ac112152e92c02990f98183edf645df14aa3c38b39f1a3a60358b6c6/grpcio-1.66.2-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:12fda97ffae55e6526825daf25ad0fa37483685952b5d0f910d6405c87e3adb6", size = 5499791 }, + { url = "https://files.pythonhosted.org/packages/0b/53/8d7ab865fbd983309c8242930f00b28a01047f70c2b2e4c79a5c92a46a08/grpcio-1.66.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:950da58d7d80abd0ea68757769c9db0a95b31163e53e5bb60438d263f4bed7b7", size = 6109606 }, + { url = "https://files.pythonhosted.org/packages/86/e9/3dfb5a3ff540636d46b8b723345e923e8c553d9b3f6a8d1b09b0d915eb46/grpcio-1.66.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e636ce23273683b00410f1971d209bf3689238cf5538d960adc3cdfe80dd0dbd", size = 5762866 }, + { url = "https://files.pythonhosted.org/packages/f1/cb/c07493ad5dd73d51e4e15b0d483ff212dfec136ee1e4f3b49d115bdc7a13/grpcio-1.66.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:a917d26e0fe980b0ac7bfcc1a3c4ad6a9a4612c911d33efb55ed7833c749b0ee", size = 6446819 }, + { url = "https://files.pythonhosted.org/packages/ff/5f/142e19db367a34ea0ee8a8451e43215d0a1a5dbffcfdcae8801f22903301/grpcio-1.66.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:49f0ca7ae850f59f828a723a9064cadbed90f1ece179d375966546499b8a2c9c", size = 6040273 }, + { url = "https://files.pythonhosted.org/packages/5c/3b/12fcd752c55002e4b0e0a7bd5faec101bc0a4e3890be3f95a43353142481/grpcio-1.66.2-cp312-cp312-win32.whl", hash = "sha256:31fd163105464797a72d901a06472860845ac157389e10f12631025b3e4d0453", size = 3537988 }, + { url = "https://files.pythonhosted.org/packages/f1/70/76bfea3faa862bfceccba255792e780691ff25b8227180759c9d38769379/grpcio-1.66.2-cp312-cp312-win_amd64.whl", hash = "sha256:ff1f7882e56c40b0d33c4922c15dfa30612f05fb785074a012f7cda74d1c3679", size = 4275553 }, + { url = "https://files.pythonhosted.org/packages/72/31/8708a8dfb3f1ac89926c27c5dd17412764157a2959dbc5a606eaf8ac71f6/grpcio-1.66.2-cp313-cp313-linux_armv7l.whl", hash = "sha256:3b00efc473b20d8bf83e0e1ae661b98951ca56111feb9b9611df8efc4fe5d55d", size = 5004245 }, + { url = "https://files.pythonhosted.org/packages/8b/37/0b57c3769efb3cc9ec97fcaa9f7243046660e7ed58c0faebc4ef315df92c/grpcio-1.66.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:1caa38fb22a8578ab8393da99d4b8641e3a80abc8fd52646f1ecc92bcb8dee34", size = 10756749 }, + { url = "https://files.pythonhosted.org/packages/bf/5a/425e995724a19a1b110340ed653bc7c5de8019d9fc84b3798a0f79c3eb31/grpcio-1.66.2-cp313-cp313-manylinux_2_17_aarch64.whl", hash = "sha256:c408f5ef75cfffa113cacd8b0c0e3611cbfd47701ca3cdc090594109b9fcbaed", size = 5499666 }, + { url = "https://files.pythonhosted.org/packages/2e/e4/86a5c5ec40a6b683671a1d044ebca433812d99da8fcfc2889e9c43cecbd4/grpcio-1.66.2-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c806852deaedee9ce8280fe98955c9103f62912a5b2d5ee7e3eaa284a6d8d8e7", size = 6109578 }, + { url = "https://files.pythonhosted.org/packages/2f/86/a86742f3deaa22385c3bff984c5947fc62d47d3fab26c508730037d027e5/grpcio-1.66.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f145cc21836c332c67baa6fc81099d1d27e266401565bf481948010d6ea32d46", size = 5763274 }, + { url = "https://files.pythonhosted.org/packages/c3/61/b9a2a4345dea0a354c4ed8ac7aacbdd0ff986acbc8f92680213cf3d2faa3/grpcio-1.66.2-cp313-cp313-musllinux_1_1_i686.whl", hash = "sha256:73e3b425c1e155730273f73e419de3074aa5c5e936771ee0e4af0814631fb30a", size = 6450416 }, + { url = "https://files.pythonhosted.org/packages/50/b9/ad303ce75d8cd71d855a661519aa160ce42f27498f589f1ae6d9f8c5e8ac/grpcio-1.66.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:9c509a4f78114cbc5f0740eb3d7a74985fd2eff022971bc9bc31f8bc93e66a3b", size = 6040045 }, + { url = "https://files.pythonhosted.org/packages/ac/b3/8db1873e3240ef1672ba87b89e949ece367089e29e4d221377bfdd288bd3/grpcio-1.66.2-cp313-cp313-win32.whl", hash = "sha256:20657d6b8cfed7db5e11b62ff7dfe2e12064ea78e93f1434d61888834bc86d75", size = 3537126 }, + { url = "https://files.pythonhosted.org/packages/a2/df/133216989fe7e17caeafd7ff5b17cc82c4e722025d0b8d5d2290c11fe2e6/grpcio-1.66.2-cp313-cp313-win_amd64.whl", hash = "sha256:fb70487c95786e345af5e854ffec8cb8cc781bcc5df7930c4fbb7feaa72e1cdf", size = 4278018 }, +] + +[[package]] +name = "infrastructure" +version = "0.1.0" +source = { virtual = "infrastructure" } +dependencies = [ + { name = "pulumi" }, + { name = "pulumi-gcp" }, +] + +[package.metadata] +requires-dist = [ + { name = "pulumi", specifier = ">=3.162.0" }, + { name = "pulumi-gcp", specifier = ">=8.25.1" }, +] + +[[package]] +name = "parver" +version = "0.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "arpeggio" }, + { name = "attrs" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cc/e5/1c774688a90f0b76e872e30f6f1ba3f5e14056cd0d96a684047d4a986226/parver-0.5.tar.gz", hash = "sha256:b9fde1e6bb9ce9f07e08e9c4bea8d8825c5e78e18a0052d02e02bf9517eb4777", size = 26908 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0f/4c/f98024021bef4d44dce3613feebd702c7ad8883f777ff8488384c59e9774/parver-0.5-py3-none-any.whl", hash = "sha256:2281b187276c8e8e3c15634f62287b2fb6fe0efe3010f739a6bd1e45fa2bf2b2", size = 15172 }, +] + +[[package]] +name = "pip" +version = "25.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/70/53/b309b4a497b09655cb7e07088966881a57d082f48ac3cb54ea729fd2c6cf/pip-25.0.1.tar.gz", hash = "sha256:88f96547ea48b940a3a385494e181e29fb8637898f88d88737c5049780f196ea", size = 1950850 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c9/bc/b7db44f5f39f9d0494071bddae6880eb645970366d0a200022a1a93d57f5/pip-25.0.1-py3-none-any.whl", hash = "sha256:c46efd13b6aa8279f33f2864459c8ce587ea6a1a59ee20de055868d8f7688f7f", size = 1841526 }, +] + +[[package]] +name = "pocketsizefund" +version = "0.1.0" +source = { virtual = "." } + +[[package]] +name = "protobuf" +version = "4.25.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/48/d5/cccc7e82bbda9909ced3e7a441a24205ea07fea4ce23a772743c0c7611fa/protobuf-4.25.6.tar.gz", hash = "sha256:f8cfbae7c5afd0d0eaccbe73267339bff605a2315860bb1ba08eb66670a9a91f", size = 380631 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/41/0ff3559d9a0fbdb37c9452f2b84e61f7784d8d7b9850182c7ef493f523ee/protobuf-4.25.6-cp310-abi3-win32.whl", hash = "sha256:61df6b5786e2b49fc0055f636c1e8f0aff263808bb724b95b164685ac1bcc13a", size = 392454 }, + { url = "https://files.pythonhosted.org/packages/79/84/c700d6c3f3be770495b08a1c035e330497a31420e4a39a24c22c02cefc6c/protobuf-4.25.6-cp310-abi3-win_amd64.whl", hash = "sha256:b8f837bfb77513fe0e2f263250f423217a173b6d85135be4d81e96a4653bcd3c", size = 413443 }, + { url = "https://files.pythonhosted.org/packages/b7/03/361e87cc824452376c2abcef0eabd18da78a7439479ec6541cf29076a4dc/protobuf-4.25.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:6d4381f2417606d7e01750e2729fe6fbcda3f9883aa0c32b51d23012bded6c91", size = 394246 }, + { url = "https://files.pythonhosted.org/packages/64/d5/7dbeb69b74fa88f297c6d8f11b7c9cef0c2e2fb1fdf155c2ca5775cfa998/protobuf-4.25.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:5dd800da412ba7f6f26d2c08868a5023ce624e1fdb28bccca2dc957191e81fb5", size = 293714 }, + { url = "https://files.pythonhosted.org/packages/d4/f0/6d5c100f6b18d973e86646aa5fc09bc12ee88a28684a56fd95511bceee68/protobuf-4.25.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:4434ff8bb5576f9e0c78f47c41cdf3a152c0b44de475784cd3fd170aef16205a", size = 294634 }, + { url = "https://files.pythonhosted.org/packages/71/eb/be11a1244d0e58ee04c17a1f939b100199063e26ecca8262c04827fe0bf5/protobuf-4.25.6-py3-none-any.whl", hash = "sha256:07972021c8e30b870cfc0863409d033af940213e0e7f64e27fe017b929d2c9f7", size = 156466 }, +] + +[[package]] +name = "pulumi" +version = "3.162.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "debugpy" }, + { name = "dill" }, + { name = "grpcio" }, + { name = "pip" }, + { name = "protobuf" }, + { name = "pyyaml" }, + { name = "semver" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/2e/67829e4f30c681fc65c6dffa9741c352f7d9e386c3513ac889a2e1ea2651/pulumi-3.162.0-py3-none-any.whl", hash = "sha256:b4d2049e286c18f1feac5b7a0c1537649048e94e0fbc0c5993215168536ce05a", size = 328026 }, +] + +[[package]] +name = "pulumi-gcp" +version = "8.25.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "parver" }, + { name = "pulumi" }, + { name = "semver" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/c9/1423dcd6ab6193fa4e7c06814f406159d70483df06a84a5665df89005a56/pulumi_gcp-8.25.1.tar.gz", hash = "sha256:a2cf02188112c83d20b43ea5de4fc9ac0229f9b951b1687d02c4e70ea5bfd251", size = 7349381 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/aa/c8/49916468836ccb712b5332e5c6853e5389460476d188a64239f3ab720888/pulumi_gcp-8.25.1-py3-none-any.whl", hash = "sha256:7c224828a3749dc3eeb3fcbe9a8fb7ae697263fd2cc071c7daca395cbd5d9a32", size = 9311858 }, +] + +[[package]] +name = "pyyaml" +version = "6.0.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size = 183873 }, + { url = "https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size = 173302 }, + { url = "https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size = 739154 }, + { url = "https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size = 766223 }, + { url = "https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size = 767542 }, + { url = "https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size = 731164 }, + { url = "https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size = 756611 }, + { url = "https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size = 140591 }, + { url = "https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size = 156338 }, + { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309 }, + { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679 }, + { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428 }, + { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361 }, + { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523 }, + { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660 }, + { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597 }, + { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527 }, + { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446 }, +] + +[[package]] +name = "semver" +version = "3.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/d1/d3159231aec234a59dd7d601e9dd9fe96f3afff15efd33c1070019b26132/semver-3.0.4.tar.gz", hash = "sha256:afc7d8c584a5ed0a11033af086e8af226a9c0b206f313e0301f8dd7b6b589602", size = 269730 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a6/24/4d91e05817e92e3a61c8a21e08fd0f390f5301f1c448b137c57c4bc6e543/semver-3.0.4-py3-none-any.whl", hash = "sha256:9c824d87ba7f7ab4a1890799cec8596f15c1241cb473404ea1cb0c55e4b04746", size = 17912 }, +] From ec1c9023b7b88d120846930463b9625a76fe068a Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Sat, 12 Apr 2025 22:22:33 -0400 Subject: [PATCH 05/29] Add license file and tweak README --- LICENSE.md | 21 +++++++++++++++++++++ README.md | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..d34a3198f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Pocket Size Fund + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 45bec47e2..92f081769 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ An unordered and non-exhaustive list we work towards: > No code is good code > Never write documentation > Git is truth -> Communicate with issues and pull requests +> Communicate without speaking > Make everything liquid ### Links From a59ce41a76e863ca15d9337decb638c429435325 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 20:55:14 -0400 Subject: [PATCH 06/29] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 7530e875b..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pocketsize.fund \ No newline at end of file From 33b469980a295f7684b51aa05e8803f5aa94aca6 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 20:55:26 -0400 Subject: [PATCH 07/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..7530e875b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pocketsize.fund \ No newline at end of file From fc60bafb172c1ecf801399418584c3407bb9a701 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 20:59:34 -0400 Subject: [PATCH 08/29] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 7530e875b..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pocketsize.fund \ No newline at end of file From 09db60e90d8b555196dbd3cd3f14ff4804b6f8ac Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 20:59:38 -0400 Subject: [PATCH 09/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..7530e875b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pocketsize.fund \ No newline at end of file From 21f987a4a7bfbca2d31ad352de0eeebbb2156d74 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 21:07:16 -0400 Subject: [PATCH 10/29] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 7530e875b..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pocketsize.fund \ No newline at end of file From 5a3a52087a8201a55843440e6bd5c4465ca28fce Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 21:07:22 -0400 Subject: [PATCH 11/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..7530e875b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pocketsize.fund \ No newline at end of file From a8af8a681b394d1cc29895e0c78cce9b501acc6c Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 21:17:05 -0400 Subject: [PATCH 12/29] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 7530e875b..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pocketsize.fund \ No newline at end of file From b252d23d98f8e04406358ac6a0e1126ca051de09 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 21:17:14 -0400 Subject: [PATCH 13/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..7530e875b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pocketsize.fund \ No newline at end of file From ce480d61e0ea703afa02400912a7deb8e2800590 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 22:13:50 -0400 Subject: [PATCH 14/29] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 7530e875b..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pocketsize.fund \ No newline at end of file From a5fda1e99c637455392905a49cbce02d6a4f82ba Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Tue, 15 Apr 2025 22:13:56 -0400 Subject: [PATCH 15/29] Create CNAME --- CNAME | 1 + 1 file changed, 1 insertion(+) create mode 100644 CNAME diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..7530e875b --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +pocketsize.fund \ No newline at end of file From 7d418e798de3edec28b356ee54047e0abeb40e41 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Thu, 10 Apr 2025 14:00:47 -0400 Subject: [PATCH 16/29] add github action for linting --- .github/workflows/format.yml | 23 +++++++++++++++++++++++ .mise.toml | 5 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..9ecf992ba --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,23 @@ +name: Format check + +on: + pull_request + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install mise + uses: jdx/mise-action@v2 + - name: Run code formatter + run: mise run fmt + - name: Run code linter + run: mise run lint + - name: Check for changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "code formatting issues found. please run 'mise run fmt' locally and commit the changes." + git diff + exit 1 + fi diff --git a/.mise.toml b/.mise.toml index a5ae717e1..707ad7d12 100644 --- a/.mise.toml +++ b/.mise.toml @@ -26,7 +26,10 @@ description="run python code quality checks across the full repository" [tasks."platform:run"] description = "run platform in docker compose" -run = "cd platform && docker compose up" +run = """ +cd platform +docker compose up +""" [tasks."platform:build"] description = "build platform image to dockerhub" From fd2f1b5400c7e24ec033e5a7797a437c6672fe95 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Thu, 10 Apr 2025 14:15:07 -0400 Subject: [PATCH 17/29] add linter functions to mise and github action for both python and haskell --- .flox/env/manifest.lock | 246 +++++++++++++++++++++++++++++++++++++ .flox/env/manifest.toml | 2 + .mise.toml | 24 +++- infrastructure/__main__.py | 4 +- platform/Setup.hs | 1 + platform/app/Main.hs | 7 +- platform/src/Lib.hs | 24 ++-- platform/test/Spec.hs | 11 +- 8 files changed, 292 insertions(+), 27 deletions(-) diff --git a/.flox/env/manifest.lock b/.flox/env/manifest.lock index 9c8b74848..2e35a3c6e 100644 --- a/.flox/env/manifest.lock +++ b/.flox/env/manifest.lock @@ -3,9 +3,15 @@ "manifest": { "version": 1, "install": { + "hlint": { + "pkg-path": "hlint" + }, "mise": { "pkg-path": "mise" }, + "ormolu": { + "pkg-path": "ormolu" + }, "pulumi": { "pkg-path": "pulumi" }, @@ -38,6 +44,126 @@ } }, "packages": [ + { + "attr_path": "hlint", + "broken": false, + "derivation": "/nix/store/jdf36nnrpzwariain1hza7ky1b2z5xkj-hlint-3.6.1.drv", + "description": "Source code suggestions", + "install_id": "hlint", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "hlint-3.6.1", + "pname": "hlint", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:10:55.991466Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.6.1", + "outputs_to_install": [ + "out" + ], + "outputs": { + "data": "/nix/store/5drxvl3n37hlmwdq709n15hbqf5m6d9m-hlint-3.6.1-data", + "out": "/nix/store/vsz3ycyfc4ci8c2rg93rx47wvbqcisnl-hlint-3.6.1" + }, + "system": "aarch64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "hlint", + "broken": false, + "derivation": "/nix/store/vqnpn9klpxzc924567ddlvrwj9mczcyp-hlint-3.6.1.drv", + "description": "Source code suggestions", + "install_id": "hlint", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "hlint-3.6.1", + "pname": "hlint", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:27:39.376262Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.6.1", + "outputs_to_install": [ + "out" + ], + "outputs": { + "data": "/nix/store/hb8vyvrmdsx6c8xg5zckpx20dfd08qqb-hlint-3.6.1-data", + "out": "/nix/store/3m0nj1m197ak8wbqlm8k09mqyf75rc3a-hlint-3.6.1" + }, + "system": "aarch64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "hlint", + "broken": false, + "derivation": "/nix/store/1nc1nwarlv6kwf6kjassg8jgz6pgigsi-hlint-3.6.1.drv", + "description": "Source code suggestions", + "install_id": "hlint", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "hlint-3.6.1", + "pname": "hlint", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:05.087257Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.6.1", + "outputs_to_install": [ + "out" + ], + "outputs": { + "data": "/nix/store/lv4mabwqr2a306kri2lvnhj8s22ryplm-hlint-3.6.1-data", + "out": "/nix/store/54inbni5fgq0m4r2x8cxj31sl1hh5l1p-hlint-3.6.1" + }, + "system": "x86_64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "hlint", + "broken": false, + "derivation": "/nix/store/r67bqqlp205qsg4rz11r5ihwlq2c7k8n-hlint-3.6.1.drv", + "description": "Source code suggestions", + "install_id": "hlint", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "hlint-3.6.1", + "pname": "hlint", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:01:18.635113Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "3.6.1", + "outputs_to_install": [ + "out" + ], + "outputs": { + "data": "/nix/store/9vq3wb6ajvwri3dldlxvgi8rva6b21r2-hlint-3.6.1-data", + "out": "/nix/store/fr0yaxspbc0qpi59m0a5m7vrdjsw96q3-hlint-3.6.1" + }, + "system": "x86_64-linux", + "group": "toplevel", + "priority": 5 + }, { "attr_path": "mise", "broken": false, @@ -154,6 +280,126 @@ "group": "toplevel", "priority": 5 }, + { + "attr_path": "ormolu", + "broken": false, + "derivation": "/nix/store/k2ib7z6dv90ylhv2kfs4h5wxc96nd9qz-ormolu-0.7.2.0.drv", + "description": "A formatter for Haskell source code", + "install_id": "ormolu", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ormolu-0.7.2.0", + "pname": "ormolu", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:10:58.907487Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "0.7.2.0", + "outputs_to_install": [ + "bin" + ], + "outputs": { + "bin": "/nix/store/p5sx43k04ni3017ryx35fhshxwlrfhmh-ormolu-0.7.2.0-bin", + "out": "/nix/store/gb7yzqi6znkdij61f5dhkrnx9mnywhi6-ormolu-0.7.2.0" + }, + "system": "aarch64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "ormolu", + "broken": false, + "derivation": "/nix/store/nxmhir7aw4jc3blnxxd4klv59f5y3nvf-ormolu-0.7.2.0.drv", + "description": "A formatter for Haskell source code", + "install_id": "ormolu", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ormolu-0.7.2.0", + "pname": "ormolu", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:27:49.620205Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "0.7.2.0", + "outputs_to_install": [ + "bin" + ], + "outputs": { + "bin": "/nix/store/64vyl64y6q441c8iw8crqwpm3pi7diyq-ormolu-0.7.2.0-bin", + "out": "/nix/store/93kvavaiqr8k60g1bb1j9khhampjg6hb-ormolu-0.7.2.0" + }, + "system": "aarch64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "ormolu", + "broken": false, + "derivation": "/nix/store/rjfblq98yxmnkzm2kwcdb8xdvhqpnq7h-ormolu-0.7.2.0.drv", + "description": "A formatter for Haskell source code", + "install_id": "ormolu", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ormolu-0.7.2.0", + "pname": "ormolu", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:08.047997Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "0.7.2.0", + "outputs_to_install": [ + "bin" + ], + "outputs": { + "bin": "/nix/store/47y00cam104r5gi18vpqq80fb5g59g6q-ormolu-0.7.2.0-bin", + "out": "/nix/store/311pkks2vs11b8b7mv91d1n0x2ns6j61-ormolu-0.7.2.0" + }, + "system": "x86_64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "ormolu", + "broken": false, + "derivation": "/nix/store/mwh5l8c2fbx4ryn16r0lgxkqq3isxfn2-ormolu-0.7.2.0.drv", + "description": "A formatter for Haskell source code", + "install_id": "ormolu", + "license": "BSD-3-Clause", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ormolu-0.7.2.0", + "pname": "ormolu", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:01:30.731633Z", + "stabilities": [ + "unstable" + ], + "unfree": false, + "version": "0.7.2.0", + "outputs_to_install": [ + "bin" + ], + "outputs": { + "bin": "/nix/store/83arqyvdbrrflp40a0wiczafqpbkhhxi-ormolu-0.7.2.0-bin", + "out": "/nix/store/6j0h6qqrx3g0p72mqqiw24sndphf4hm7-ormolu-0.7.2.0" + }, + "system": "x86_64-linux", + "group": "toplevel", + "priority": 5 + }, { "attr_path": "pulumi", "broken": false, diff --git a/.flox/env/manifest.toml b/.flox/env/manifest.toml index b01c10941..552e22527 100644 --- a/.flox/env/manifest.toml +++ b/.flox/env/manifest.toml @@ -8,6 +8,8 @@ mise.pkg-path = "mise" pulumi.pkg-path = "pulumi" pulumi-language-python.pkg-path = "pulumiPackages.pulumi-language-python" pulumi-python.pkg-path = "pulumiPackages.pulumi-python" +ormolu.pkg-path = "ormolu" +hlint.pkg-path = "hlint" [vars] diff --git a/.mise.toml b/.mise.toml index 707ad7d12..5175f52c2 100644 --- a/.mise.toml +++ b/.mise.toml @@ -12,7 +12,7 @@ description="check for dead python code" run = """ uvx vulture \ --min-confidence 80 \ - --exclude '.venv,target' \ + --exclude '.flox,.venv,target' \ . """ @@ -24,6 +24,15 @@ run = "uvx ruff format" depends = ["python:check", "python:dead-code", "python:format"] description="run python code quality checks across the full repository" +[tasks."haskell:format"] +description = "lint haskell code" +run = "ormolu --mode inplace $(find . -name '*.hs')" + +[tasks."haskell:lint"] +description = "lint haskell code" +depends = ["haskell:format"] +run = "hlint ." + [tasks."platform:run"] description = "run platform in docker compose" run = """ @@ -56,3 +65,16 @@ docker push pocketsizefund/platform:${TIMESTAMP} [tasks."infrastructure:up"] description = "launch infrastructure" run = "cd infrastructure && uv run pulumi up" + +[tasks."format"] +description = "format entire codebase" +depends = ["python:lint", "haskell:lint"] + +[tasks."lint"] +description = "lint entire codebase" +depends = ["format"] + + +[tasks."test"] +description = "run all tests" +depends = ["python:test", "haskell:test"] diff --git a/infrastructure/__main__.py b/infrastructure/__main__.py index f363eecc7..17448e979 100644 --- a/infrastructure/__main__.py +++ b/infrastructure/__main__.py @@ -1,2 +1,2 @@ -import topics -import cloud_run +import topics # noqa: F401 +import cloud_run # noqa: F401 diff --git a/platform/Setup.hs b/platform/Setup.hs index 9a994af67..e8ef27dbb 100644 --- a/platform/Setup.hs +++ b/platform/Setup.hs @@ -1,2 +1,3 @@ import Distribution.Simple + main = defaultMain diff --git a/platform/app/Main.hs b/platform/app/Main.hs index 3e8cff68e..129104770 100644 --- a/platform/app/Main.hs +++ b/platform/app/Main.hs @@ -1,13 +1,10 @@ module Main (main) where -import Network.Wai.Handler.Warp (run, runSettings, defaultSettings, setLogger, setPort) -import Network.Wai.Logger (withStdoutLogger) - - import Lib +import Network.Wai.Handler.Warp (defaultSettings, run, runSettings, setLogger, setPort) +import Network.Wai.Logger (withStdoutLogger) main :: IO () main = withStdoutLogger $ \aplogger -> do let settings = setPort 8080 $ setLogger aplogger defaultSettings runSettings settings app - diff --git a/platform/src/Lib.hs b/platform/src/Lib.hs index 2162fa012..e1db5f68c 100644 --- a/platform/src/Lib.hs +++ b/platform/src/Lib.hs @@ -1,11 +1,12 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeOperators #-} + module Lib - ( - app - ) where + ( app, + ) +where import Data.Aeson import Data.Aeson.TH @@ -15,13 +16,12 @@ import Network.Wai.Handler.Warp import Servant import System.Environment (getEnv) - - data User = User - { userId :: Int - , userFirstName :: String - , userLastName :: String - } deriving (Eq, Show) + { userId :: Int, + userFirstName :: String, + userLastName :: String + } + deriving (Eq, Show) $(deriveJSON defaultOptions ''User) diff --git a/platform/test/Spec.hs b/platform/test/Spec.hs index 1065caf2a..ace5e8758 100644 --- a/platform/test/Spec.hs +++ b/platform/test/Spec.hs @@ -1,5 +1,5 @@ -{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} + module Main (main) where import Lib (app) @@ -11,9 +11,6 @@ main = hspec spec spec :: Spec spec = with (return app) $ do - describe "GET /users" $ do - it "responds with 200" $ do - get "/users" `shouldRespondWith` 200 - it "responds with [User]" $ do - let users = "[{\"userId\":1,\"userFirstName\":\"Isaac\",\"userLastName\":\"Newton\"},{\"userId\":2,\"userFirstName\":\"Albert\",\"userLastName\":\"Einstein\"}]" - get "/users" `shouldRespondWith` users + describe "GET /health" $ do + it "responds with 200" $ do + get "/health" `shouldRespondWith` 200 From c606628d4f18f3d4b14c209c025f813948c6132a Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:12:02 -0400 Subject: [PATCH 18/29] add GET /account endpoint --- platform/app/Main.hs | 3 +++ platform/package.yaml | 6 +++++- platform/platform.cabal | 39 +++++++++++++++++++++------------------ platform/src/Account.hs | 34 ++++++++++++++++++++++++++++++++++ platform/src/Lib.hs | 39 ++++++++++++++++++++++++++------------- platform/test/Spec.hs | 8 ++++++++ 6 files changed, 97 insertions(+), 32 deletions(-) create mode 100644 platform/src/Account.hs diff --git a/platform/app/Main.hs b/platform/app/Main.hs index 129104770..250404963 100644 --- a/platform/app/Main.hs +++ b/platform/app/Main.hs @@ -1,4 +1,6 @@ module Main (main) where +import Network.Wai.Handler.Warp (run, runSettings, defaultSettings, setLogger, setPort) +import Network.Wai.Logger (withStdoutLogger) import Lib import Network.Wai.Handler.Warp (defaultSettings, run, runSettings, setLogger, setPort) @@ -8,3 +10,4 @@ main :: IO () main = withStdoutLogger $ \aplogger -> do let settings = setPort 8080 $ setLogger aplogger defaultSettings runSettings settings app + diff --git a/platform/package.yaml b/platform/package.yaml index c6167d6fb..c7eda5930 100644 --- a/platform/package.yaml +++ b/platform/package.yaml @@ -1,5 +1,5 @@ name: platform -version: 2025041401 +version: 2025.4.14.1 github: "pocketsizefund/platform" license: MIT author: "pocketsizefund" @@ -16,6 +16,9 @@ dependencies: - wai-logger - warp - text +- wreq +- lens +- bytestring ghc-options: - -Wall @@ -58,3 +61,4 @@ tests: - hspec-wai - hspec-wai-json - aeson + - raw-strings-qq diff --git a/platform/platform.cabal b/platform/platform.cabal index 56e9ee287..80ec3f685 100644 --- a/platform/platform.cabal +++ b/platform/platform.cabal @@ -1,64 +1,65 @@ -cabal-version: 2.2 +cabal-version: 1.12 -- This file has been generated from package.yaml by hpack version 0.37.0. -- -- see: https://github.com/sol/hpack name: platform -version: 0.1.0.0 -description: Please see the README on GitHub at -homepage: https://github.com/githubuser/platform#readme -bug-reports: https://github.com/githubuser/platform/issues -author: Author name here -maintainer: example@example.com -copyright: 2025 Author name here -license: BSD-3-Clause +version: 2025.4.14.1 +description: Please see the README on GitHub at +homepage: https://github.com/pocketsizefund/platform#readme +bug-reports: https://github.com/pocketsizefund/platform/issues +author: pocketsizefund +maintainer: pocketsizefund@gmail.com +copyright: 2025 pocketsizefund +license: MIT build-type: Simple -extra-source-files: - README.md source-repository head type: git - location: https://github.com/githubuser/platform + location: https://github.com/pocketsizefund/platform library exposed-modules: + Account Lib other-modules: Paths_platform - autogen-modules: - Paths_platform hs-source-dirs: src ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints build-depends: aeson , base >=4.7 && <5 + , bytestring + , lens , servant-server , text , wai , wai-logger , warp + , wreq default-language: Haskell2010 executable platform-exe main-is: Main.hs other-modules: Paths_platform - autogen-modules: - Paths_platform hs-source-dirs: app ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: aeson , base + , bytestring + , lens , platform , servant-server , text , wai , wai-logger , warp + , wreq default-language: Haskell2010 test-suite platform-test @@ -66,21 +67,23 @@ test-suite platform-test main-is: Spec.hs other-modules: Paths_platform - autogen-modules: - Paths_platform hs-source-dirs: test ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: aeson , base + , bytestring , hspec , hspec-wai , hspec-wai-json + , lens , platform + , raw-strings-qq , servant-server , text , wai , wai-logger , warp + , wreq default-language: Haskell2010 diff --git a/platform/src/Account.hs b/platform/src/Account.hs new file mode 100644 index 000000000..490fd3ae7 --- /dev/null +++ b/platform/src/Account.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DeriveAnyClass #-} + +module Account (Account(..)) where + +import GHC.Generics (Generic) +import Data.Aeson +import Data.Fixed (Centi) +import Text.Read (readMaybe) + +type Money = Centi + +data Currency = USD + deriving (Show, Read, Eq, Generic, FromJSON, ToJSON) + +data AdminConfigurations = AdminConfigurations + { + allow_instant_ach :: Bool + } deriving (Show, Generic, FromJSON, ToJSON) + +data Account = Account + { id :: String + , account_number :: String + , status :: String + , user_configurations :: Maybe String + , crypto_status :: String + , admin_configurations :: AdminConfigurations + , currency :: String + , cash :: String + , trade_suspended_by_user :: Bool + , daytrade_count :: Int + } deriving (Show, Generic, FromJSON, ToJSON) + diff --git a/platform/src/Lib.hs b/platform/src/Lib.hs index e1db5f68c..65af61529 100644 --- a/platform/src/Lib.hs +++ b/platform/src/Lib.hs @@ -12,20 +12,19 @@ import Data.Aeson import Data.Aeson.TH import Data.Text (Text) import Network.Wai +import Network.Wreq (defaults, header, getWith, responseBody) +import Control.Lens +import Control.Monad.IO.Class (liftIO) import Network.Wai.Handler.Warp -import Servant +import Servant import System.Environment (getEnv) +import qualified Data.ByteString.Char8 as BS +import qualified Data.ByteString.Lazy.Char8 as BL -data User = User - { userId :: Int, - userFirstName :: String, - userLastName :: String - } - deriving (Eq, Show) +import Account -$(deriveJSON defaultOptions ''User) - -type API = "health" :> Get '[PlainText] Text +type API = "health" :> Get '[JSON] NoContent + :<|> "account" :> Get '[JSON] Account app :: Application app = serve api server @@ -34,7 +33,21 @@ api :: Proxy API api = Proxy server :: Server API -server = return "OK" +server = pure NoContent + :<|> getAccount + + +getAccount :: Handler Account +getAccount = do + key <- liftIO $ getEnv "ALPACA_API_KEY" + secret <- liftIO $ getEnv "ALPACA_API_SECRET" + baseUrl <- liftIO $ getEnv "ALPACA_BASE_URL" + + let opts = defaults & header "APCA-API-KEY-ID" .~ [BS.pack key] + & header "APCA-API-SECRET-KEY" .~ [BS.pack secret] + url = baseUrl ++ "/v2/account" -getApiKey :: IO String -getApiKey = getEnv "ALPACA_API_KEY" + r <- liftIO $ getWith opts url + case Data.Aeson.decode (r ^. responseBody) of + Just account -> return account + Nothing -> throwError $ err404 { errBody = "Alpaca account not found or unparseable" } diff --git a/platform/test/Spec.hs b/platform/test/Spec.hs index ace5e8758..316149df1 100644 --- a/platform/test/Spec.hs +++ b/platform/test/Spec.hs @@ -1,10 +1,14 @@ {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} + module Main (main) where import Lib (app) import Test.Hspec import Test.Hspec.Wai +import Text.RawString.QQ + main :: IO () main = hspec spec @@ -14,3 +18,7 @@ spec = with (return app) $ do describe "GET /health" $ do it "responds with 200" $ do get "/health" `shouldRespondWith` 200 + + describe "GET /account" $ do + it "responds with 200" $ do + get "/account" `shouldRespondWith` 200 From 548d7015ec8b00d9bb0814948b5d916e7c4468dd Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:22:53 -0400 Subject: [PATCH 19/29] add test github action --- .github/workflows/{format.yml => format.yaml} | 0 .github/workflows/test.yaml | 21 +++++++++++ .mise.toml | 7 +++- infrastructure/cloud_run.py | 5 +-- platform/app/Main.hs | 3 -- platform/src/Account.hs | 37 +++++++++---------- platform/src/Lib.hs | 37 ++++++++++--------- platform/test/Spec.hs | 3 -- 8 files changed, 64 insertions(+), 49 deletions(-) rename .github/workflows/{format.yml => format.yaml} (100%) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yaml similarity index 100% rename from .github/workflows/format.yml rename to .github/workflows/format.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 000000000..f5e519430 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,21 @@ +name: Run Tests + +on: + pull_request + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install mise + uses: jdx/mise-action@v2 + - name: Run tests + run: mise run teset + - name: Check for changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "code formatting issues found. please run 'mise run fmt' locally and commit the changes." + git diff + exit 1 + fi diff --git a/.mise.toml b/.mise.toml index 5175f52c2..c282770b8 100644 --- a/.mise.toml +++ b/.mise.toml @@ -33,6 +33,10 @@ description = "lint haskell code" depends = ["haskell:format"] run = "hlint ." +[tasks."haskell:test"] +description = "run haskell tests" +run = "cd platform && stack test" + [tasks."platform:run"] description = "run platform in docker compose" run = """ @@ -74,7 +78,6 @@ depends = ["python:lint", "haskell:lint"] description = "lint entire codebase" depends = ["format"] - [tasks."test"] description = "run all tests" -depends = ["python:test", "haskell:test"] +depends = ["haskell:test"] diff --git a/infrastructure/cloud_run.py b/infrastructure/cloud_run.py index c7a2f0ba9..ad877807f 100644 --- a/infrastructure/cloud_run.py +++ b/infrastructure/cloud_run.py @@ -18,7 +18,6 @@ service = cloudrun.Service( "platformservice", - location="us-central1", template=cloudrun.ServiceTemplateArgs( spec=cloudrun.ServiceTemplateSpecArgs( service_account_name=service_account.email, @@ -28,10 +27,10 @@ args=["--period=1"], envs=[ cloudrun.ServiceTemplateSpecContainerEnvArgs( - name="ALPACA_API_KEY_ID", value=api_key + name="ALPACA_API_KEY_ID", value=alpaca_api_key ), cloudrun.ServiceTemplateSpecContainerEnvArgs( - name="ALPACA_API_SECRET_KEY", value=api_secret + name="ALPACA_API_SECRET_KEY", value=alpaca_api_secret ), ], ) diff --git a/platform/app/Main.hs b/platform/app/Main.hs index 250404963..129104770 100644 --- a/platform/app/Main.hs +++ b/platform/app/Main.hs @@ -1,6 +1,4 @@ module Main (main) where -import Network.Wai.Handler.Warp (run, runSettings, defaultSettings, setLogger, setPort) -import Network.Wai.Logger (withStdoutLogger) import Lib import Network.Wai.Handler.Warp (defaultSettings, run, runSettings, setLogger, setPort) @@ -10,4 +8,3 @@ main :: IO () main = withStdoutLogger $ \aplogger -> do let settings = setPort 8080 $ setLogger aplogger defaultSettings runSettings settings app - diff --git a/platform/src/Account.hs b/platform/src/Account.hs index 490fd3ae7..92f547a0f 100644 --- a/platform/src/Account.hs +++ b/platform/src/Account.hs @@ -1,12 +1,11 @@ -{-# LANGUAGE DeriveGeneric #-} -{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveGeneric #-} -module Account (Account(..)) where +module Account (Account (..)) where -import GHC.Generics (Generic) import Data.Aeson import Data.Fixed (Centi) +import GHC.Generics (Generic) import Text.Read (readMaybe) type Money = Centi @@ -14,21 +13,19 @@ type Money = Centi data Currency = USD deriving (Show, Read, Eq, Generic, FromJSON, ToJSON) -data AdminConfigurations = AdminConfigurations - { - allow_instant_ach :: Bool - } deriving (Show, Generic, FromJSON, ToJSON) +newtype AdminConfigurations = AdminConfigurations {allow_instant_ach :: Bool} + deriving (Show, Generic, FromJSON, ToJSON) data Account = Account - { id :: String - , account_number :: String - , status :: String - , user_configurations :: Maybe String - , crypto_status :: String - , admin_configurations :: AdminConfigurations - , currency :: String - , cash :: String - , trade_suspended_by_user :: Bool - , daytrade_count :: Int - } deriving (Show, Generic, FromJSON, ToJSON) - + { id :: String, + account_number :: String, + status :: String, + user_configurations :: Maybe String, + crypto_status :: String, + admin_configurations :: AdminConfigurations, + currency :: String, + cash :: String, + trade_suspended_by_user :: Bool, + daytrade_count :: Int + } + deriving (Show, Generic, FromJSON, ToJSON) diff --git a/platform/src/Lib.hs b/platform/src/Lib.hs index 65af61529..c322a9221 100644 --- a/platform/src/Lib.hs +++ b/platform/src/Lib.hs @@ -1,6 +1,5 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} module Lib @@ -8,23 +7,23 @@ module Lib ) where +import Account +import Control.Lens +import Control.Monad.IO.Class (liftIO) import Data.Aeson import Data.Aeson.TH +import qualified Data.ByteString.Char8 as BS +import qualified Data.ByteString.Lazy.Char8 as BL import Data.Text (Text) import Network.Wai -import Network.Wreq (defaults, header, getWith, responseBody) -import Control.Lens -import Control.Monad.IO.Class (liftIO) import Network.Wai.Handler.Warp -import Servant +import Network.Wreq (defaults, getWith, header, responseBody) +import Servant import System.Environment (getEnv) -import qualified Data.ByteString.Char8 as BS -import qualified Data.ByteString.Lazy.Char8 as BL -import Account - -type API = "health" :> Get '[JSON] NoContent - :<|> "account" :> Get '[JSON] Account +type API = + "health" :> Get '[JSON] NoContent + :<|> "account" :> Get '[JSON] Account app :: Application app = serve api server @@ -33,21 +32,23 @@ api :: Proxy API api = Proxy server :: Server API -server = pure NoContent - :<|> getAccount - +server = + pure NoContent + :<|> getAccount getAccount :: Handler Account getAccount = do - key <- liftIO $ getEnv "ALPACA_API_KEY" + key <- liftIO $ getEnv "ALPACA_API_KEY" secret <- liftIO $ getEnv "ALPACA_API_SECRET" baseUrl <- liftIO $ getEnv "ALPACA_BASE_URL" - let opts = defaults & header "APCA-API-KEY-ID" .~ [BS.pack key] - & header "APCA-API-SECRET-KEY" .~ [BS.pack secret] + let opts = + defaults + & header "APCA-API-KEY-ID" .~ [BS.pack key] + & header "APCA-API-SECRET-KEY" .~ [BS.pack secret] url = baseUrl ++ "/v2/account" r <- liftIO $ getWith opts url case Data.Aeson.decode (r ^. responseBody) of Just account -> return account - Nothing -> throwError $ err404 { errBody = "Alpaca account not found or unparseable" } + Nothing -> throwError $ err404 {errBody = "Alpaca account not found or unparseable"} diff --git a/platform/test/Spec.hs b/platform/test/Spec.hs index 316149df1..32e8145d0 100644 --- a/platform/test/Spec.hs +++ b/platform/test/Spec.hs @@ -1,6 +1,4 @@ {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE QuasiQuotes #-} - module Main (main) where @@ -9,7 +7,6 @@ import Test.Hspec import Test.Hspec.Wai import Text.RawString.QQ - main :: IO () main = hspec spec From 89d50cc1e531ee51790e22a89945879bfcb60aa7 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:25:06 -0400 Subject: [PATCH 20/29] bump version --- platform/package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/package.yaml b/platform/package.yaml index c7eda5930..9a27366f7 100644 --- a/platform/package.yaml +++ b/platform/package.yaml @@ -1,5 +1,5 @@ name: platform -version: 2025.4.14.1 +version: 2025.4.15.1 github: "pocketsizefund/platform" license: MIT author: "pocketsizefund" From 1e4e597949012b3ef82af72b6d900ac4ca3d6ac1 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:26:18 -0400 Subject: [PATCH 21/29] remove unused code --- platform/src/Account.hs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/platform/src/Account.hs b/platform/src/Account.hs index 92f547a0f..657e61c70 100644 --- a/platform/src/Account.hs +++ b/platform/src/Account.hs @@ -4,15 +4,9 @@ module Account (Account (..)) where import Data.Aeson -import Data.Fixed (Centi) import GHC.Generics (Generic) import Text.Read (readMaybe) -type Money = Centi - -data Currency = USD - deriving (Show, Read, Eq, Generic, FromJSON, ToJSON) - newtype AdminConfigurations = AdminConfigurations {allow_instant_ach :: Bool} deriving (Show, Generic, FromJSON, ToJSON) From 25a0844b207642f915c88db43dfa10c09ba1cc57 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:29:29 -0400 Subject: [PATCH 22/29] remove unused imports --- platform/platform.cabal | 2 +- platform/src/Account.hs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/platform.cabal b/platform/platform.cabal index 80ec3f685..6d477e792 100644 --- a/platform/platform.cabal +++ b/platform/platform.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: platform -version: 2025.4.14.1 +version: 2025.4.15.1 description: Please see the README on GitHub at homepage: https://github.com/pocketsizefund/platform#readme bug-reports: https://github.com/pocketsizefund/platform/issues diff --git a/platform/src/Account.hs b/platform/src/Account.hs index 657e61c70..ff2f22ab3 100644 --- a/platform/src/Account.hs +++ b/platform/src/Account.hs @@ -3,9 +3,11 @@ module Account (Account (..)) where + + + import Data.Aeson import GHC.Generics (Generic) -import Text.Read (readMaybe) newtype AdminConfigurations = AdminConfigurations {allow_instant_ach :: Bool} deriving (Show, Generic, FromJSON, ToJSON) From 53c4f0216c9c9d630e360f5835d65a3db82418c7 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:29:48 -0400 Subject: [PATCH 23/29] linting --- platform/src/Account.hs | 3 --- 1 file changed, 3 deletions(-) diff --git a/platform/src/Account.hs b/platform/src/Account.hs index ff2f22ab3..fc8ee5cb1 100644 --- a/platform/src/Account.hs +++ b/platform/src/Account.hs @@ -3,9 +3,6 @@ module Account (Account (..)) where - - - import Data.Aeson import GHC.Generics (Generic) From 75a5e3f0514f7decdcbc2e2436a007131a9de991 Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:41:56 -0400 Subject: [PATCH 24/29] fixing gh actions fixing gh actions --- .github/workflows/lint.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..247b8ba3c --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,23 @@ +name: Format and Lint Check + +on: + pull_request + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Flox + uses: flox/install-flox-action@v2 + - name: Run code formatter and linter + uses: flox/activate-action@v1 + with: + command: LD_PRELOAD= mise run lint + - name: Check for changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "code formatting issues found. please run 'mise run fmt' locally and commit the changes." + git diff + exit 1 + fi From a68ca23c074ee69e1f723416141dd429a52ec5fd Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:46:48 -0400 Subject: [PATCH 25/29] fixing gh actions fixing gh actions --- .flox/env/manifest.lock | 282 ++++++++++++++++++ .flox/env/manifest.toml | 2 + .github/workflows/format.yaml | 23 -- .github/workflows/lint.yaml | 2 +- .mise.toml | 7 +- .python_coverage.output | Bin 0 -> 53248 bytes .python_coverage.xml | 88 ++++++ ....python_coverage.output.Mac.65846.XtbgGYMx | Bin 0 -> 53248 bytes ....python_coverage.output.Mac.66964.XrDTaAix | Bin 0 -> 53248 bytes ....python_coverage.output.Mac.67814.XIKbycjx | Bin 0 -> 53248 bytes ....python_coverage.output.Mac.70641.XXpYmHex | Bin 0 -> 53248 bytes ....python_coverage.output.Mac.71233.XDipnMDx | Bin 0 -> 53248 bytes ....python_coverage.output.Mac.71672.XuNWDaex | Bin 0 -> 53248 bytes ....python_coverage.output.Mac.91521.XCnYDFax | Bin 0 -> 53248 bytes infrastructure/.claude/settings.local.json | 13 + 15 files changed, 389 insertions(+), 28 deletions(-) create mode 100644 .python_coverage.output create mode 100644 .python_coverage.xml create mode 100644 application/.python_coverage.output.Mac.65846.XtbgGYMx create mode 100644 application/.python_coverage.output.Mac.66964.XrDTaAix create mode 100644 application/.python_coverage.output.Mac.67814.XIKbycjx create mode 100644 application/.python_coverage.output.Mac.70641.XXpYmHex create mode 100644 application/.python_coverage.output.Mac.71233.XDipnMDx create mode 100644 application/.python_coverage.output.Mac.71672.XuNWDaex create mode 100644 application/.python_coverage.output.Mac.91521.XCnYDFax create mode 100644 infrastructure/.claude/settings.local.json diff --git a/.flox/env/manifest.lock b/.flox/env/manifest.lock index 2e35a3c6e..b85c37bf9 100644 --- a/.flox/env/manifest.lock +++ b/.flox/env/manifest.lock @@ -21,11 +21,17 @@ "pulumi-python": { "pkg-path": "pulumiPackages.pulumi-python" }, + "ruff": { + "pkg-path": "ruff" + }, "stack": { "pkg-path": "stack" }, "uv": { "pkg-path": "uv" + }, + "vulture": { + "pkg-path": "python313Packages.vulture" } }, "hook": {}, @@ -59,6 +65,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:10:55.991466Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -89,6 +96,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:27:39.376262Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -119,6 +127,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:05.087257Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -149,6 +158,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:01:18.635113Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -179,6 +189,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:10:57.660902Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -208,6 +219,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:27:46.904416Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -237,6 +249,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:06.796396Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -266,6 +279,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:01:27.691760Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -295,6 +309,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:10:58.907487Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -325,6 +340,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:27:49.620205Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -355,6 +371,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:08.047997Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -385,6 +402,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:01:30.731633Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -415,6 +433,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:11:03.963221Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -444,6 +463,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:27:58.867334Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -473,6 +493,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:13.157620Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -502,6 +523,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:01:40.716123Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -531,6 +553,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:11:03.970604Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -560,6 +583,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:27:58.878743Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -589,6 +613,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:13.165089Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -618,6 +643,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:01:40.728310Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -647,6 +673,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:11:03.972083Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -676,6 +703,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:27:58.881041Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -705,6 +733,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:13.166583Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -734,6 +763,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:01:40.730748Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -748,6 +778,126 @@ "group": "toplevel", "priority": 5 }, + { + "attr_path": "ruff", + "broken": false, + "derivation": "/nix/store/x7l0gxy28ps2w7kf1k9kryakp1n8n77k-ruff-0.11.4.drv", + "description": "Extremely fast Python linter and code formatter", + "install_id": "ruff", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ruff-0.11.4", + "pname": "ruff", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:26.130526Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "0.11.4", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/mfhrfmq8770skpwxrx5hkx5wpm51xh53-ruff-0.11.4" + }, + "system": "aarch64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "ruff", + "broken": false, + "derivation": "/nix/store/7gm42n0p5ncwy2z9n33pmr1wiwr7ii2h-ruff-0.11.4.drv", + "description": "Extremely fast Python linter and code formatter", + "install_id": "ruff", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ruff-0.11.4", + "pname": "ruff", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:28:31.703442Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "0.11.4", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/pgzwmlxfh8fkwzxgjf6sfxfb2077acm4-ruff-0.11.4" + }, + "system": "aarch64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "ruff", + "broken": false, + "derivation": "/nix/store/pywdya1p09fy19fdnvpxghalf58xn8mn-ruff-0.11.4.drv", + "description": "Extremely fast Python linter and code formatter", + "install_id": "ruff", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ruff-0.11.4", + "pname": "ruff", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:35.317449Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "0.11.4", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/60k9zc274iy7iiy6akvgk6qx1wnxpg9h-ruff-0.11.4" + }, + "system": "x86_64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "ruff", + "broken": false, + "derivation": "/nix/store/w1arkqbhgrvwwx52jfx0ypp9830kifdr-ruff-0.11.4.drv", + "description": "Extremely fast Python linter and code formatter", + "install_id": "ruff", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "ruff-0.11.4", + "pname": "ruff", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:02:15.558190Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "0.11.4", + "outputs_to_install": [ + "out" + ], + "outputs": { + "out": "/nix/store/6vk3yddpa38q500sr6pv787snimyx0ch-ruff-0.11.4" + }, + "system": "x86_64-linux", + "group": "toplevel", + "priority": 5 + }, { "attr_path": "stack", "broken": false, @@ -763,6 +913,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:11:34.508407Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -793,6 +944,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:28:43.273475Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -822,6 +974,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:43.747150Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -851,6 +1004,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:02:27.830908Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -880,6 +1034,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:11:44.987063Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -909,6 +1064,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:28:57.932781Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -938,6 +1094,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T01:43:54.280618Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -967,6 +1124,7 @@ "rev_date": "2025-04-08T07:41:42Z", "scrape_date": "2025-04-10T02:02:43.334041Z", "stabilities": [ + "staging", "unstable" ], "unfree": false, @@ -980,6 +1138,130 @@ "system": "x86_64-linux", "group": "toplevel", "priority": 5 + }, + { + "attr_path": "python313Packages.vulture", + "broken": false, + "derivation": "/nix/store/5nhhmhb3zc3sjyncj98js9r235sc7a11-python3.13-vulture-2.14.drv", + "description": "Finds unused code in Python programs", + "install_id": "vulture", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "python3.13-vulture-2.14", + "pname": "vulture", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:11:21.873348Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "2.14", + "outputs_to_install": [ + "out" + ], + "outputs": { + "dist": "/nix/store/snjkijzwb49dqp8basn9yx4cy6acbhnd-python3.13-vulture-2.14-dist", + "out": "/nix/store/3x3kf8slnv0pq9q1hzmv4f3bq9nsqli4-python3.13-vulture-2.14" + }, + "system": "aarch64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "python313Packages.vulture", + "broken": false, + "derivation": "/nix/store/l36mld8azl0lyisxrslppfimwjvxdrzs-python3.13-vulture-2.14.drv", + "description": "Finds unused code in Python programs", + "install_id": "vulture", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "python3.13-vulture-2.14", + "pname": "vulture", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:28:25.099577Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "2.14", + "outputs_to_install": [ + "out" + ], + "outputs": { + "dist": "/nix/store/k9mchys1gj33g6y571q110cgz6k84gb0-python3.13-vulture-2.14-dist", + "out": "/nix/store/1crzanxjz4fq91rwwj6j77vfzjvylmq8-python3.13-vulture-2.14" + }, + "system": "aarch64-linux", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "python313Packages.vulture", + "broken": false, + "derivation": "/nix/store/brgb70n2p70hjwgq2hj2khj274q6g8pd-python3.13-vulture-2.14.drv", + "description": "Finds unused code in Python programs", + "install_id": "vulture", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "python3.13-vulture-2.14", + "pname": "vulture", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T01:43:31.038776Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "2.14", + "outputs_to_install": [ + "out" + ], + "outputs": { + "dist": "/nix/store/liscpk0vdckwf7fix5x63nbv94q5v8g3-python3.13-vulture-2.14-dist", + "out": "/nix/store/fvjcfmm678b9xwmh5hd4yn5fjvsan1kh-python3.13-vulture-2.14" + }, + "system": "x86_64-darwin", + "group": "toplevel", + "priority": 5 + }, + { + "attr_path": "python313Packages.vulture", + "broken": false, + "derivation": "/nix/store/0f8szw1j8rcjf70q6dbj8sqvk39k7kgl-python3.13-vulture-2.14.drv", + "description": "Finds unused code in Python programs", + "install_id": "vulture", + "license": "MIT", + "locked_url": "https://github.com/flox/nixpkgs?rev=c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "name": "python3.13-vulture-2.14", + "pname": "vulture", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev_count": 780821, + "rev_date": "2025-04-08T07:41:42Z", + "scrape_date": "2025-04-10T02:02:08.518306Z", + "stabilities": [ + "staging", + "unstable" + ], + "unfree": false, + "version": "2.14", + "outputs_to_install": [ + "out" + ], + "outputs": { + "dist": "/nix/store/zz4wd205aaz77qjv4laligilydbhxdad-python3.13-vulture-2.14-dist", + "out": "/nix/store/47avpfjz1i567abwyrpzkndfhxgs58ya-python3.13-vulture-2.14" + }, + "system": "x86_64-linux", + "group": "toplevel", + "priority": 5 } ] } \ No newline at end of file diff --git a/.flox/env/manifest.toml b/.flox/env/manifest.toml index 552e22527..65be57c37 100644 --- a/.flox/env/manifest.toml +++ b/.flox/env/manifest.toml @@ -10,6 +10,8 @@ pulumi-language-python.pkg-path = "pulumiPackages.pulumi-language-python" pulumi-python.pkg-path = "pulumiPackages.pulumi-python" ormolu.pkg-path = "ormolu" hlint.pkg-path = "hlint" +ruff.pkg-path = "ruff" +vulture.pkg-path = "python313Packages.vulture" [vars] diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 9ecf992ba..e69de29bb 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -1,23 +0,0 @@ -name: Format check - -on: - pull_request - -jobs: - format: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install mise - uses: jdx/mise-action@v2 - - name: Run code formatter - run: mise run fmt - - name: Run code linter - run: mise run lint - - name: Check for changes - run: | - if [[ -n $(git status --porcelain) ]]; then - echo "code formatting issues found. please run 'mise run fmt' locally and commit the changes." - git diff - exit 1 - fi diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 247b8ba3c..4fef3b9ac 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: - name: Run code formatter and linter uses: flox/activate-action@v1 with: - command: LD_PRELOAD= mise run lint + command: mise run lint - name: Check for changes run: | if [[ -n $(git status --porcelain) ]]; then diff --git a/.mise.toml b/.mise.toml index c282770b8..a7c09fc1e 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,16 +1,15 @@ [tasks."python:check"] description="run python code quality checks across the full repository" run = """ -uvx ruff check \ +ruff check \ --output-format=github \ . - """ [tasks."python:dead-code"] description="check for dead python code" run = """ -uvx vulture \ +vulture \ --min-confidence 80 \ --exclude '.flox,.venv,target' \ . @@ -18,7 +17,7 @@ uvx vulture \ [tasks."python:format"] description="format python code" -run = "uvx ruff format" +run = "ruff format" [tasks."python:lint"] depends = ["python:check", "python:dead-code", "python:format"] diff --git a/.python_coverage.output b/.python_coverage.output new file mode 100644 index 0000000000000000000000000000000000000000..5812169f6ce22f95261fc18bb0e44a6cee1a5dfe GIT binary patch literal 53248 zcmeI)&2QUe90zba&XPGz=0O=zRgFFu=%TgFDh|9ISb-iUCXK=1Qi<$|^Q83_+nMcj zEfS1uNRx*64-iMVapBJYz!`BsTqYreHt}*82Yx@lG)dc3yOb*9Yvsi+&+Es}OPsWR z@A5?_Qljk#u8hQs+DT2ztpm%*}ecY<4E!{p}u|Cksg)cPg z!^$OVvHWG_g{dFPu6b|jtD-b*I)DWN5P$##{@()q%jIHqW=6mLaU`1^6$R2(LGoI8 z^WD{zE34wl${QC~MY2zvDG6E@7sZMQ{F|by0?~FlN;qE2v1R0V>mu4vS?FG zo~^>96la`PtyH^nt5mE`PwRJ8TqhaW^q3l{4ec0I|>vsea_{e zz9XkIBj+=k#Ois@jh@;$`3qtYb0MyV=PwAZ1hs(YrwY|qrge>4rP>N_bm;R|L-ry+ z-fqyzZ!FVG`Lm~v7prq~`rR9GLt&mq(}}{J6?3G~?Cc)XboluAcEi17w2^Qx>U4zP zj=K!U7Rkw>);!#2>KTR%xT6U_4M-(D($>a>r80;>6Ca?l`|#Tbl|SszJ{P<0lIh3d-exay?g8q4X*@qRI1te!fh z_mdvM;}SoQjZ}j747$LsiQw^z-<8pZ*jskqO$DDnR;a#qYFxp&2#sZaE!F*un41P5$M3M`v`FN)hQZ^q4&=bk}% zlLQ9anLUN7#lfk2zvG9YL(?ixTj8tOUNOHRLmq{~dC~O!j*?z7H&BcVA?4|WA}+(; zS?Tpb8sRplvA#JUmnoZEc$mLJoi6KNwBowbYo+rQPs2&7H1>1nXadM z(Oqd~iKa(+#LCiN>XHek>dIEq-T9;prFe5g?MW_~joy-xiX2x74iXn8Zdf;EDC|Jd zL7Gcz^Tt8VfX`NAnP2%T`8a=+>(A-M>e;h;zn6B#WSnV)G^x8XD|Wh>8)+oF4i4JO zB^q$))6Q@^VY?v?-b`}f!7Vw1%|sy!m44PK)%XHmw;pNqzybjXKmY;|fB*y_009U< z00Izzz>_Cn=sCT}*Z(=|XU+PZUa&v_0uX=z1Rwwb2tWV=5P$##ATXH%<(zTa%KpUT zoTVGH)%1@5URrv2>0F6wm9y?^)_v>G$*dqs4FL#100Izz00bZa0SG_<0uX>eCQvp` z>)E#exsow!re6Z^@BhY$uQltQHBE0=AOHafKmY;|fB*y_009U<00KuSaNWpj{k8i0 zA>9$6Zf^umC|j-VdN=T|DLV@5UEjX0qR{zB(S1EyyEkRG+llW73##Q@!cfNu5? z)Wg6Y*>p^!r(kWZ_KggDDui=pz-C2Pu%fJ5{ zC%)0F&#hn-`216h6Mr;fB*y_009U<00Izz z00bZafyoj$VdQo5IpdSf@4mlP`{|c*DM#DS<{tKMeX1ArylFoD@LMzf|9|T@&3a`0 zL2pR?R}AHc00bZa z0SG_<0uX=z1Rwwb2teQ<0sj3T*Z&6z;TQxU009U<00Izz00bZa0SG`~@&%Ir|9`-L t|NocuVDjsO8bAO75P$##AOHafKmY;|fB*y_KmvwAcl|eV{KEJD{}=xFMEC#z literal 0 HcmV?d00001 diff --git a/.python_coverage.xml b/.python_coverage.xml new file mode 100644 index 000000000..95c8173d2 --- /dev/null +++ b/.python_coverage.xml @@ -0,0 +1,88 @@ + + + + + + /Users/chrisaddy/projects/pocketsizefund/pocketsizefund + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/.python_coverage.output.Mac.65846.XtbgGYMx b/application/.python_coverage.output.Mac.65846.XtbgGYMx new file mode 100644 index 0000000000000000000000000000000000000000..67aabbc3d83946012f05e824ea0c55854e439968 GIT binary patch literal 53248 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 ZF Date: Tue, 15 Apr 2025 21:54:16 -0400 Subject: [PATCH 26/29] fixing gh actions --- .github/workflows/format.yaml | 46 +++++++++++++++++++++++++++++++++++ .mise.toml | 22 ++++++++--------- 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index e69de29bb..9c494702b 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -0,0 +1,46 @@ +name: Format check + +on: + pull_request + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install mise + uses: jdx/mise-action@v2 + - name: Run code formatter + run: mise run fmt + - name: Run code linter + run: mise run lint + - name: Check for changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "code formatting issues found. please run 'mise run fmt' locally and commit the changes." + git diff + exit 1 + fi +name: Format check + +on: + pull_request + +jobs: + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install mise + uses: jdx/mise-action@v2 + - name: Run code formatter + run: mise run format + - name: Run code linter + run: mise run lint + - name: Check for changes + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "code formatting issues found. please run 'mise run fmt' locally and commit the changes." + git diff + exit 1 + fi diff --git a/.mise.toml b/.mise.toml index a7c09fc1e..69502addd 100644 --- a/.mise.toml +++ b/.mise.toml @@ -1,12 +1,9 @@ -[tasks."python:check"] -description="run python code quality checks across the full repository" -run = """ -ruff check \ - --output-format=github \ - . -""" +[tasks."python:format"] +description="format python code" +run = "ruff format" [tasks."python:dead-code"] +depends = ["python:format"] description="check for dead python code" run = """ vulture \ @@ -15,13 +12,14 @@ vulture \ . """ -[tasks."python:format"] -description="format python code" -run = "ruff format" - [tasks."python:lint"] -depends = ["python:check", "python:dead-code", "python:format"] +depends = ["python:dead-code"] description="run python code quality checks across the full repository" +run = """ +ruff check \ + --output-format=github \ + . +""" [tasks."haskell:format"] description = "lint haskell code" From 393595e717db9ee6f94cf8019a203d9dbf122f1f Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Tue, 15 Apr 2025 21:56:11 -0400 Subject: [PATCH 27/29] fixing gh actions --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 4fef3b9ac..e31573ac8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: - name: Run code formatter and linter uses: flox/activate-action@v1 with: - command: mise run lint + command: LD_PRELOAD="" mise run lint - name: Check for changes run: | if [[ -n $(git status --porcelain) ]]; then From c6d71ba5287acb8be68e65862f9020fb9b8e8b33 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Wed, 16 Apr 2025 17:15:43 -0400 Subject: [PATCH 28/29] Delete CNAME --- CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 CNAME diff --git a/CNAME b/CNAME deleted file mode 100644 index 7530e875b..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -pocketsize.fund \ No newline at end of file From 30ec9245e3513ac861c13e74666636554db9ce5f Mon Sep 17 00:00:00 2001 From: Chris Addy Date: Wed, 16 Apr 2025 20:44:09 -0400 Subject: [PATCH 29/29] Create CNAME Delete CNAME update Aeson parser tidy nitpicks --- .flox/env/manifest.toml | 20 ++------ .github/workflows/format.yaml | 1 + .gitignore | 1 - LICENSE.md | 21 --------- platform/Dockerfile | 21 --------- platform/Setup.hs | 3 -- platform/app/Main.hs | 10 ---- platform/compose.yaml | 10 ---- platform/package.yaml | 64 ------------------------- platform/platform.cabal | 89 ----------------------------------- platform/src/Account.hs | 24 ---------- platform/src/Lib.hs | 54 --------------------- platform/stack.yaml | 8 ---- platform/stack.yaml.lock | 13 ----- platform/test/Spec.hs | 21 --------- 15 files changed, 5 insertions(+), 355 deletions(-) delete mode 100644 LICENSE.md delete mode 100644 platform/Dockerfile delete mode 100644 platform/Setup.hs delete mode 100644 platform/app/Main.hs delete mode 100644 platform/compose.yaml delete mode 100644 platform/package.yaml delete mode 100644 platform/platform.cabal delete mode 100644 platform/src/Account.hs delete mode 100644 platform/src/Lib.hs delete mode 100644 platform/stack.yaml delete mode 100644 platform/stack.yaml.lock delete mode 100644 platform/test/Spec.hs diff --git a/.flox/env/manifest.toml b/.flox/env/manifest.toml index 65be57c37..f4b678406 100644 --- a/.flox/env/manifest.toml +++ b/.flox/env/manifest.toml @@ -1,29 +1,17 @@ version = 1 - [install] -stack.pkg-path = "stack" -uv.pkg-path = "uv" +hlint.pkg-path = "hlint" mise.pkg-path = "mise" +ormolu.pkg-path = "ormolu" pulumi.pkg-path = "pulumi" pulumi-language-python.pkg-path = "pulumiPackages.pulumi-language-python" pulumi-python.pkg-path = "pulumiPackages.pulumi-python" -ormolu.pkg-path = "ormolu" -hlint.pkg-path = "hlint" ruff.pkg-path = "ruff" +stack.pkg-path = "stack" +uv.pkg-path = "uv" vulture.pkg-path = "python313Packages.vulture" -[vars] - -[hook] - -[profile] - -[services] - - -[options] - systems = [ "aarch64-darwin", "aarch64-linux", diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 9c494702b..d9e735cae 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml @@ -35,6 +35,7 @@ jobs: uses: jdx/mise-action@v2 - name: Run code formatter run: mise run format + run: mise run fmt - name: Run code linter run: mise run lint - name: Check for changes diff --git a/.gitignore b/.gitignore index 331a5c6bb..48c173c89 100644 --- a/.gitignore +++ b/.gitignore @@ -38,7 +38,6 @@ venv.bak/ *.venv *.log -*.DS_Store *.swp *.swo .idea/ diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index d34a3198f..000000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Pocket Size Fund - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/platform/Dockerfile b/platform/Dockerfile deleted file mode 100644 index 30952d320..000000000 --- a/platform/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM haskell:9.8.4 AS builder - -WORKDIR /app - -RUN mkdir -p src app test && touch README.md - -COPY stack.yaml stack.yaml.lock package.yaml ./ -RUN stack setup && stack build --only-dependencies - -COPY . . - -RUN stack build -RUN cp "$(stack path --local-install-root)/bin/platform-exe" /app/platform-exe - -FROM debian:bullseye-slim AS production - -RUN apt-get update && apt-get install -y libgmp10 ca-certificates && rm -rf /var/lib/apt/lists/* - -COPY --from=builder /app/platform-exe /usr/local/bin/app - -ENTRYPOINT ["/usr/local/bin/app"] diff --git a/platform/Setup.hs b/platform/Setup.hs deleted file mode 100644 index e8ef27dbb..000000000 --- a/platform/Setup.hs +++ /dev/null @@ -1,3 +0,0 @@ -import Distribution.Simple - -main = defaultMain diff --git a/platform/app/Main.hs b/platform/app/Main.hs deleted file mode 100644 index 129104770..000000000 --- a/platform/app/Main.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Main (main) where - -import Lib -import Network.Wai.Handler.Warp (defaultSettings, run, runSettings, setLogger, setPort) -import Network.Wai.Logger (withStdoutLogger) - -main :: IO () -main = withStdoutLogger $ \aplogger -> do - let settings = setPort 8080 $ setLogger aplogger defaultSettings - runSettings settings app diff --git a/platform/compose.yaml b/platform/compose.yaml deleted file mode 100644 index 1f8fbe5db..000000000 --- a/platform/compose.yaml +++ /dev/null @@ -1,10 +0,0 @@ -services: - platform: - build: - context: . - dockerfile: Dockerfile - platform: linux/amd64 - container_name: platform - ports: - - "8080:8080" - restart: unless-stopped diff --git a/platform/package.yaml b/platform/package.yaml deleted file mode 100644 index 9a27366f7..000000000 --- a/platform/package.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: platform -version: 2025.4.15.1 -github: "pocketsizefund/platform" -license: MIT -author: "pocketsizefund" -maintainer: "pocketsizefund@gmail.com" -copyright: "2025 pocketsizefund" - -description: Please see the README on GitHub at - -dependencies: -- base >= 4.7 && < 5 -- aeson -- servant-server -- wai -- wai-logger -- warp -- text -- wreq -- lens -- bytestring - -ghc-options: -- -Wall -- -Wcompat -- -Widentities -- -Wincomplete-record-updates -- -Wincomplete-uni-patterns -- -Wmissing-export-lists -- -Wmissing-home-modules -- -Wpartial-fields -- -Wredundant-constraints - -library: - source-dirs: src - -executables: - platform-exe: - main: Main.hs - source-dirs: app - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - base - - platform - -tests: - platform-test: - main: Spec.hs - source-dirs: test - ghc-options: - - -threaded - - -rtsopts - - -with-rtsopts=-N - dependencies: - - base - - platform - - hspec - - hspec-wai - - hspec-wai-json - - aeson - - raw-strings-qq diff --git a/platform/platform.cabal b/platform/platform.cabal deleted file mode 100644 index 6d477e792..000000000 --- a/platform/platform.cabal +++ /dev/null @@ -1,89 +0,0 @@ -cabal-version: 1.12 - --- This file has been generated from package.yaml by hpack version 0.37.0. --- --- see: https://github.com/sol/hpack - -name: platform -version: 2025.4.15.1 -description: Please see the README on GitHub at -homepage: https://github.com/pocketsizefund/platform#readme -bug-reports: https://github.com/pocketsizefund/platform/issues -author: pocketsizefund -maintainer: pocketsizefund@gmail.com -copyright: 2025 pocketsizefund -license: MIT -build-type: Simple - -source-repository head - type: git - location: https://github.com/pocketsizefund/platform - -library - exposed-modules: - Account - Lib - other-modules: - Paths_platform - hs-source-dirs: - src - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints - build-depends: - aeson - , base >=4.7 && <5 - , bytestring - , lens - , servant-server - , text - , wai - , wai-logger - , warp - , wreq - default-language: Haskell2010 - -executable platform-exe - main-is: Main.hs - other-modules: - Paths_platform - hs-source-dirs: - app - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N - build-depends: - aeson - , base - , bytestring - , lens - , platform - , servant-server - , text - , wai - , wai-logger - , warp - , wreq - default-language: Haskell2010 - -test-suite platform-test - type: exitcode-stdio-1.0 - main-is: Spec.hs - other-modules: - Paths_platform - hs-source-dirs: - test - ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N - build-depends: - aeson - , base - , bytestring - , hspec - , hspec-wai - , hspec-wai-json - , lens - , platform - , raw-strings-qq - , servant-server - , text - , wai - , wai-logger - , warp - , wreq - default-language: Haskell2010 diff --git a/platform/src/Account.hs b/platform/src/Account.hs deleted file mode 100644 index fc8ee5cb1..000000000 --- a/platform/src/Account.hs +++ /dev/null @@ -1,24 +0,0 @@ -{-# LANGUAGE DeriveAnyClass #-} -{-# LANGUAGE DeriveGeneric #-} - -module Account (Account (..)) where - -import Data.Aeson -import GHC.Generics (Generic) - -newtype AdminConfigurations = AdminConfigurations {allow_instant_ach :: Bool} - deriving (Show, Generic, FromJSON, ToJSON) - -data Account = Account - { id :: String, - account_number :: String, - status :: String, - user_configurations :: Maybe String, - crypto_status :: String, - admin_configurations :: AdminConfigurations, - currency :: String, - cash :: String, - trade_suspended_by_user :: Bool, - daytrade_count :: Int - } - deriving (Show, Generic, FromJSON, ToJSON) diff --git a/platform/src/Lib.hs b/platform/src/Lib.hs deleted file mode 100644 index c322a9221..000000000 --- a/platform/src/Lib.hs +++ /dev/null @@ -1,54 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TypeOperators #-} - -module Lib - ( app, - ) -where - -import Account -import Control.Lens -import Control.Monad.IO.Class (liftIO) -import Data.Aeson -import Data.Aeson.TH -import qualified Data.ByteString.Char8 as BS -import qualified Data.ByteString.Lazy.Char8 as BL -import Data.Text (Text) -import Network.Wai -import Network.Wai.Handler.Warp -import Network.Wreq (defaults, getWith, header, responseBody) -import Servant -import System.Environment (getEnv) - -type API = - "health" :> Get '[JSON] NoContent - :<|> "account" :> Get '[JSON] Account - -app :: Application -app = serve api server - -api :: Proxy API -api = Proxy - -server :: Server API -server = - pure NoContent - :<|> getAccount - -getAccount :: Handler Account -getAccount = do - key <- liftIO $ getEnv "ALPACA_API_KEY" - secret <- liftIO $ getEnv "ALPACA_API_SECRET" - baseUrl <- liftIO $ getEnv "ALPACA_BASE_URL" - - let opts = - defaults - & header "APCA-API-KEY-ID" .~ [BS.pack key] - & header "APCA-API-SECRET-KEY" .~ [BS.pack secret] - url = baseUrl ++ "/v2/account" - - r <- liftIO $ getWith opts url - case Data.Aeson.decode (r ^. responseBody) of - Just account -> return account - Nothing -> throwError $ err404 {errBody = "Alpaca account not found or unparseable"} diff --git a/platform/stack.yaml b/platform/stack.yaml deleted file mode 100644 index 9e38cdb80..000000000 --- a/platform/stack.yaml +++ /dev/null @@ -1,8 +0,0 @@ -snapshot: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml - -packages: -- . - - -notify-if-nix-on-path: false diff --git a/platform/stack.yaml.lock b/platform/stack.yaml.lock deleted file mode 100644 index 2226a95bc..000000000 --- a/platform/stack.yaml.lock +++ /dev/null @@ -1,13 +0,0 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: [] -snapshots: -- completed: - sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b - size: 683827 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml - original: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml diff --git a/platform/test/Spec.hs b/platform/test/Spec.hs deleted file mode 100644 index 32e8145d0..000000000 --- a/platform/test/Spec.hs +++ /dev/null @@ -1,21 +0,0 @@ -{-# LANGUAGE OverloadedStrings #-} - -module Main (main) where - -import Lib (app) -import Test.Hspec -import Test.Hspec.Wai -import Text.RawString.QQ - -main :: IO () -main = hspec spec - -spec :: Spec -spec = with (return app) $ do - describe "GET /health" $ do - it "responds with 200" $ do - get "/health" `shouldRespondWith` 200 - - describe "GET /account" $ do - it "responds with 200" $ do - get "/account" `shouldRespondWith` 200