Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure ruff #129

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/umbral-pre.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: some gh actions should have their versions updated. eg. checkout is at v4 now, along with others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in this PR: #130

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions umbral-pre-python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
14 changes: 10 additions & 4 deletions umbral-pre-python/umbral_pre/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Optional, Tuple, List, final, Sequence

from typing import List, Optional, Sequence, Tuple, final

@final
class SecretKey:
Expand Down Expand Up @@ -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:
...


Expand Down Expand Up @@ -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:
...


Expand Down
Loading