From c51bf5b5882b059e2d4e51d25a2384df804885dc Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 1 May 2024 08:49:20 -0700 Subject: [PATCH 1/3] Modernize ruff config in pyproject.toml --- pyproject.toml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 916341ff..9d97e822 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,9 +88,13 @@ exclude_lines = [ ] [tool.ruff] +line-length = 110 +target-version = "py310" exclude = [ "__init__.py", ] + +[tool.ruff.lint] ignore = [ "N802", "N803", @@ -107,7 +111,6 @@ ignore = [ "D200", "D205", ] -line-length = 110 select = [ "E", # pycodestyle "F", # pyflakes @@ -116,13 +119,12 @@ select = [ "D", # pydocstyle "UP", # pyupgrade ] -target-version = "py310" extend-select = [ "RUF100", # Warn about unused noqa ] -[tool.ruff.pycodestyle] +[tool.ruff.lint.pycodestyle] max-doc-length = 79 -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "numpy" From 2554c98c1a52265035601404fef5026b2379da1e Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 1 May 2024 08:50:28 -0700 Subject: [PATCH 2/3] Use f-strings --- misc/makeHilbertLuts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/makeHilbertLuts.py b/misc/makeHilbertLuts.py index b436a9d2..22d2b3e2 100644 --- a/misc/makeHilbertLuts.py +++ b/misc/makeHilbertLuts.py @@ -245,11 +245,11 @@ def make_TR_algo3_lut(M): for i, x in enumerate(algo2_lut): if i % 8 == 0: print("\n ", end="") - print(" 0x%02x" % x, end="," if i != len(algo2_lut) - 1 else "") + print(f" 0x{x:02x}", end="," if i != len(algo2_lut) - 1 else "") print("\n}\n") print("alignas(64) static uint8_t const HILBERT_INVERSE_LUT_3[256] = {", end="") for i, x in enumerate(algo3_lut): if i % 8 == 0: print("\n ", end="") - print(" 0x%02x" % x, end="," if i != len(algo3_lut) - 1 else "") + print(f" 0x{x:02x}", end="," if i != len(algo3_lut) - 1 else "") print("\n}\n") From 710ac6816ac021d0d90139f9208fc969974688a1 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 1 May 2024 08:54:29 -0700 Subject: [PATCH 3/3] Modernize action versions --- .github/workflows/build.yaml | 18 +++++++++--------- .github/workflows/cmake.yaml | 4 ++-- .github/workflows/lint.yaml | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f7cce0d8..fde0e23a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,13 +16,13 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Need to clone everything to determine version from git. fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" @@ -41,12 +41,12 @@ jobs: needs: [build_and_test] if: startsWith(github.ref, 'refs/tags/') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 cache: "pip" @@ -60,7 +60,7 @@ jobs: run: | python -m build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/* @@ -86,13 +86,13 @@ jobs: # with: # platforms: arm64 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Need to clone everything to embed the versiona fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 @@ -103,7 +103,7 @@ jobs: - name: Build and create distribution run: | python -m cibuildwheel --output-dir dist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/* @@ -111,7 +111,7 @@ jobs: needs: [pypi_sdist_build, pypi_wheel_build] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: artifact path: dist diff --git a/.github/workflows/cmake.yaml b/.github/workflows/cmake.yaml index 1f589808..78f58dbb 100644 --- a/.github/workflows/cmake.yaml +++ b/.github/workflows/cmake.yaml @@ -10,13 +10,13 @@ jobs: cmake: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # Need to clone everything to determine version from git. fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6c463eed..59bae3f1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,5 +12,5 @@ jobs: ruff: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: chartboost/ruff-action@v1