From 86d0af40d337aba6ead6df50b0451a5dd5c76117 Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Mon, 2 Sep 2024 10:45:06 +0200 Subject: [PATCH] use ruff --- .github/workflows/test.yml | 25 ++++++++++++++----------- pyproject.toml | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce549c1..aab916f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,14 @@ name: Tests on: [push, pull_request] jobs: - Test: + ruff: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 + test: + runs-on: ubuntu-latest + needs: ruff strategy: matrix: python-version: @@ -13,18 +19,19 @@ jobs: - "3.9" - "3.10" - "3.11" + - "3.12" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Get full python version id: full-python-version run: | - echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))") + echo version=$(python -c "import sys, platform; print('.'.join(str(v) for v in sys.version_info[:3]) + '_' + platform.machine())") >> $GITHUB_OUTPUT - name: Set up cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: .venv key: ${{ runner.os }}-venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} @@ -34,13 +41,9 @@ jobs: poetry config virtualenvs.in-project true - name: Install dependencies run: poetry install - - name: Lint - run: | - poetry run pylama wapi2nsconf - - name: Check formatting + - name: Ruff run: | - poetry run isort --check wapi2nsconf - poetry run black --check wapi2nsconf + poetry run ruff check wapi2nsconf - name: Check example configuration file run: | poetry run wapi2nsconf --check --conf wapi2nsconf-example.yaml diff --git a/pyproject.toml b/pyproject.toml index 4a66b5d..d28e855 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ # PEP 518: https://www.python.org/dev/peps/pep-0518/ [tool.poetry] name = "wapi2nsconf" -version = "0.4.1" +version = "0.4.2" description = "Infoblox WAPI to DNS server configuration tool" authors = ["Jakob Schlyter "] license = "BSD"