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
5 changes: 5 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ARG IMAGE="python:3.12"
FROM --platform=amd64 mcr.microsoft.com/vscode/devcontainers/${IMAGE}
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends build-essential libssl-dev gdb cmake
39 changes: 39 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Render Engine",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"IMAGE": "python:3.12"
}
},
"postCreateCommand": ". .devcontainer/setup.sh",
"customizations": {
"vscode": {
"settings": {
"python.formatting.provider": "charliermarsh.ruff",
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "pytest",
"python.testing.unittestEnabled": false,
"python.editor.formatOnSave": true,
"python.editor.codeActionsOnSave": {"source.fixAll": true},
"python.testing.pytestArgs": [
"tests"
],
".markdownlint-cli2.ignores": [".gitignore"]

},
"extensions": [
"ms-python.python",
"charliermarsh.ruff",
"github.github-actions",
"github.github",
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint"
]
}
}
}
6 changes: 6 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python -m pip install --user --upgrade pip
python -m pip install --user pip-tools
python -m piptools compile --upgrade -o requirements.txt pyproject.toml
python -m pip install --user -r requirements.txt
python -m pip install -e .
pre-commit install
21 changes: 5 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Format and Lint with Ruff and MarkdownLint
on:
on:
pull_request:
branches: [main]
workflow_dispatch:
Expand All @@ -14,7 +14,7 @@ jobs:
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
Expand All @@ -24,25 +24,17 @@ jobs:
# Update output format to enable automatic inline annotations.
- name: Run Ruff
run: |
ruff check --fix --output-format=github render_engine_parser

ruff format render_engine_parser
ruff check . --fix --output-format=github
ruff format .

- name: Markdown Lint base-files
uses: DavidAnson/markdownlint-cli2-action@v14
uses: DavidAnson/markdownlint-cli2-action@v16
with:
fix: true
globs: |
*.md
.github/**/*.md
continue-on-error: true
- name: Markdown Lint Docs
uses: DavidAnson/markdownlint-cli2-action@v14
with:
fix: true
globs: docs/**/*.md
config: docs/.markdownlint.json
continue-on-error: true
- name: Commit changes
run: |
if [ -n "$(git status --porcelain)" ]; then
Expand All @@ -52,6 +44,3 @@ jobs:
git commit -m "Format and lint with Ruff"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
fi



2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build distribution

on:
on:
release:
types: [created]

Expand Down
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
hooks:
- id: ruff
args: ["--fix"]
# Run the formatter.
- id: ruff-format
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dev = [
"pytest",
"pytest-cov",
"ruff",
]
]


[tool.setuptools_scm]
Expand All @@ -37,8 +37,7 @@ version_toml = "pyproject.toml:project.version"
branch = "main"

[tool.ruff]
select = ["E", "F", "I", "UP"]
lint.select = ["E", "F", "I", "UP"]
target-version = "py311"
line-length = 120
src = ["src"]
ignore-init-module-imports = true
20 changes: 2 additions & 18 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --extra=dev
# pip-compile --output-file=requirements.txt pyproject.toml
#
coverage[toml]==7.6.1
# via pytest-cov
iniconfig==2.0.0
# via pytest
packaging==24.1
# via pytest
pluggy==1.5.0
# via pytest
pytest==8.3.2
# via
# pytest-cov
# render_engine_parser (pyproject.toml)
pytest-cov==5.0.0
# via render_engine_parser (pyproject.toml)
python-frontmatter==1.1.0
# via render_engine_parser (pyproject.toml)
pyyaml==6.0.2
# via python-frontmatter
ruff==0.6.4
# via render_engine_parser (pyproject.toml)
1 change: 0 additions & 1 deletion tests/test_base_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import frontmatter
import pytest

from render_engine_parser.base_parsers import BasePageParser, parse_content


Expand Down
Loading