Compare commits
10 commits
renovate/c
...
main
Author | SHA1 | Date | |
---|---|---|---|
1a6baa4ee4 | |||
d93a9b57e9 | |||
9d81ab38dd | |||
4356722acd | |||
f87c36bff1 | |||
ceea6b5f8a | |||
351a3ad799 | |||
f46bc185d9 | |||
ff554ddcb4 | |||
70a84ba1b4 |
15 changed files with 584 additions and 381 deletions
29
.devcontainer/Dockerfile
Normal file
29
.devcontainer/Dockerfile
Normal 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
|
47
.devcontainer/devcontainer.json
Normal file
47
.devcontainer/devcontainer.json
Normal 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"
|
||||
}
|
54
.devcontainer/docker-compose.yml
Normal file
54
.devcontainer/docker-compose.yml
Normal 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:
|
3
.devcontainer/home/.bash_aliases
Normal file
3
.devcontainer/home/.bash_aliases
Normal 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"
|
|
@ -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
6
.gitignore
vendored
|
@ -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
22
.vscode/settings.json
vendored
Normal 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
27
.vscode/tasks.json
vendored
Normal 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": []
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
# Exceptions
|
||||
|
||||
::: pyzipline.exceptions
|
||||
::: exceptions
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Models Reference
|
||||
|
||||
::: pyzipline.models
|
||||
::: models
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# Utilities
|
||||
|
||||
::: pyzipline.utils
|
||||
::: utils
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# ZiplineApi
|
||||
|
||||
::: pyzipline.zipline
|
||||
::: zipline
|
||||
|
|
|
@ -6,26 +6,15 @@ 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"]
|
||||
|
|
Loading…
Add table
Reference in a new issue