From a8b78d3522f8f46611de9cbd31a1524bfbae21de Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 13 Jan 2025 14:34:52 -0600 Subject: [PATCH] Wip/linting hooks (#43) * add minimal pyproject.yaml to configure tools * modern pip will stop supporting installation in editable mode of a git url source * comment out ignores * add linter workflow * update ruff output format --- .github/workflows/ci.yaml | 11 +++++++++++ pyproject.toml | 28 ++++++++++++++++++++++++++++ requirements.txt | 2 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 pyproject.toml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..30f3e9a --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,11 @@ +on: push +jobs: + linting: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - run: pip install ruff + - run: ruff check --output-format=github . diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..68fdc15 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,28 @@ +[build-system] +requires = ["pbr>=6.0.0", "setuptools>=64.0.0"] +build-backend = "pbr.build" + +[tool.ruff] +line-length = 79 + +[tool.ruff.lint] +select = [ + "E", # pycodestyle (error) + "F", # pyflakes + "G", # flake8-logging-format + "LOG", # flake8-logging +] + + +ignore = [ + "E501", # line too long + # "G002", # Logging statement uses `%` + # "G004", # logging statement uses f-string + # "E741", # Ambiguous variable name + # "F401", # imported but unused +] + +[tool.ruff.lint.per-file-ignores] +"blazar_dashboard/test/settings.py" = [ + # "F405", #HORIZON_CONFIG` may be undefined, or defined from star imports +] diff --git a/requirements.txt b/requirements.txt index 11216e7..4301c16 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,5 @@ # # PBR should always appear first pbr!=2.1.0,>=2.0.0 # Apache-2.0 --e git+https://github.com/ChameleonCloud/python-blazarclient.git@chameleoncloud/2023.1#egg=python_blazarclient +git+https://github.com/ChameleonCloud/python-blazarclient.git@chameleoncloud/2023.1#egg=python_blazarclient horizon>=17.1.0 # Apache-2.0