---
name: django-environ-release
description: Run and validate the django-environ release workflow (prepare, verify, and publish).
---

# django-environ release skill

Use this skill when preparing a new django-environ release (for example `0.12.2`).

## Prerequisites

- Work from `develop` unless maintainers explicitly choose another branch.
- Ensure local branch is up to date:

```bash
git checkout develop
git fetch origin
git pull --ff-only origin develop
```

- Confirm working tree is clean for tracked files.

## 1) Update version and release notes

- Bump version in `environ/__init__.py` (`__version__`).
- Update `CHANGELOG.rst` with release entry and key changes mentioning contributors if possibile.
- If needed, align `RELEASE_NOTES.md` / roadmap references.

## 2) Validate locally

Run the project checks used by CI/release flow:

```bash
tox -e lint
tox -e build
pytest -q
```

Optional (recommended):

```bash
tox -e docs
tox -e manifest
```

## 3) Commit and push

- Create focused commits (version bump and notes can be split if useful).
- Include Co-authored-by trailer when required by project policy.
- Push branch and open PR targeting `develop`.

## 4) Release readiness checklist

- [ ] Version bumped and consistent
- [ ] Changelog updated
- [ ] Build artifacts pass (`tox -e build`)
- [ ] Tests pass (`pytest -q`)
- [ ] Lint passes (`tox -e lint`)
- [ ] Docs build passes (`tox -e docs`, if doc changes)
- [ ] PR merged into `develop`

## 5) Publish (maintainer step)

When maintainers are ready to publish:

- Create/tag release commit for the new version.
- Trigger release pipeline / upload to PyPI according to current maintainer process.
- Announce release with concise highlights.

## 6) Copy/paste command blocks (required output)

When using this skill, always provide a ready-to-run command list for:
- merge into `main`
- build artifacts
- upload to TestPyPI
- install from TestPyPI and run smoke test
- upload to production PyPI

Use command blocks like these (adjust version/tag as needed):

```bash
# Merge develop into main and push
git checkout main
git fetch origin
git pull --ff-only origin main
git merge --ff-only origin/develop
git push origin main
```

```bash
# Build distribution artifacts
python -m pip install -U pip build twine
rm -rf dist/ build/ *.egg-info
python -m build
twine check dist/*
```

```bash
# Upload to TestPyPI
python -m twine upload --repository testpypi dist/*
```

```bash
# Install from TestPyPI and run smoke test
python -m venv /tmp/django-environ-smoke
. /tmp/django-environ-smoke/bin/activate
python -m pip install -U pip
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple django-environ==<VERSION>
python - <<'PY'
import environ
print(environ.__version__)
env = environ.Env()
print(env.str("DJANGO_ENV", default="ok"))
PY
deactivate
```

```bash
# Upload to production PyPI
python -m twine upload --repository django-environ dist/*
```

## 7) Social announcement draft (Twitter/X)

At the end of the release flow, also generate a short Twitter/X draft
highlighting the most interesting changes (max 280 chars), for example:

```text
django-environ v<VERSION> is out 🎉
Highlights:
✅ Optional warnings when defaults are used
✅ New `choices` support in `Env.str(...)`
✅ Valkey + rediss improvements
✅ Docs improvements (including code copy button)

Upgrade: https://pypi.org/project/django-environ/
#django #python
```

## Notes specific to this repository

- CI matrix is tox-driven (`tox.ini`).
- Packaging is currently setup.py-based; v1.0 roadmap includes migration to `pyproject.toml` (see #570 reference tasks).
- Keep release changes minimal and avoid unrelated refactors.
