Compare commits

..

No commits in common. "main" and "r" have entirely different histories.
main ... r

8 changed files with 29 additions and 69 deletions

View file

@ -6,22 +6,8 @@ depends_on:
- test - test
steps: steps:
container_build_release_push:
#image: docker.io/maltegrosse/woodpecker-buildah:0.0.12
image: code.philo.ydns.eu/philorg/woodpecker-buildah
settings:
registry: code.philo.ydns.eu
repository: philorg/test-woodpecker-python
tags: ${CI_COMMIT_SHA}
architectures: amd64
context: Containerfile
username:
from_secret: registry_username
password:
from_secret: registry_password
sync: sync:
image: code.philo.ydns.eu/philorg/uv image: ghcr.io/astral-sh/uv:python3.13-alpine
volumes: volumes:
- uv-cache:/uv-cache - uv-cache:/uv-cache
environment: environment:
@ -31,7 +17,7 @@ steps:
- uv sync - uv sync
build: build:
image: code.philo.ydns.eu/philorg/uv image: ghcr.io/astral-sh/uv:python3.13-alpine
volumes: volumes:
- uv-cache:/uv-cache - uv-cache:/uv-cache
environment: environment:
@ -42,12 +28,20 @@ steps:
- uv cache prune --ci - uv cache prune --ci
push_python: push_python:
image: code.philo.ydns.eu/philorg/uv image: ghcr.io/astral-sh/uv:python3.13-alpine
environment: environment:
OWNER: philorg OWNER: philorg
REGISTRY_URL: https://code.philo.ydns.eu REGISTRY_URL: https://code.philo.ydns.eu
REGISTRY_TOKEN: REGISTRY_TOKEN:
from_secret: registry_token from_secret: registry_token
commands: commands:
- uv publish --publish-url $REGISTRY_URL/api/packages/$OWNER/pypi --token $REGISTRY_TOKEN dist/*.whl - uv publish --publish-url $REGISTRY_URL/api/packages/$OWNER/pypi -u __token__ --token REGISTRY_TOKEN dist/*.whl
failure: ignore failure: ignore
# TODO: container
# For podman build: see https://woodpecker-ci.org/blog/podman-image-build-sigstore
# podman-privileged-test:
# image: quay.io/podman/stable
# commands:
# - echo From https://docs.gitlab.com/runner/executors/kubernetes/use_podman_with_kubernetes/
# - podman build . -t playground-bis:testing

View file

@ -5,8 +5,9 @@ when:
- event: tag - event: tag
steps: steps:
sync: sync:
image: code.philo.ydns.eu/philorg/uv image: ghcr.io/astral-sh/uv:python3.13-alpine
volumes: volumes:
- uv-cache:/uv-cache - uv-cache:/uv-cache
environment: environment:
@ -16,6 +17,7 @@ steps:
- uv sync - uv sync
test: test:
#image: ghcr.io/astral-sh/uv:alpine
image: ghcr.io/astral-sh/uv:python3.13-alpine image: ghcr.io/astral-sh/uv:python3.13-alpine
commands: commands:
- .venv/bin/pytest -s tests/basic.py - .venv/bin/pytest -s tests/basic.py

View file

@ -1,16 +1,16 @@
# Build: podman build -t code.philo.ydns.eu/philorg/test-woodpecker -f Containerfile # Build: podman build -t code.philo.ydns.eu/philorg/test-woodpecker -f Containerfile
#FROM docker.io/python:3.13-slim
FROM docker.io/python:alpine FROM docker.io/python:alpine
#FROM ghcr.io/astral-sh/uv:python3.13-alpine
#RUN apk add --no-cache git
#COPY --from=ghcr.io/astral-sh/uv:python3.13-alpine /usr/local/bin/uv /usr/local/bin/
COPY . /app COPY . /app
# Sync the project into a new environment, using the frozen lockfile
WORKDIR /app WORKDIR /app
# Sync the project into a new environment, using the frozen lockfile RUN --mount=from=ghcr.io/astral-sh/uv:alpine,source=/usr/local/bin/uv,target=/bin/uv uv pip install --system .
RUN \
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/local/bin/uv,target=/bin/uv \
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/lib/libpcre2-8.so.0,target=/usr/lib/libpcre2-8.so.0 \
--mount=from=code.philo.ydns.eu/philorg/uv,source=/usr/bin/git,target=/usr/bin/git \
uv pip install --system .
ENTRYPOINT ["foo"] ENTRYPOINT ["foo"]

View file

@ -1,5 +1,3 @@
# test-woodpecker-ci # test-woodpecker-ci
[![status-badge](https://code.philo.ydns.eu/woodpecker/api/badges/5/status.svg)](https://code.philo.ydns.eu/woodpecker/repos/5) Yo
This is a sandbox for building packages (pypi and container) with Woodpecker CI.

View file

@ -1,7 +1,7 @@
[project] [project]
name = "test-woodpecker-ci" name = "test-woodpecker-ci"
dynamic = ["version"] version = "0.1.0"
description = "Sandbox for Woodpecker CI" description = "Add your description here"
readme = "README.md" readme = "README.md"
requires-python = ">=3.13" requires-python = ">=3.13"
dependencies = [] dependencies = []
@ -10,22 +10,11 @@ dependencies = []
foo = "test_woodpecker_ci.main:main" foo = "test_woodpecker_ci.main:main"
[build-system] [build-system]
requires = ["hatchling", "uv-dynamic-versioning"] requires = ["hatchling"]
build-backend = "hatchling.build" build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["src/test_woodpecker_ci"] packages = ["src/test_woodpecker_ci"]
[dependency-groups] [dependency-groups]
dev = ["dunamai>=1.24.1", "httpx>=0.28.1", "pytest>=8.4.1"] dev = ["httpx>=0.28.1", "pytest>=8.4.1"]
[tool.uv-dynamic-versioning]
style = "semver"
[tool.uv]
extra-index-url = [
"https://code.philo.ydns.eu/api/packages/philorg/pypi/simple/",
]

View file

@ -1,10 +0,0 @@
import importlib.metadata
try:
from dunamai import Version, Style
__version__ = Version.from_git().serialize(style=Style.SemVer, dirty=True)
except ImportError:
# __name__ can be used if the package name is the same
# as the directory. Otherwise, specify it explicitely.
__version__ = importlib.metadata.version(__name__)

View file

@ -2,5 +2,5 @@ def test_ok():
assert True assert True
def no_test_fail(): def test_fail():
assert False assert False

15
uv.lock generated
View file

@ -33,18 +33,6 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
] ]
[[package]]
name = "dunamai"
version = "1.24.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "packaging" },
]
sdist = { url = "https://files.pythonhosted.org/packages/54/22/7f46b0146ef614cd6f80e4bcb188dabe33e90b4e0af028e16f597f5826ad/dunamai-1.24.1.tar.gz", hash = "sha256:3aa3348f77242da8628b23f11e89569343440f0f912bcef32a1fa891cf8e7215", size = 45616, upload-time = "2025-05-09T13:48:46.417Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/1d/d6/6ed8b439906ca2e88d65bddf002e21239678aca6001d8fb82e8e2b196245/dunamai-1.24.1-py3-none-any.whl", hash = "sha256:4370e406d8ce195fc4b066b5c326bfa9adb269c4b8719b4e4fd90b63a2144bf7", size = 26654, upload-time = "2025-05-09T13:48:45.442Z" },
]
[[package]] [[package]]
name = "h11" name = "h11"
version = "0.16.0" version = "0.16.0"
@ -154,11 +142,11 @@ wheels = [
[[package]] [[package]]
name = "test-woodpecker-ci" name = "test-woodpecker-ci"
version = "0.1.0"
source = { editable = "." } source = { editable = "." }
[package.dev-dependencies] [package.dev-dependencies]
dev = [ dev = [
{ name = "dunamai" },
{ name = "httpx" }, { name = "httpx" },
{ name = "pytest" }, { name = "pytest" },
] ]
@ -167,7 +155,6 @@ dev = [
[package.metadata.requires-dev] [package.metadata.requires-dev]
dev = [ dev = [
{ name = "dunamai", specifier = ">=1.24.1" },
{ name = "httpx", specifier = ">=0.28.1" }, { name = "httpx", specifier = ">=0.28.1" },
{ name = "pytest", specifier = ">=8.4.1" }, { name = "pytest", specifier = ">=8.4.1" },
] ]