From dfedb27f65ac1e62a850ba7499673af1a4a1f6ef Mon Sep 17 00:00:00 2001 From: Elias Gabriel Date: Tue, 26 Dec 2023 22:51:37 -0500 Subject: [PATCH] ci: bump tooling and linting versions --- .github/workflows/build.yml | 88 ++++++++++++++++++------------------- casbin/config/config.py | 1 - requirements_dev.txt | 2 +- 3 files changed, 44 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b10174..737f0e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,55 +11,53 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ["3.9", "3.10", "3.11"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -r requirements.txt - pip install -r requirements_dev.txt - pip install coveralls - pip install pytest - pip install pytest-benchmark + - name: Install dependencies + run: | + pip install -r requirements.txt + pip install -r requirements_dev.txt + pip install coveralls - - name: Run tests - run: coverage run -m unittest discover -s tests -t tests + - name: Run tests + run: coverage run -m unittest discover -s tests -t tests - - name: Run benchmark - run: python3 -m pytest - --benchmark-verbose - --benchmark-columns=mean,stddev,iqr,ops,rounds - tests/benchmarks/benchmark_model.py - tests/benchmarks/benchmark_management_api.py - tests/benchmarks/benchmark_role_manager.py + - name: Run benchmark + run: python3 -m pytest + --benchmark-verbose + --benchmark-columns=mean,stddev,iqr,ops,rounds + tests/benchmarks/benchmark_model.py + tests/benchmarks/benchmark_management_api.py + tests/benchmarks/benchmark_role_manager.py - - name: Upload coverage data to coveralls.io - run: coveralls --service=github - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_FLAG_NAME: ${{ matrix.os }} - ${{ matrix.python-version }} - COVERALLS_PARALLEL: true + - name: Upload coverage data to coveralls.io + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.os }} - ${{ matrix.python-version }} + COVERALLS_PARALLEL: true lint: name: Run Linters runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Super-Linter - uses: github/super-linter@v4.9.2 + uses: github/super-linter@v5.7.2 env: VALIDATE_ALL_CODEBASE: false VALIDATE_PYTHON_BLACK: true @@ -74,36 +72,36 @@ jobs: runs-on: ubuntu-latest container: python:3-slim steps: - - name: Finished - run: | - pip3 install --upgrade coveralls - coveralls --finish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: name: Release runs-on: ubuntu-latest - needs: [ test, coveralls ] + needs: [test, coveralls] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - + - name: Setup Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: '18' + node-version: "18" - name: Setup run: npm install - + - name: Set up python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.11 - + - name: Release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/casbin/config/config.py b/casbin/config/config.py index 56c6ba3..30299b4 100644 --- a/casbin/config/config.py +++ b/casbin/config/config.py @@ -96,7 +96,6 @@ def _parse_buffer(self, f): buf.append(p) def _write(self, section, line_num, b): - buf = "".join(b) if len(buf) <= 0: return diff --git a/requirements_dev.txt b/requirements_dev.txt index 53cde02..af37e82 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ -r requirements.txt -black==21.6b0 +black==23.11.0 pytest==7.0.1 pytest-benchmark==3.4.1 \ No newline at end of file