Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v10.2.0
with:
python-version: "3.13"
cache: 'pip'
cache-dependency-path: |
requirements/main.txt
requirements/dev.txt
requirements/production.txt
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools uv
python -m uv pip install -r requirements/main.txt -r requirements/dev.txt -r requirements/production.txt
run: uv sync --all-groups

- name: Check code formatting with Ruff
run: |
python -m ruff format --check pythonie
run: uv run ruff format --check pythonie

- name: Lint code with Ruff
run: |
python -m ruff check pythonie
run: uv run ruff check pythonie

- name: Check for security vulnerabilities
run: |
python -m pip_audit
run: uv run pip-audit

- name: Run Django tests
run: |
python pythonie/manage.py test pythonie --verbosity=2
run: uv run python pythonie/manage.py test pythonie --verbosity=2
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

30 changes: 14 additions & 16 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

This is the Python Ireland (python.ie / pycon.ie) website, built with Django 6.0 and Wagtail CMS 7.2. It manages content for the Python Ireland community including meetups and sponsors.
This is the Python Ireland (python.ie / pycon.ie) website, built with Django 6.0 and Wagtail CMS 7.3. It manages content for the Python Ireland community including meetups and sponsors.

### Python Version

This project requires **Python 3.13.11** (or any Python 3.13.x). All code must be compatible with Python 3.13. When developing locally without Docker, ensure you are using Python 3.13.x.
This project requires **Python 3.13.11** (or any Python 3.13.x). All code must be compatible with Python 3.13. When developing locally without Docker, ensure you are using Python 3.13.x. Tool versions (Python, uv, Task) are pinned in `mise.toml` for [mise](https://mise.jdx.dev/) users.

## Architecture

Expand Down Expand Up @@ -42,7 +42,7 @@ Always specify settings module: `--settings=pythonie.settings.dev` (or `tests`,
### Key Dependencies

- Django 6.0
- Wagtail 7.2.1 (CMS framework)
- Wagtail 7.3 (CMS framework)
- Redis (caching, configured via `REDISCLOUD_URL`)
- WhiteNoise (static file serving)
- boto3/django-storages (S3 integration)
Expand All @@ -53,17 +53,15 @@ Always specify settings module: `--settings=pythonie.settings.dev` (or `tests`,
### Local Development (without Docker)

```bash
# Setup
python3 -m venv pythonie-venv
source pythonie-venv/bin/activate
pip install -r requirements.txt
# Setup (creates and populates a .venv automatically)
uv sync --all-groups

# Database
python pythonie/manage.py migrate --settings=pythonie.settings.dev
python pythonie/manage.py createsuperuser --settings=pythonie.settings.dev
uv run python pythonie/manage.py migrate --settings=pythonie.settings.dev
uv run python pythonie/manage.py createsuperuser --settings=pythonie.settings.dev

# Run server
python pythonie/manage.py runserver --settings=pythonie.settings.dev
uv run python pythonie/manage.py runserver --settings=pythonie.settings.dev

# Access admin at http://127.0.0.1:8000/admin/
```
Expand Down Expand Up @@ -97,14 +95,14 @@ task django:migrate

```bash
# Run all tests (local)
python pythonie/manage.py test pythonie --settings=pythonie.settings.tests --verbosity=2
uv run python pythonie/manage.py test pythonie --settings=pythonie.settings.tests --verbosity=2

# Run all tests (docker)
make docker-tests
# or: task tests

# Run single test
python pythonie/manage.py test pythonie.meetups.test_meetups --settings=pythonie.settings.tests
uv run python pythonie/manage.py test pythonie.meetups.test_meetups --settings=pythonie.settings.tests
```

### Code Quality
Expand All @@ -113,12 +111,12 @@ python pythonie/manage.py test pythonie.meetups.test_meetups --settings=pythonie
# Format code with ruff
task code:format
# or: toast code:format
# or: python -m ruff format pythonie
# or: uv run ruff format pythonie

# Lint code and fix issues
task code:lint
# or: toast code:lint
# or: python -m ruff check --fix pythonie
# or: uv run ruff check --fix pythonie

# Check code formatting and linting without changes
task code:check
Expand All @@ -127,10 +125,10 @@ task code:check

### Dependency Management

Uses `uv` for fast Python package management. Dependencies are defined in `.in` files and compiled to `.txt` files:
Uses `uv` for fast Python package management. Dependencies are declared in `pyproject.toml` (`[project.dependencies]` + `[dependency-groups]`) and locked in `uv.lock` (committed). Heroku's Python buildpack detects `uv.lock` and installs natively via `uv sync` against the slug's system Python — **never add a `requirements.txt` at the repo root**, the buildpack aborts the build if it finds more than one package-manager file (`requirements.txt`, `poetry.lock`, `uv.lock`) at once. `.python-version` (not `runtime.txt`, which is deprecated) pins the Python version for the buildpack.

```bash
# Recompile all dependencies
# Recompute the lock file
task dependencies:compute
# or: toast deps:compute

Expand Down
31 changes: 14 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ website/
│ ├── meetups/ # Meetup.com integration
│ ├── sponsors/ # Sponsor management
│ └── pythonie/ # Django settings
├── requirements/ # Dependency files
├── pyproject.toml # Dependency declarations (uv)
├── uv.lock # Locked dependency versions
├── CLAUDE.md # AI assistant instructions
├── DEVELOPMENT.md # Detailed development guide
└── CONTRIBUTING.md # This file
Expand Down Expand Up @@ -79,21 +80,17 @@ task run
# Ensure Python 3.13 is installed
python3 --version # Should show 3.13.x

# Create virtual environment
python3.13 -m venv pythonie-venv
source pythonie-venv/bin/activate

# Install dependencies
pip install -r requirements/dev.txt
# Install dependencies (creates and populates a .venv automatically)
uv sync --all-groups

# Run migrations
python pythonie/manage.py migrate --settings=pythonie.settings.dev
uv run python pythonie/manage.py migrate --settings=pythonie.settings.dev

# Create superuser
python pythonie/manage.py createsuperuser --settings=pythonie.settings.dev
uv run python pythonie/manage.py createsuperuser --settings=pythonie.settings.dev

# Start server
python pythonie/manage.py runserver --settings=pythonie.settings.dev
uv run python pythonie/manage.py runserver --settings=pythonie.settings.dev
```

### Verify Setup
Expand Down Expand Up @@ -240,16 +237,16 @@ class MyModel(models.Model):
```bash
# All tests
task tests
# or: python pythonie/manage.py test pythonie --settings=pythonie.settings.tests -v 2
# or: uv run python pythonie/manage.py test pythonie --settings=pythonie.settings.tests -v 2

# Specific app
python pythonie/manage.py test pythonie.meetups --settings=pythonie.settings.tests
uv run python pythonie/manage.py test pythonie.meetups --settings=pythonie.settings.tests

# Specific test file
python pythonie/manage.py test pythonie.meetups.test_meetups --settings=pythonie.settings.tests
uv run python pythonie/manage.py test pythonie.meetups.test_meetups --settings=pythonie.settings.tests

# Specific test method
python pythonie/manage.py test pythonie.meetups.test_meetups.TestCase.test_method
uv run python pythonie/manage.py test pythonie.meetups.test_meetups.TestCase.test_method
```

### Writing Tests
Expand Down Expand Up @@ -394,7 +391,7 @@ refactor: Simplify sponsor level ordering logic
```bash
# Create app
cd pythonie
python ../pythonie/manage.py startapp myapp --settings=pythonie.settings.dev
uv run python ../pythonie/manage.py startapp myapp --settings=pythonie.settings.dev

# Add to INSTALLED_APPS in pythonie/pythonie/settings/base.py
INSTALLED_APPS = [
Expand All @@ -403,8 +400,8 @@ INSTALLED_APPS = [
]

# Create migrations
python pythonie/manage.py makemigrations myapp --settings=pythonie.settings.dev
python pythonie/manage.py migrate --settings=pythonie.settings.dev
uv run python pythonie/manage.py makemigrations myapp --settings=pythonie.settings.dev
uv run python pythonie/manage.py migrate --settings=pythonie.settings.dev
```

### Adding a New Wagtail Page Type
Expand Down
Loading
Loading