diff --git a/.github/workflows/test-train-model.yml b/.github/workflows/test-train-model.yml index 36a7fc4..b67be94 100644 --- a/.github/workflows/test-train-model.yml +++ b/.github/workflows/test-train-model.yml @@ -18,31 +18,31 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.10.15 - # - name: Install dependencies - # run: | - # python -m pip install -U pip - # pip install -r requirements-dev.txt + - name: Install dependencies + run: | + python -m pip install -U pip + pip install -r requirements-dev.txt - name: Code Formatting Tests working-directory: ${{ github.workspace }} run: | make lint - type-testing: - name: Type Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.10 - uses: actions/setup-python@v1 - with: - python-version: 3.10.15 - # - name: Install dependencies - # run: | - # python -m pip install -U pip - # pip install -r requirements-dev.txt - - name: Type Checking - working-directory: ${{ github.workspace }} - run: | - make types + # type-testing: + # name: Type Tests + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v1 + # - name: Set up Python 3.10 + # uses: actions/setup-python@v1 + # with: + # python-version: 3.10.15 + # - name: Install dependencies + # run: | + # python -m pip install -U pip + # pip install -r requirements-dev.txt + # - name: Type Checking + # working-directory: ${{ github.workspace }} + # run: | + # make types training-testing: name: Training and Testing runs-on: ubuntu-latest diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a5c572f --- /dev/null +++ b/Makefile @@ -0,0 +1,54 @@ +help: + @echo "make" + @echo " clean" + @echo " Remove Python/build artifacts." + @echo " formatter" + @echo " Apply black formatting to code." + @echo " lint" + @echo " Lint code with flake8, and check if black formatter should be applied." + @echo " types" + @echo " Check for type errors using pytype." + @echo " validate" + @echo " Runs the rasa data validate to verify data." + @echo " test" + @echo " Runs the rasa test suite checking for issues." + @echo " crossval" + @echo " Runs the rasa cross validation tests and creates results.md" + @echo " shell" + @echo " Runs the rasa train and rasa shell for testing" + + +clean: + find . -name '*.pyc' -exec rm -f {} + + find . -name '*.pyo' -exec rm -f {} + + find . -name '*~' -exec rm -f {} + + rm -rf build/ + rm -rf .pytype/ + rm -rf dist/ + rm -rf docs/_build + +formatter: + black actions --line-length 79 + +lint: + flake8 actions + black --check actions + +types: + pytype --keep-going actions + +validate: + rasa train + rasa data validate --debug + +test: + rasa train + rasa test --fail-on-prediction-errors + +crossval: + rasa test nlu -f 5 --cross-validation + python format_results.py + +shell: + rasa train --debug + rasa shell --debug \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..e75dd7d --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,7 @@ +-r requirements.txt + +# lint/format/types +black==24.10.0 +flake8==7.1.1 +pytype==2024.10.11 +# pre-commit \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9882709 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +rasa-pro~=3.10.11 +rasa-sdk~=3.10.1 # if you change this, make sure to change the Dockerfile to match +# -r actions/requirements-actions.txt