diff --git a/.github/workflows/pr_qc.yml b/.github/workflows/pr_qc.yml new file mode 100644 index 0000000..7a46efe --- /dev/null +++ b/.github/workflows/pr_qc.yml @@ -0,0 +1,19 @@ +name: Pull Request Quality Checks +on: + pull_request: + types: [ opened, synchronize ] + branches: [ main ] +jobs: + run-qa: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + - name: Run qa + run: | + pip install ".[dev]" + make qa diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5311f25 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +lint: + ruff check . + +tests: + pytest ./test + +type: + pyright validator + +qa: + make lint + make type + make tests \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d0adc20..8a5be34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,22 @@ readme = "README.md" requires-python = ">= 3.8" dependencies = [ "rstr", - "guardrails-ai>=0.3.2", - "pydantic>=2.4.2", - "pytest" -] \ No newline at end of file + "guardrails-ai>=0.3.2" +] + +[project.optional-dependencies] +dev = [ + "pyright", + "pytest", + "ruff" +] + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = "-rP" +testpaths = [ + "test" +] + +[tool.pyright] +include = ["validator"] \ No newline at end of file diff --git a/test/test-validator.py b/test/test_validator.py similarity index 100% rename from test/test-validator.py rename to test/test_validator.py