diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 8903e0e..5dab399 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . + pip install ".[validate]" - name: Validate LSL definitions via jsonschema run: | diff --git a/.gitignore b/.gitignore index 4e8be86..20540b7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ __pycache__/ *.egg-info/ .ruff_cache/ .venv/ + +build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b9dee95..483c854 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,12 +17,27 @@ Thank you for your interest in contributing to the LSL definitions repository! T ## How to Contribute -1. **Fork** this repository -2. **Create a branch** for your changes (`git checkout -b improve-documentation`) -3. **Make your changes** to `lsl_definitions.yaml` -4. **Test** that your YAML is valid -5. **Commit** your changes with a clear message -6. **Push** to your fork and **submit a pull request** + 1. **Fork** this repository + 2. **Create a branch** for your changes (`git checkout -b improve-documentation`) + 3. **Make your changes** to `lsl_definitions.yaml` + 4. **Test** that your YAML is valid (See [Running validation locally](#running-validation-locally)) + 5. **Commit** your changes with a clear message + 6. **Push** to your fork and **submit a pull request** + +## Running validation locally + +Validation is done with python and the validate.py script you will need to setup a python virtual environment and install the dependancies + +### Setup +```bash +python -m venv .venv +source .venv/bin/activate +pip install ".[validate]" +``` +Now you should be able to run the validation script as specified in the `pyproject.toml` +```bash +validate-lsl-definitions-via-jsonschema +``` ## Pull Request Guidelines diff --git a/pyproject.toml b/pyproject.toml index bf92e08..d02e92a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "jsonschema", "PyYAML", "llsd" ] @@ -39,6 +38,11 @@ Homepage = "https://github.com/secondlife/lsl-definitions" Repository = "https://github.com/secondlife/lsl-definitions" Issues = "https://github.com/secondlife/lsl-definitions/issues" +[project.optional-dependencies] +validate = [ + "jsonschema", +] + [tool.setuptools] py-modules = [ "gen_definitions",