diff --git a/.github/workflows/umbral-pre.yml b/.github/workflows/umbral-pre.yml index f05fc86..7e2d22b 100644 --- a/.github/workflows/umbral-pre.yml +++ b/.github/workflows/umbral-pre.yml @@ -130,12 +130,16 @@ jobs: working-directory: umbral-pre-python - name: Install pip dependencies - run: pip install mypy + run: pip install mypy ruff - name: Run mypy.stubtest run: python -m mypy.stubtest umbral_pre --allowlist stubtest-allowlist.txt working-directory: umbral-pre-python + - name: Run ruff + run: ruff check --output-format=github umbral_pre + working-directory: umbral-pre-python + trigger-wheels: runs-on: ubuntu-latest needs: test diff --git a/umbral-pre-python/pyproject.toml b/umbral-pre-python/pyproject.toml index 31ffe04..c2cfc89 100644 --- a/umbral-pre-python/pyproject.toml +++ b/umbral-pre-python/pyproject.toml @@ -1,2 +1,6 @@ [build-system] requires = ["setuptools", "wheel", "setuptools-rust"] + +[tool.ruff] +exclude = ["umbral_pre/__init__.py"] # false-positive unused-import +select = ["E", "F", "I"] \ No newline at end of file diff --git a/umbral-pre-python/umbral_pre/__init__.pyi b/umbral-pre-python/umbral_pre/__init__.pyi index 728ebc0..5ee27d6 100644 --- a/umbral-pre-python/umbral_pre/__init__.pyi +++ b/umbral-pre-python/umbral_pre/__init__.pyi @@ -1,5 +1,4 @@ -from typing import Optional, Tuple, List, final, Sequence - +from typing import List, Optional, Sequence, Tuple, final @final class SecretKey: @@ -55,7 +54,10 @@ class PublicKey: ... @staticmethod - def recover_from_prehash(prehash: bytes, signature: RecoverableSignature) -> PublicKey: + def recover_from_prehash( + prehash: bytes, + signature: RecoverableSignature + ) -> PublicKey: ... @@ -122,7 +124,11 @@ def encrypt(delegating_pk: PublicKey, plaintext: bytes) -> Tuple[Capsule, bytes] ... -def decrypt_original(delegating_sk: SecretKey, capsule: Capsule, ciphertext: bytes) -> bytes: +def decrypt_original( + delegating_sk: SecretKey, + capsule: Capsule, + ciphertext: bytes +) -> bytes: ...