From 55b43339fb4398ec96aed67cd8fd81259f536e7d Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 21 Jun 2025 16:21:40 -0400 Subject: [PATCH 1/5] Initial documentation. --- .pre-commit-config.yaml | 19 +++++++++++++++ CONTRIBUTING.md | 33 ++++++++++++++++++++++++++ README.md | 51 +++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 4 +--- 4 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 CONTRIBUTING.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b91cbca --- /dev/null +++ b/.pre-commit-config.yaml @@ -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.11.12 + hooks: + - id: ruff + args: ["--fix"] + # Run the formatter. + - id: ruff-format diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..40c74d9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing to the Render Engine Projects + +Render Engine CLI is the CLI tool for the Render Engin static site generator. Please refer to +the main [CONTRIBUTING.md](https://github.com/render-engine/render-engine/blob/main/CONTRIBUTING.md) +for more details on how to contribute. + +## Render Engine CLI Specific Topics + +Render Engine CLI is a `uv` based project. For more information on installing `uv` and using it +please see the [uv documentation](https://docs.astral.sh/uv/#installation).To get started, for +this repository and check out your fork. + +```shell +git clone +``` + +Once you have checked out the repository, run `uv sync` and then activate the `venv` that was +created: + +```shell +uv sync +source .venv/bin/activate +``` + +Once you have done this you will be in the virtual environment and ready to work. It is recommended +that you do a local, editable install of the CLI in your virtual environment so that you can easily +work with the changes you have made. + +```shell +uv pip install -e . +``` + +This will allow you to test your changes via the command line. diff --git a/README.md b/README.md index e69de29..a05e46b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,51 @@ +## Render Engine CLI + +[![PyTest](https://github.com/render-engine/render-engine-cli/actions/workflows/test.yml/badge.svg)](https://github.com/render-engine/render-engine-cli/actions/workflows/test.yml) +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![Discord](https://img.shields.io/discord/1174377880118104156?label=Discord&color=purple)](https://discord.gg/2xMQ4j4d8m) + +Render Engine CLI is the CLI tool for the Render Engine static site generator. + +## Learn More + +- [CLI Documentation](https://render-engine.readthedocs.io/en/latest/cli/) +- [Check out the Render Engien Documentation](https://render-engine.readthedocs.io/en/latest/) +- [Contributors and Builders, Check out the Wiki](https://github.com/render-engine/render-engine/wiki) +- [Join the community!](https://discord.gg/2xMQ4j4d8m) + +## Installing the Render Engine CLI + +To use the render engine, you must have Python 3.10 or greater installed. You can download Python from [python.org](https://python.org). + +- Linux/MacOS: [python.org](https://python.org) +- Windows: [Microsoft Store](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K) + +The Render Engine CLI is available in PyPI and can be installed via `pip` or `uv`: + +```shell +pip install render-engine-cli # via pip +uv pip install render-engine-cli # via uv +``` + +Since render engine itself is one of the dependencies of the CLI there is no need to isntall +them separately. With that, the version of render engine in the CLI dependencies is not pinned +to a specific version so if you want to pin it you can do so either in your `requirements.txt` +(`pip`) or `pyproject.toml` (`uv`) files. + +```shell +# requirements.text +render-engine-cli +render-engine== + + +# pyproject.toml +[project] +dependencies = [ + "render-engine-cli", + "render-engine==" +] +``` + +## Getting Started + +Check out the [Getting Started](https://render-engine.readthedocs.io/en/latest/page/) Section in the [Documentation](https://render-engine.readthedocs.io) diff --git a/pyproject.toml b/pyproject.toml index e820465..6a453f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires-python = ">=3.10" dependencies = [ "click>=8.2.1", "cookiecutter>=2.6.0", - "render-engine>=2025.5.1", + "render-engine", "rich>=14.0.0", "toml>=0.10.2", "watchfiles>=1.1.0", @@ -55,5 +55,3 @@ select = ["E", "F", "I", "UP"] [build-system] requires = ["setuptools", "setuptools_scm", "wheel"] build-backend = "setuptools.build_meta" - - From 9d0937cb32b3d1e9afcb4a43e71e3afaf0b9e741 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 21 Jun 2025 16:24:27 -0400 Subject: [PATCH 2/5] Update lint jobs. --- .github/workflows/lint.yml | 40 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 11 +---------- 2 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..86acc0b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,40 @@ +name: Format and Lint +on: + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + lint-python: + name: Format and Lint Python + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Run Ruff + run: uv run ruff check . --output-format=github + - name: Ruff format + run: uv run ruff format . --check + + lint-docs: + name: Lint Markdown + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Markdown Lint base-files + uses: DavidAnson/markdownlint-cli2-action@v20 + with: + globs: | + *.md + .github/**/*.md + config: ./.markdownlint.json + - name: Markdown Lint Docs + uses: DavidAnson/markdownlint-cli2-action@v20 + with: + globs: docs/**/*.md + config: docs/.markdownlint.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9dd1aa6..17d098f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,17 +17,8 @@ on: - "tests/**" - "pyproject.toml" jobs: - lint-and-format: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install uv - uses: astral-sh/setup-uv@v5 - - name: Run Ruff - run: uv run ruff check . --output-format=github - - name: Ruff format - run: uv run ruff format . --check test-against-python-matrix: + name: PyTest strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] From 4e9d8564cf6d3ec7a16a25f69006aad4bbfc8461 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 21 Jun 2025 16:26:09 -0400 Subject: [PATCH 3/5] Add `.markdownlint.json`. Remove linting for `docs` since that doesn't exist. --- .github/workflows/lint.yml | 10 +++++----- .markdownlint.json | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .markdownlint.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 86acc0b..c4dc5d7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,8 +33,8 @@ jobs: *.md .github/**/*.md config: ./.markdownlint.json - - name: Markdown Lint Docs - uses: DavidAnson/markdownlint-cli2-action@v20 - with: - globs: docs/**/*.md - config: docs/.markdownlint.json +# - name: Markdown Lint Docs +# uses: DavidAnson/markdownlint-cli2-action@v20 +# with: +# globs: docs/**/*.md +# config: docs/.markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..cd07f00 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD041": false +} From 4571142c37f7e1a42ecd35750d5b0c9694bf6731 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 21 Jun 2025 16:51:25 -0400 Subject: [PATCH 4/5] Fix incorrect entry point. Add check of entry point to workflows. (#5) * Fix incorrect entry point. Add check of entry point to workflows. * Fix workflow. * Fix workflow part 2. --- .github/workflows/test.yml | 14 ++++++++++++++ pyproject.toml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17d098f..8e44913 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,3 +32,17 @@ jobs: - name: Run tests run: | uv run -p ${{ matrix.python-version }} pytest + + test-entry-point: + runs-on: ubuntu-latest + name: Check the configured entry point + steps: + - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Set up env + run: uv sync + - name: Install package + run: source .venv/bin/activate && uv pip install . + - name: Check entry point + run: source .venv/bin/activate && render-engine init --no-input diff --git a/pyproject.toml b/pyproject.toml index 6a453f5..657d524 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ repository = "https://github.com/render-engine/render-engine/" documentation = "https://render-engine.readthedocs.io/en/latest/" [project.scripts] -render-engine = "render_engine_cli:cli" +render-engine = "render_engine_cli.cli:app" [tool.pytest.ini_options] pythonpath = ["src"] From 07c4b8b08f6daeeb14ce9c4daaa134107697cd33 Mon Sep 17 00:00:00 2001 From: Dan Shernicoff Date: Sat, 21 Jun 2025 17:00:19 -0400 Subject: [PATCH 5/5] Add note about local editable installation to `CONTRIBUTING.md` --- CONTRIBUTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40c74d9..6bfff19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,13 @@ that you do a local, editable install of the CLI in your virtual environment so work with the changes you have made. ```shell -uv pip install -e . + +uv pip install . && uv pip install -e . ``` +**NOTE**: The above actually has you installing the CLI as uneditable and then as editable. This +is only needed as long as the main Render Engine install includes an entry point as there is a +conflict. The `uv pip install .` will overwrite the entry point for `render-engine` while the +second command, `uv pip insall -e .` will convert it to an editable install. + This will allow you to test your changes via the command line.