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

Add lint workflow #601

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

ThirVondukr
Copy link

Closes #600

This PR adds:

Package Manager

https://docs.astral.sh/uv/
Tool to manage project dependencies, with support for pyproject.toml (https://peps.python.org/pep-0621/)

Mypy

https://github.com/python/mypy
Static type checker

Ruff

https://docs.astral.sh/ruff/
Linter and formatter

workflows/lint.yaml uses python 3.12, I don't think this should be an issue as long as target versions are configured properly for ruff and mypy.

@ThirVondukr
Copy link
Author

Latest versions of mypy and ruff only support python 3.8 and 3.7 respectively 🤔

@d0tiKs
Copy link

d0tiKs commented Mar 12, 2025

Latest versions of mypy and ruff only support python 3.8 and 3.7 respectively 🤔

Comparing to novnc compatibility you mean ?

What versions of Python does Ruff support?
Ruff can lint code for any Python version from 3.7 onwards, including Python 3.13.
[...]
Ruff is installable under any Python version from 3.7 onwards.

And for mypy it seems to be : Requires: Python >=3.9
https://pypi.org/project/mypy/

@ThirVondukr
Copy link
Author

ThirVondukr commented Mar 13, 2025

Comparing to novnc compatibility you mean ?

Yes, currently latest release of websockify on pypi states it's compatible with 3.4 and on master branch it's 3.6.
As for mypy - it's possible to use slightly older version, I think that's already handled in uv.lock:

[package.dev-dependencies]
dev = [
    { name = "mypy", version = "0.971", ..., marker = "python_full_version < '3.7'" },
    { name = "mypy", version = "1.4.1", ..., marker = "python_full_version == '3.7.*'" },
    { name = "mypy", version = "1.14.1", ..., marker = "python_full_version == '3.8.*'" },
    { name = "mypy", version = "1.15.0", ..., marker = "python_full_version >= '3.9'" },
]

only quite early version of ruff (0.0.17) supports 3.6 though

@ThirVondukr
Copy link
Author

Also it seems like only ~3% of downloads are for python 3.6 and 3.7 https://pypistats.org/packages/websockify

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.

Add linter to our workflow.
2 participants