# forgejo-python-package-template

Runnable Python package template repository for Forgejo delivery.

## Local commands

```bash
uv sync
uv run pytest
uv build --no-sources
```

## Included workflows

| Workflow | Purpose |
| --- | --- |
| `.forgejo/workflows/ci.yml` | Run local-equivalent Python validation in Forgejo CI |
| `.forgejo/workflows/python-package.yml` | Publish the package to a writable DevPI / private PyPI endpoint |

## Forgejo setup

### Required secrets

- `PYTHON_REGISTRY_USERNAME`
- `PYTHON_REGISTRY_PASSWORD`

### Required repository variables

- `PYTHON_PACKAGE_NAME` - package name used by the delete step, e.g. `forgejo-python-package-template`
- `PYTHON_PUBLISH_URL` - writable upload endpoint, e.g. `https://pypi.registry.example/root/dev/`
- `PYTHON_INDEX_URL` - consumer/simple index endpoint, e.g. `https://pypi.registry.example/root/dev/+simple/`
- `PYTHON_DELETE_BASE_URL` - delete base URL, e.g. `https://pypi.registry.example/root/dev`

## Acceptance criteria

1. `uv run pytest` passes locally.
2. `uv build --no-sources` produces a wheel and sdist.
3. `ci.yml` passes on push and pull request.
4. The publish workflow targets the writable package endpoint, not a read-only mirror.
5. Rerunning the same version deletes and replaces the old package intentionally.
