diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml new file mode 100644 index 0000000..9a5bd54 --- /dev/null +++ b/.github/workflows/flake8.yml @@ -0,0 +1,25 @@ +# https://github.com/marketplace/actions/flake8-annotate-action + +name: Flake8 Lint +"on": ["push"] + +jobs: + flake8: + name: Flake8 tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: gijswobben/flake8-action@main + with: + strict: true + strict_for: "E501" + not_strict_for: "E502,E503" + message_title: "Flake8 error found" + flake8_config: | + [flake8] + exclude = examples/ tests/ + max-line-length = 120 + extend-ignore = + # See https://github.com/PyCQA/pycodestyle/issues/373 + E203, + additional_packages: pep8-naming==0.13.2 flake8-annotations==2.9.1 darglint==1.8.1 flake8-bugbear==22.10.27 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml deleted file mode 100644 index 1b85a0f..0000000 --- a/.github/workflows/python-package.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Python package - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest diff --git a/__pycache__/subtotxt.cpython-310-pytest-8.3.2.pyc b/__pycache__/subtotxt.cpython-310-pytest-8.3.2.pyc new file mode 100644 index 0000000..5205006 Binary files /dev/null and b/__pycache__/subtotxt.cpython-310-pytest-8.3.2.pyc differ diff --git a/pyproject.toml b/pyproject.toml index 23650bc..1a7ad54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,4 +21,11 @@ exclude = ''' | venv | test/resources )/ -''' \ No newline at end of file +''' + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = "-ra -q" +testpaths = [ + "tests" +] \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file