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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
load: true
push: false
tags: local/test-image:latest

- name: Run image help
run: docker run --rm --entrypoint "${{ github.event.repository.name }}" local/test-image:latest --help
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set image name
run: echo "IMAGE_NAME=ghcr.io/hyperleda/hyperleda" >> $GITHUB_ENV
run: echo "IMAGE_NAME=ghcr.io/hyperleda/hyperleda" >> "$GITHUB_ENV"

- name: Set short SHA
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV"

- name: Build and push image
uses: docker/build-push-action@v6
Expand Down
3 changes: 2 additions & 1 deletion .template.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Autogenerated - DO NOT EDIT
# Parameters of the project as generated from template
_commit: 179dc2a
_commit: f510818
_src_path: gh:kraysent/python-template
package_name: app
project_name: db_app
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM python:3.13-slim-bookworm
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN apt-get update && apt-get install -y --no-install-recommends git curl && apt-get clean
WORKDIR /usr/src/app
COPY pyproject.toml ./
RUN uv sync
COPY app app
COPY main.py main.py
FROM python:3.12-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
WORKDIR /app
COPY pyproject.toml uv.lock README.md ./
COPY app ./app
RUN uv sync --frozen --no-dev

FROM python:3.12-slim AS runtime
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
COPY . .
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

File renamed without changes.
10 changes: 5 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ check:
-exec uv run python -m py_compile {} +
@echo "Compilation ok."

@uvx ruff format \
@uv run ruff format \
--quiet \
--config=pyproject.toml \
--check
@echo "Formatting ok."

@uvx ruff check \
@uv run ruff check \
--quiet \
--config=pyproject.toml
@echo "Linter ok."

@output=$$(uvx basedpyright 2>&1); exit_code=$$?; \
@output=$$(uv run basedpyright 2>&1); exit_code=$$?; \
if [ $$exit_code -ne 0 ]; then echo "$$output"; fi; \
exit $$exit_code
@echo "Typechecking ok."
Expand All @@ -44,11 +44,11 @@ check:
@echo "Testing ok."

fix:
@uvx ruff format \
@uv run ruff format \
--quiet \
--config=pyproject.toml

@uvx ruff check \
@uv run ruff check \
--quiet \
--config=pyproject.toml \
--fix
Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "hyperleda-backend"
name = "app"
version = "0.1.0"
readme = "README.md"
requires-python = "~=3.13.0"
dependencies = [
"click~=8.3.1",
"astropy>=7.1.0",
"astroquery>=0.4.10",
"bcrypt>=4.2.1",
"click>=8.1.8",
"jinja2>=3.1.5",
"pandas>=2.3.2",
"psycopg[binary,pool]>=3.2.4",
Expand All @@ -31,6 +31,13 @@ dependencies = [
"opentelemetry-exporter-otlp>=1.40.0",
]

[project.scripts]
"app" = "app.cli:cli"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[dependency-groups]
dev = [
# fixed version so no new linter/formatter errors are introduced over time
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/adminapi_server_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def setUpClass(cls) -> None:
cls.process = subprocess.Popen(
[
sys.executable,
"main.py",
"-m",
"app.cli",
"adminapi",
"-c",
"configs/dev/adminapi.yaml",
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/dataapi_server_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def setUpClass(cls) -> None:
cls.process = subprocess.Popen(
[
sys.executable,
"main.py",
"-m",
"app.cli",
"dataapi",
"-c",
"configs/dev/dataapi.yaml",
Expand Down
Loading