Compare commits

...
Sign in to create a new pull request.

10 commits

Author SHA1 Message Date
1a6baa4ee4
chore: bunch of devcontainer and devops stuff
Some checks failed
Actions / Build Documentation (MkDocs) (push) Failing after 8s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 10s
Actions / Build (push) Successful in 12s
2025-01-29 11:39:23 +00:00
d93a9b57e9
feat: set up port forwarding
Some checks failed
Actions / Build (push) Successful in 12s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 15s
Actions / Build Documentation (MkDocs) (push) Successful in 22s
2025-01-29 11:04:53 +00:00
9d81ab38dd
feat: enable docker in docker in the devcontainer
Some checks failed
Actions / Build (push) Successful in 13s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 14s
Actions / Build Documentation (MkDocs) (push) Successful in 22s
2025-01-29 10:59:02 +00:00
4356722acd
fix: downgrade to python 3.10
Some checks failed
Actions / Build (push) Successful in 12s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 15s
Actions / Build Documentation (MkDocs) (push) Successful in 22s
2025-01-29 10:58:26 +00:00
f87c36bff1
fix: typo
Some checks failed
Actions / Build (push) Successful in 13s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 15s
Actions / Build Documentation (MkDocs) (push) Successful in 22s
2025-01-29 04:53:15 -06:00
ceea6b5f8a
fix: fix the zipline container's restart loop
Some checks failed
Actions / Build (push) Successful in 12s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 15s
Actions / Build Documentation (MkDocs) (push) Successful in 22s
2025-01-29 04:49:05 -06:00
351a3ad799
fix: relative path
Some checks failed
Actions / Build (push) Successful in 13s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 15s
Actions / Build Documentation (MkDocs) (push) Successful in 23s
2025-01-29 04:35:39 -06:00
f46bc185d9
fix: improper build context
Some checks failed
Actions / Build (push) Successful in 13s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 16s
Actions / Build Documentation (MkDocs) (push) Successful in 23s
2025-01-29 04:34:57 -06:00
ff554ddcb4
feat: add dev container
Some checks failed
Actions / Build (push) Successful in 12s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 16s
Actions / Build Documentation (MkDocs) (push) Successful in 22s
2025-01-29 04:33:24 -06:00
70a84ba1b4
fixed documentation failing to build 2025-01-29 04:33:01 -06:00
15 changed files with 584 additions and 381 deletions

29
.devcontainer/Dockerfile Normal file
View file

@ -0,0 +1,29 @@
FROM ghcr.io/astral-sh/uv:0.5.25 AS uv
FROM python:3.10-slim AS python
FROM code.forgejo.org/forgejo/runner:6.2.0@sha256:936c4fef04f0e2bda86c325b8ef40359aeead4740a48b1d5a0c9a112f1185e45 AS forgejo-runner
FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm@sha256:6155a486f236fd5127b76af33086029d64f64cf49dd504accb6e5f949098eb7e
LABEL repository="www.coastalcommits.com/cswimr/PyZipline"
LABEL maintainer="cswimr <seaswimmerthefsh@gmail.com>"
RUN apt-get update; \
apt-get install -y --no-install-recommends \
# MkDocs Social dependencies
libcairo2-dev \
libfreetype6-dev \
libffi-dev \
libjpeg-dev \
libpng-dev \
libz-d \
pngquant; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
COPY --from=uv --chown=vscode: /uv /uvx /bin/
COPY --from=python --chown=vscode: /usr/local /usr/local
COPY --from=forgejo-runner --chown=vscode: /bin/forgejo-runner /bin/forgejo-runner
COPY --chown=vscode: .devcontainer/home/* /home/vscode/
RUN ln -s /usr/local/bin/python3.10 /usr/local/bin/python; \
python --version; \
python -m ensurepip

View file

@ -0,0 +1,47 @@
{
"name": "PyZipline",
"dockerComposeFile": "docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"customizations": {
"vscode": {
"settings": {
"python.terminal.activateEnvInCurrentTerminal": true,
"python.terminal.activateEnvironment": true,
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
},
"extensions": [
"charliermarsh.ruff",
"ms-python.python",
"tekumara.typos-vscode",
"tamasfe.even-better-toml",
"redhat.vscode-yaml",
"DavidAnson.vscode-markdownlint",
"aaron-bond.better-comments",
"donjayamanne.githistory",
"eamodio.gitlens"
]
}
},
"forwardPorts": [
"zipline:3000"
],
"containerEnv": {
"DISPLAY": "dummy",
"PYTHONUNBUFFERED": "True",
"UV_LINK_MODE": "copy",
"UV_PYTHON_PREFERENCE": "only-system",
"UV_PYTHON_DOWNLOADS": "never",
"PROJECT_DIR": "/workspaces/${localWorkspaceFolderBasename}"
},
"postCreateCommand": "uv sync --frozen --group=docs",
"remoteUser": "vscode"
}

View file

@ -0,0 +1,54 @@
services:
devcontainer:
container_name: devcontainer
build:
context: ..
dockerfile: .devcontainer/Dockerfile
volumes:
- ../..:/workspaces:cached
network_mode: service:zipline
command: sleep infinity
postgres:
container_name: zipline-database
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: zipline
POSTGRES_PASSWORD: zipline
POSTGRES_DATABASE: zipline
volumes:
- pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
zipline:
container_name: zipline
image: ghcr.io/diced/zipline:v4
environment:
CORE_SECRET: "4Q8PrvM8Vwe9yRSRsCuwTdQUSXLYkgt9Gvdg/7/qPgQ="
CORE_HOSTNAME: 0.0.0.0
DATABASE_URL: postgres://zipline:zipline@postgres:5432/zipline
DATASOURCE_TYPE: local
DATASOURCE_LOCAL_DIRECTORY: /zipline/uploads
restart: unless-stopped
volumes:
- data:/zipline/public
- themes:/zipline/themes
- uploads:/zipline/uploads
depends_on:
- "postgres"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:3001 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
volumes:
pg_data:
data:
themes:
uploads:

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
alias runactions="forgejo-runner exec --default-actions-url=https://www.coastalcommits.com --gitea-instance=https://www.coastalcommits.com"

View file

@ -1,6 +1,8 @@
name: Actions
on:
push:
branches:
- main
pull_request:
jobs:
@ -15,7 +17,7 @@ jobs:
fetch-depth: 0
- name: Install python
run: uv python install 3.11
run: uv python install 3.10
- name: Install dependencies
run: uv sync --no-dev
@ -26,7 +28,7 @@ jobs:
- name: Upload the package
uses: actions/upload-artifact@v3
with:
name: pyflowery
name: pyzipline
path: ./dist/*
- name: Publish to CoastalCommits
@ -55,7 +57,7 @@ jobs:
fetch-depth: 0
- name: Install python
run: uv python install 3.11
run: uv python install 3.10
- name: Install dependencies
run: uv sync
@ -77,10 +79,10 @@ jobs:
fetch-depth: 0
- name: Install python
run: uv python install 3.11
run: uv python install 3.10
- name: Install dependencies
run: uv sync --extra docs
run: uv sync --group docs
- name: Set environment variables
uses: actions/env@v2

6
.gitignore vendored
View file

@ -1,6 +1,8 @@
__pycache__
.cache
.zipline
.venv
dev.py
dist/
pyzipline.egg-info/
dist
pyzipline.egg-info
site

22
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,22 @@
{
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"editor.formatOnSave": true,
"files.exclude": {
"**/.git": true,
"**/__pycache__": true,
"**/.ruff_cache": true,
"**/.mypy_cache": true,
"**/*.egg-info": true,
}
}

27
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "MkDocs: Build Documentation",
"type": "shell",
"command": "uv",
"args": [
"run",
"mkdocs",
"build",
],
"problemMatcher": []
},
{
"label": "Forgejo Actions: Run Actions",
"type": "shell",
"command": "forgejo-runner",
"args": [
"exec",
"--default-actions-url=https://www.coastalcommits.com",
"--gitea-instance=https://www.coastalcommits.com"
],
"problemMatcher": []
}
]
}

View file

@ -1,3 +1,3 @@
# Exceptions
::: pyzipline.exceptions
::: exceptions

View file

@ -1,3 +1,3 @@
# Models Reference
::: pyzipline.models
::: models

View file

@ -6,4 +6,4 @@ These functions are meant for use in other parts of the module. You *probably* s
If there's an endpoint method missing from the main [ZiplineApi](zipline.md) class, you should open an [issue](https://coastalcommits.com/SeaswimmerTheFsh/PyZipline/issues) (or a [pull request](https://coastalcommits.com/SeaswimmerTheFsh/PyZipline/pulls)).
///
::: pyzipline.rest_adapter
::: rest_adapter

View file

@ -1,3 +1,3 @@
# Utilities
::: pyzipline.utils
::: utils

View file

@ -1,3 +1,3 @@
# ZiplineApi
::: pyzipline.zipline
::: zipline

View file

@ -2,30 +2,19 @@
name = "pyzipline"
version = "0.1.0"
description = "Python API Wrapper for the Zipline API"
authors = [{name="cswimr", email="seaswimmerthefsh@gmail.com"}]
license = {file="LICENSE"}
authors = [{ name = "cswimr", email = "seaswimmerthefsh@gmail.com" }]
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"aiohttp>=3.10.10",
"asyncio>=3.4.3",
"pydantic>=2.9.2",
"requests>=2.32.3",
]
dependencies = ["aiohttp>=3.10.10", "asyncio>=3.4.3", "pydantic>=2.10.6"]
[project.optional-dependencies]
[dependency-groups]
docs = [
"mkdocs>=1.6.1",
"mkdocs-git-authors-plugin>=0.9.0",
"mkdocstrings[python]>=0.26.2",
"mkdocs-git-revision-date-localized-plugin>=1.2.9",
"mkdocs-material[imaging]>=9.5.42",
"mkdocs-redirects>=1.2.1",
]
[tool.uv]
dev-dependencies = [
"datamodel-code-generator>=0.26.2",
"pylint>=3.3.1",
"ruff>=0.7.0",
"mkdocs-git-authors-plugin>=0.9.2",
"mkdocs-git-revision-date-localized-plugin>=1.3.0",
"mkdocs-material[imaging]>=9.5.50",
"mkdocs-redirects>=1.2.2",
"mkdocstrings[python]>=0.27.0",
]
dev = ["datamodel-code-generator>=0.26.5", "pylint>=3.3.4", "ruff>=0.9.3"]

724
uv.lock generated

File diff suppressed because it is too large Load diff