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

Beautify code #97

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

andrew000
Copy link

  • Move project to UV; https://docs.astral.sh/uv
  • Add static type checker MyPy
  • Add linter and code formatter ruff
  • Add pre-commit
  • Reformat code using ruff
  • Make code more secure (stop using os.path, os.system)
  • Update workflow python_simplified.yml
  • Update workflow python_detailed.yml
  • Drop py3.8, because of EOL.

Drop workflow python version from 3.10 to 3.9 to be sure that the library will work on py3.9+. Also, I want to add matrix to test the library on 3.9, 3.10, 3.11, 3.12, 3.13, but I don't see anything deprecated in 3.9 that can't be in 3.13 in this code.

Add typing
Add pre-commit
Reformat code
Make code more secure
Update workflow python_simplified.yml
Update workflow python_detailed.yml

Signed-off-by: andrew000 <[email protected]>
oqs/oqs.py Outdated
Comment on lines 356 to 363
# TODO: What should it return?
# 1. tuple[bytes | int, bytes | int]
# 2. tuple[bytes, bytes | int]
# 3. tuple[bytes, bytes] | int
return (
bytes(cast(bytes, ciphertext)),
bytes(cast(bytes, shared_secret)) if rv == OQS_SUCCESS else 0,
)
Copy link
Author

@andrew000 andrew000 Nov 14, 2024

Choose a reason for hiding this comment

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

What function should return?

Here function returns: tuple[bytes, bytes | int]

But I think developers may have made a mistake and wanted to return: tuple[bytes, bytes] | int

What can you say about this?

oqs/oqs.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants