diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..c4dc5d7 --- /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..8e44913 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"] @@ -41,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/.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 +} 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..6bfff19 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# 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 . && 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. 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..657d524 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", @@ -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"] @@ -55,5 +55,3 @@ select = ["E", "F", "I", "UP"] [build-system] requires = ["setuptools", "setuptools_scm", "wheel"] build-backend = "setuptools.build_meta" - -