Conversation
|
Latest versions of mypy and ruff only support python 3.8 and 3.7 respectively 🤔 |
Comparing to novnc compatibility you mean ?
And for mypy it seems to be : |
Yes, currently latest release of websockify on pypi states it's compatible with 3.4 and on master branch it's 3.6. only quite early version of ruff ( |
|
Also it seems like only ~3% of downloads are for python 3.6 and 3.7 https://pypistats.org/packages/websockify |
|
@ThinLinc-Zeijlon Sorry to ping you, but I'm not quite sure who maintains the repository right now, but I see that the last commit/release was made by you. |
|
@ThirVondukr, Thank you for your patience, I'll take a look at your changes 🙂 |
|
|
||
| # Intellij IDEs | ||
| .idea |
There was a problem hiding this comment.
Local settings folders/files shouldn't be added to the repo.
There was a problem hiding this comment.
I thought intellij-based ide's are kind of common and adding that to .gitignore made sense, so contributors don't have do do that themselves. I can remove that if you want though.
| "jwcrypto>=1.5.1", | ||
| "numpy>=1.19.0", | ||
| "redis>=4.3.0", | ||
| "requests>=2.27.0", |
There was a problem hiding this comment.
I'm not sure about targeting versions here, where did these come from?
There was a problem hiding this comment.
They're probably the latest compatible releases with 3.7, I don't quite remember if I pulled these manually or uv did it.
There was a problem hiding this comment.
Since lock-files are meant for maintaining a local state, we don't want to commit these.
There was a problem hiding this comment.
I think lock file is fine to have in a repo. Usually if the project is deployed somewhere (which isn't the case here) you'd want all builds to be reproducible, so lock file helps with that, but it can be used for CI there. (Also you won't really want for dev dependencies to be "automatically" updated either).
| - ruff format --check . | ||
| - ruff check . |
There was a problem hiding this comment.
We'd like to maintain support for older systems. Could you check how far we could get with something more tried and tested like flake8 and pylint?
There was a problem hiding this comment.
I didn't use these for quite a while, and I didn't use flake8 since migrating to ruff around a year ago. It should include majority of flake8 and some of the pylint checks though.
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install uv |
There was a problem hiding this comment.
Shouldn't setup.py be removed if we are converting to pyproject.toml?
There was a problem hiding this comment.
Yes, it could be removed later.
| if cqueue or c_pend: | ||
| wlist.append(self.request) |
There was a problem hiding this comment.
This is a nice improvement!
| @@ -1,23 +1,26 @@ | |||
| #!/usr/bin/env python | |||
|
|
|||
| ''' | |||
There was a problem hiding this comment.
I think this is a bit too strict. Can the linter be configured to ignore these types of changes?
There was a problem hiding this comment.
Yes, that can be configured to preserve quotes, but the default style is using ", I personally prefer it that way.
https://docs.astral.sh/ruff/settings/#format_quote-style
There was a problem hiding this comment.
Personally I don't think it matters that much, having one quote style is better in my opinion, plus developers still can use whatever quote character they want, it would just get reformatted later, but choice is up to you on that.
| if closed: | ||
| break | ||
|
|
||
| if __name__ == '__main__': |
There was a problem hiding this comment.
In general, we want the choice of quotation characters to be up the developer.
| parser.add_option( | ||
| "--verbose", | ||
| "-v", | ||
| action="store_true", | ||
| help="verbose messages and per frame traffic", | ||
| ) | ||
| parser.add_option("--cert", default="self.pem", help="SSL certificate file") | ||
| parser.add_option( | ||
| "--key", default=None, help="SSL key file (if separate from cert)" | ||
| ) | ||
| parser.add_option( | ||
| "--ssl-only", action="store_true", help="disallow non-encrypted connections" | ||
| ) |
There was a problem hiding this comment.
I think I can guess the strategy it had when formatting here, but I think this made the code less readable.
There was a problem hiding this comment.
I think generally you'd want that code to be either on one line:
parser.add_option("--verbose", "-v", action="store_true", help="verbose messages and per frame traffic")or like this:
parser.add_option(
"--verbose",
"-v",
action="store_true",
help="verbose messages and per frame traffic",
)To force the second style you'd need to add , to the last argument, but I think formatter could be disabled for certain code blocks: https://docs.astral.sh/ruff/formatter/#format-suppression
|
@CendioOssman and @samhed, what are your thoughts on adding |
|
I'd prefer something more traditional, like flake8. It'll be more generally available and familiar to people. |
|
@CendioOssman |
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.yamluses python 3.12, I don't think this should be an issue as long as target versions are configured properly for ruff and mypy.