Skip to content
Open
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
16 changes: 9 additions & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ on:
workflow_dispatch:
workflow_call:

permissions:
contents: write
pull-requests: write
permissions: {}

jobs:
lint-python:
name: Format and Lint Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: "true"
- name: Run Ruff
Expand All @@ -28,9 +28,11 @@ jobs:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Markdown Lint base-files
uses: DavidAnson/markdownlint-cli2-action@v20
uses: DavidAnson/markdownlint-cli2-action@21c1be1b93ad9ed58fa840aacc3f279cde2a72ff # v24.2.0
with:
globs: |
*.md
Expand Down
50 changes: 29 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,40 @@ name: Build distribution

on:
release:
types: [created]
types: [created, published, prereleased]
workflow_dispatch:

permissions:
contents: write
pull-requests: write
id-token: write
permissions: {}

jobs:
test:
uses: ./.github/workflows/test.yml
lint:
uses: ./.github/workflows/lint.yml
deploy:
needs: [test, lint]
name: Deploy to PyPI
uses: $/.github/workflows/test.yml
permissions:
contents: read
pull-requests: write # This is needed for the coverage badge. Will fail on startup without it.

build-and-inspect-package:
name: Build & inspect package
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
enable-cache: "true"
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
# Allow prerelease if explicitly marked in pyproject.toml so we can prerelease in conjunction
# with engine updates.
- run: uv build --prerelease=explicit
- uses: pypa/gh-action-pypi-publish@release/v1
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1

publish-pypi:
needs: build-and-inspect-package
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifact
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
packages-dir: ./dist
path: dist
name: Packages
- name: Push to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
22 changes: 15 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,25 @@ on:
- "src/**"
- "tests/**"
- "pyproject.toml"

permissions:
contents: read

jobs:
test-against-python-matrix:
name: PyTest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
os: [windows-latest, macos-latest, ubuntu-latest]
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: "true"
- name: Run tests
Expand All @@ -34,14 +40,16 @@ jobs:
runs-on: ubuntu-latest
name: Check the configured entry point
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v5
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
enable-cache: "true"
- name: Set up env
# Allow prerelease if explicitly marked in pyproject.toml so we can prerelease in conjunction
# with engine updates.
# Allow prerelease if explicitly marked in pyproject.toml so we can prerelease in conjunction
# with engine updates.
run: uv sync --prerelease=explicit
- name: Install package
run: source .venv/bin/activate && uv pip install .
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name = "render-engine-cli"
dynamic = ["version"]
description = "Command line tool for the Render Engine static site generator"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"click>=8.2.1",
"cookiecutter>=2.6.0",
"render-engine>=2025.11.1a1",
"rich>=14.0.0",
"toml>=0.10.2",
"watchfiles>=1.1.0",
"watchfiles>=1.3.0",
]

[dependency-groups]
dev = [
"ephemeral-port-reserve>=1.1.4",
"httpx>=0.28.1",
"mypy>=1.16.1",
"pre-commit>=4.2.0",
"prek==0.5.5",
"pytest>=8.4.1",
"pytest-cov>=6.2.1",
"pytest-mock>=3.14.1",
Expand Down Expand Up @@ -47,7 +47,7 @@ version_file = "src/render_engine_cli/__version__.py"
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py310"
target-version = "py311"

[tool.ruff.lint]
select = ["E", "F", "I", "UP"]
Expand Down
13 changes: 13 additions & 0 deletions src/render_engine_cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# The __lazy_modules__ variable tells the Python 3.15 and later interpreters to lazily import the modules in the
# list. Since older versions of Python don't know about this variable it has no effect with them.
__lazy_modules__: list[str] = [
"datetime",
"json",
"pathlib",
"dateutil",
"rich",
"render_engine",
"render_engine_cli.event",
"render_engine_cli.utils",
]

import datetime
import json
from pathlib import Path
Expand Down
Loading
Loading