Skip to main content

cradmin-legacy

Develop

Requires:

Use conventional commits for GIT commit messages

See https://www.conventionalcommits.org/en/v1.0.0/. You can use this git commit message format in many different ways, but the easiest is:

Install hatch and commitizen

NOTE: You only need hatch if you need to build releases, and you only need commitizen for releases OR to make it easy to follow conventional commits for your commit messages (see Use conventional commits for GIT commit messages above).

First install pipx with:

brew install pipx
pipx ensurepath

Then install hatch and commitizen:

pipx install hatch
pipx install commitizen

See https://github.com/pypa/pipx, https://hatch.pypa.io/latest/install/ and https://commitizen-tools.github.io/commitizen/ for more install alternatives if needed, but we really recommend using pipx since that is isolated.

Install development dependencies

(deprecated - use UV) Install a local python version with pyenv:

pyenv install $(pyenv latest -k 3.12)
pyenv local 3.12

Install dependencies in a virtualenv:

Alternatively, create virtualenv manually (this does the same as recreate-virtualenv.sh):

# With UV:
uv venv
# With pip:
python -m venv .venv

Install dependencies in a virtualenv:

# with uv:
uv pip install -e ".[dev,test]"

# with pip:
source .venv/bin/activate   # enable virtualenv
.venv/bin/pip install -e ".[dev,test]"

Upgrade your local packages

This will upgrade all local packages according to the constraints set in pyproject.toml:

# with uv:
uv venv --clear && uv pip install -e ".[dev,test]"

# with pip:
.venv/bin/pip install --upgrade --upgrade-strategy=eager ".[dev,test]"

Create/reset demo database

rm devdb.sqlite3
python manage.py migrate
python manage.py createsuperuser

Run dev server

source .venv/bin/activate   # enable virtualenv
python manage.py runserver

The devserver is now running at 127.0.0.1:8000

Run tests

source .venv/bin/activate   # enable virtualenvbash
pytest cradmin_legacy

Autoformat code with ruff

If you have not configured your editor to autoformat with ruff, you can run the following command to autoformat all code in the repo:

source .venv/bin/activate   # enable virtualenvbash
ruff format .

How to release cradmin_legacy

First make sure you have NO UNCOMITTED CHANGES!

Release (create changelog, increment version, commit and tag the change) with:

cz bump
git push && git push --tags

NOTE (release):

  • cz bump automatically updates CHANGELOG.md, updates version file(s), commits the change and tags the release commit.
  • If you are unsure about what cz bump will do, run it with --dry-run. You can use options to force a specific version instead of the one it automatically selects from the git log if needed, BUT if this is needed, it is a sign that someone has messed up with their conventional commits.
  • cz bump only works if conventional commits (see section about that above) is used.
  • cz bump can take a specific version etc, but it automatically select the correct version if conventional commits has been used correctly. See https://commitizen-tools.github.io/commitizen/.
  • If you need to add more to CHANGELOG.md (migration guide, etc), you can just edit CHANGELOG.md after the release, and commit the change with a docs: some useful message commit.
  • The cz command comes from commitizen (install documented above).

What if the release fails?

See How to revert a bump in the commitizen FAQ.

Release to pypi:

hatch build -t sdist
hatch publish -u __token__
# optional cleanup
rm dist/*

Metadata

Release files for cradmin-legacy 6.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cradmin-legacy 6.3.2
File Size Uploaded
cradmin_legacy-6.3.2.tar.gz 1.6 MB Details

Release files / cradmin_legacy-6.3.2.tar.gz

Download URL cradmin_legacy-6.3.2.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
b8880fcad771e207c8bbbf1c2af34dbf3fc79c2538e8113a6cc3eb8da4eadeea
BLAKE2b-256 checksum
How to use checksums
244239831234b0a4d2201f8ef56075d3ae24f27ea9e0e013efd6635811028d9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.16.5 cpython/3.10.20 HTTPX/0.28.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page