Skip to content

Comments

WIP: Switch to ruff, optional deps (#35)#92

Draft
SmileyChris wants to merge 8 commits intoradiac:mainfrom
SmileyChris:switch-to-ruff
Draft

WIP: Switch to ruff, optional deps (#35)#92
SmileyChris wants to merge 8 commits intoradiac:mainfrom
SmileyChris:switch-to-ruff

Conversation

@SmileyChris
Copy link
Contributor

Summary

  • Update requires-python to >=3.10 (Django 5.2 requirement)
  • Replace black/isort with ruff for formatting
  • Make feature dependencies optional (Make feature dependencies optional #35):
    • api: django-ninja
    • serve: gunicorn, uvicorn
    • convert: ruff
    • static: django-nanopages, django-distill
    • all: everything (previous default)
  • Improve error messages to mention pip extras

Install options

  • pip install nanodjango - minimal (views, models, admin)
  • pip install nanodjango[api] - adds django-ninja for @app.api
  • pip install nanodjango[serve] - adds gunicorn/uvicorn for production
  • pip install nanodjango[convert] - adds ruff for code formatting
  • pip install nanodjango[all] - everything

Breaking change

This is a breaking change - existing users would need pip install nanodjango[all] for current behavior.

Test plan

  • Verify minimal install works for basic views
  • Verify error messages appear correctly when extras missing
  • Verify [all] installs everything

- Replace black and isort dependencies with ruff
- Update converter.py to use ruff subprocess for formatting generated code
- Update ruff config with isort rules and Django-aware sections
- Bump pre-commit ruff version to v0.14.13
Split dependencies into optional extras:
- api: django-ninja for @app.api
- serve: gunicorn/uvicorn for production servers
- convert: ruff for code formatting
- static: django-nanopages, django-distill
- all: everything (previous default behavior)

Core install now only requires click, Django, pluggy, whitenoise.
- Switch from --with pytest to --group dev pattern
- This ensures uv uses pyproject.toml coverage config
- Add coverage to dev dependency-group
- Filter coverage run output to show only test summary
- Add `just test-env [python] [extras]` for running individual matrix items
- Add Python 3.10 to both justfile and CI matrix (matches pyproject.toml minimum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant