chore: Remove bandit pre-commit hook, add "S" ruff linter code for ba… #1019
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
lint: | |
name: Run code checks and formatting hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 and dependencies | |
uses: ./.github/actions/python-deps | |
with: | |
pythonVersion: "3.10" | |
- name: Run pre-commit checks | |
run: uv run pre-commit run --all-files --verbose --show-diff-on-failure | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
deps: | |
# Oldest supported versions | |
- lakefs: "lakefs==0.2.0" | |
fsspec: "fsspec==2023.12.0" | |
# Latest versions | |
- lakefs: "lakefs>0" | |
fsspec: "fsspec>0" | |
name: "Tests: Python ${{ matrix.python-version }}, ${{ matrix.deps.lakefs }}, ${{ matrix.deps.fsspec }} (on ${{ matrix.os }})" | |
runs-on: ${{ matrix.os }} | |
services: | |
lakefs: | |
image: treeverse/lakefs:latest | |
ports: | |
- 8000:8000 | |
env: | |
LAKEFS_INSTALLATION_USER_NAME: "quickstart" | |
LAKEFS_INSTALLATION_ACCESS_KEY_ID: "AKIAIOSFOLQUICKSTART" | |
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | |
LAKEFS_DATABASE_TYPE: "local" | |
LAKEFS_AUTH_ENCRYPT_SECRET_KEY: "THIS_MUST_BE_CHANGED_IN_PRODUCTION" | |
LAKEFS_BLOCKSTORE_TYPE: "local" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Install deps: ${{ matrix.deps.lakefs }}, ${{ matrix.deps.fsspec }}" | |
run: | | |
uv lock -P ${{ matrix.deps.lakefs }} | |
uv lock -P ${{ matrix.deps.fsspec }} | |
- name: Install the project | |
run: uv sync --group dev | |
- name: Execute python tests | |
run: uv run pytest -s --cov=src --cov=fsspec --cov-branch --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
flags: ${{ matrix.python-version }} | |
docs: | |
name: Build documentation for lakefs-spec | |
runs-on: ubuntu-latest | |
services: | |
lakefs: | |
image: treeverse/lakefs:latest | |
ports: | |
- 8000:8000 | |
env: | |
LAKEFS_INSTALLATION_USER_NAME: "quickstart" | |
LAKEFS_INSTALLATION_ACCESS_KEY_ID: "AKIAIOSFOLQUICKSTART" | |
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | |
LAKEFS_DATABASE_TYPE: "local" | |
LAKEFS_AUTH_ENCRYPT_SECRET_KEY: "THIS_MUST_BE_CHANGED_IN_PRODUCTION" | |
LAKEFS_BLOCKSTORE_TYPE: "local" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.11 and dependencies | |
uses: ./.github/actions/python-deps | |
with: | |
pythonVersion: "3.11" | |
- name: Build documentation using mike | |
uses: ./.github/actions/mike-docs | |
with: | |
version: development | |
pre_release: true # include pre-release notification banner | |
push: ${{ github.ref == 'refs/heads/main' }} # build always, publish on 'main' only to prevent version clutter |