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
10 changes: 10 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Always reference these instructions first and fallback to search or bash command
## Working Effectively

### Bootstrap and Setup

- Install dependencies:
- `python -m pip install --upgrade pip tox` -- installs build tools. NEVER CANCEL: May take 2-3 minutes.
- `pip install -e '.[all,tests]'` -- installs feincms3 in development mode with all optional dependencies and test dependencies. NEVER CANCEL: May take 5-10 minutes.
Expand All @@ -16,6 +17,7 @@ Always reference these instructions first and fallback to search or bash command
- Continue with code analysis and basic Python validation

### Testing

- **CHECK TEST ENVIRONMENTS**: `tox --listenvs` -- shows all available test combinations (verified working)
- **PRIMARY TEST COMMAND**: `python -m tox -e py312-dj50` -- runs tests with Python 3.12 and Django 5.0. Takes 5-10 minutes. NEVER CANCEL. Set timeout to 15+ minutes.
- **FREQUENT FAILURE**: This often fails during dependency installation due to network timeouts. If it fails, note "tox test fails due to network limitations during pip install phase"
Expand All @@ -25,18 +27,21 @@ Always reference these instructions first and fallback to search or bash command
- Run slow tests: `python -m tox -e slowtests` -- takes 15+ minutes. NEVER CANCEL. Set timeout to 30+ minutes.

### Code Quality and Linting

- **CRITICAL**: Always run these before committing or CI will fail:
- `python -m tox -e style` -- reformats code using ruff and runs linting checks
- Alternative: `ruff check .` and `ruff format .` if available
- Pre-commit hooks: `pre-commit run --all-files` -- runs all code quality checks
- **RUFF CONFIG**: Project uses ruff for both linting and formatting (configured in pyproject.toml)

### Documentation

- Build docs: `python -m tox -e docs` -- builds HTML docs into `docs/build/html/`. Takes 3-5 minutes. NEVER CANCEL. Set timeout to 10+ minutes.
- Alternative: `cd docs && make html` -- if tox fails
- Documentation uses Sphinx with furo theme

### Development Workflow Commands

- **ALWAYS CHECK**: Git status and branch before making changes: `git status --porcelain && git branch -a` (verified working)
- **BASIC CODE VALIDATION**: `python -c "import sys; sys.path.insert(0, '.'); import feincms3; print('✓ Import successful, version:', feincms3.__version__)"` (verified working)
- **EXPLORE PROJECT STRUCTURE**: Key directories to examine:
Expand Down Expand Up @@ -66,6 +71,7 @@ After making changes to feincms3, **ALWAYS** validate these scenarios:
## Project Structure and Key Files

### Core Modules

- `feincms3/` -- main package directory
- `__init__.py` -- version info (currently 5.4.2)
- `pages.py` -- core page model and functionality
Expand All @@ -76,19 +82,22 @@ After making changes to feincms3, **ALWAYS** validate these scenarios:
- `mixins.py` -- reusable model mixins

### Test Suite

- `tests/testapp/` -- test Django application
- `settings.py` -- test configuration
- `models.py` -- test models
- `test_*.py` -- test files for different components
- `manage.py` -- Django management script for tests

### Documentation

- `docs/` -- Sphinx documentation
- `build-your-cms.rst` -- main tutorial
- `installation.rst` -- installation guide
- `project/contributing.rst` -- contribution guidelines

### Configuration Files

- `pyproject.toml` -- main project configuration, dependencies, build settings
- `tox.ini` -- test environment configuration
- `.pre-commit-config.yaml` -- code quality hooks
Expand All @@ -97,6 +106,7 @@ After making changes to feincms3, **ALWAYS** validate these scenarios:
## Common Command Reference

### Frequently Referenced Files and Commands

The following are verified working commands and file locations:

```bash
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ name: Publish to PyPI
on:
push:
tags:
- '*'
- "*"

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: 3.x
- name: Build
run: |
python -m pip install --upgrade build
python -m build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: 3.x
- name: Build
run: |
python -m pip install --upgrade build
python -m build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/

publish:
name: Publish to PyPI
Expand All @@ -32,8 +32,8 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
42 changes: 21 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Tests
on:
push:
branches:
- main
- main
pull_request:
schedule:
- cron: 37 1 1 * *
- cron: 37 1 1 * *

jobs:
tests:
Expand All @@ -16,24 +16,24 @@ jobs:
fail-fast: false
matrix:
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.15'
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
- "3.15"

steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run tox targets for ${{ matrix.python-version }}
run: |
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Run tox targets for ${{ matrix.python-version }}
run: |
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ repos:
- id: django-upgrade
args: [--target-version, "3.2"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.17.1
rev: v0.17.2
hooks:
- id: ruff-check
args: [--unsafe-fixes]
- id: ruff-format
- repo: https://github.com/biomejs/pre-commit
rev: v2.5.15
rev: v2.6.3
hooks:
- id: biome-check
args: [--unsafe]
Expand All @@ -35,6 +35,6 @@ repos:
hooks:
- id: pyproject-fmt
- repo: https://github.com/abravalheri/validate-pyproject
rev: '0.26'
rev: "v0.27"
hooks:
- id: validate-pyproject
Loading