diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index c386fce7..00000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Lint - -on: [push, pull_request] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: psf/black@21.5b1 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/ci.yml similarity index 51% rename from .github/workflows/pythonpackage.yml rename to .github/workflows/ci.yml index 8665b42c..cce2084c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/ci.yml @@ -1,32 +1,36 @@ -name: Unit Tests +name: CI on: push: - branches: ["master"] pull_request: - branches: ["master"] + workflow_dispatch: jobs: - test: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 + test: + name: Unit Tests runs-on: ubuntu-latest strategy: - max-parallel: 4 + max-parallel: 5 matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - pip install "coveralls<3.0.0" + run: python -m pip install -U pip -r requirements-dev.txt "coveralls<3.0.0" - name: Run test suite env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3232a4d0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +exclude: '.git' +default_stages: [commit] +fail_fast: false + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + files: "pypika.*" + exclude: ".*json$|.*txt$|.*csv|.*md|.*svg" + - id: check-yaml + - id: no-commit-to-branch + args: ['--branch', 'master'] + - id: check-merge-conflict + - id: check-ast + - id: check-json + - id: check-toml + - id: check-yaml + - id: debug-statements + + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black diff --git a/pyproject.toml b/pyproject.toml index 5f182cea..dcc56bae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [tool.black] line-length = 120 skip-string-normalization = true -target-version = ['py36', 'py37', 'py38'] -exclude = ''' +target-version = ['py38', 'py39', 'py310', 'py311'] +force-exclude = ''' ( /( \.eggs # exclude a few common directories in the diff --git a/requirements-dev.txt b/requirements-dev.txt index def44f9d..3926afa7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,6 +9,3 @@ tox==3.14.3 tox-venv==0.4.0 tox-gh-actions==0.3.0 coverage==5.1 - -# Formatting -black==21.5b1 diff --git a/setup.cfg b/setup.cfg index be10a91c..46084aaf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,3 +13,4 @@ universal = 1 [flake8] exclude = docs, .git, __pycache__ max-line-length = 120 +per-file-ignores = __init__.py:F401 diff --git a/tox.ini b/tox.ini index cd8eb1d6..69d2e7e3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,pypy3 +envlist = py38,py39,py310,py311,pypy3 [testenv] deps = -r requirements-dev.txt commands = @@ -7,7 +7,7 @@ commands = coverage xml [gh-actions] python = - 3.6: py36 - 3.7: py37 3.8: py38 3.9: py39 + 3.10: py310 + 3.11: py311