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
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,15 @@ jobs:
run: nox -s test_fast --python {% raw %}${{ matrix.python-version }}{% endraw %}

# Compatibility test against oldest supported dependency versions
# Uncomment pins when compat pin files are added (e.g., "oldest", "legacy")
test-compat:
if: false # disabled until pins are defined
name: {% raw %}Compat tests (${{ matrix.pins }}){% endraw %}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
pins: []
pins: ["placeholder"]

steps:
- name: Checkout code
Expand Down
3 changes: 3 additions & 0 deletions template/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ docs/examples/*/
{% endif %}# Auto-generated API submodule pages (created by docs/hooks.py)
docs/pages/api/

# Worktrees
.worktrees/

# AI Assistant Instructions
CLAUDE.md
CLAUDE_INSTRUCTIONS.md
Expand Down
11 changes: 11 additions & 0 deletions tests/test_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,17 @@ def test_tests_workflow_excludes_examples_when_disabled(self, copie):
# Should NOT have examples-related content
assert "test_examples" not in workflow_content and "run-examples" not in workflow_content

def test_tests_workflow_compat_job_disabled(self, copie):
"""Test that test-compat job is disabled until pins are defined."""
result = copie.copy(extra_answers={"include_actions": True})
assert result.exit_code == 0

workflow_path = result.project_dir / ".github" / "workflows" / "tests.yml"
workflow_content = workflow_path.read_text(encoding="utf-8")

assert "if: false # disabled until pins are defined" in workflow_content
assert 'pins: ["placeholder"]' in workflow_content


class TestPublishWorkflow:
"""Test the publish-release.yml workflow."""
Expand Down
10 changes: 10 additions & 0 deletions tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ def test_gitignore_excludes_examples_when_disabled(copie):
assert "docs/examples/*/" not in content


def test_gitignore_includes_worktrees(copie_session_default):
"""Test that .gitignore includes .worktrees/ entry."""
result = copie_session_default

content = (result.project_dir / ".gitignore").read_text(encoding="utf-8")

assert "# Worktrees" in content
assert ".worktrees/" in content


def test_gitignore_uses_project_name_for_version_file(copie):
"""Test that .gitignore uses project_name variable (not project_slug) for the version file path."""
result = copie.copy(extra_answers={"package_name": "my_package", "project_slug": "my-project"})
Expand Down