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

GitHub Actions: Lint with ruff instead of flake8 #47

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 6 additions & 12 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest tox
pip install pytest ruff tox
pip install -r requirements/test.txt
# Won't pass flake8 yet
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Lint with ruff
run: ruff .
- name: Test with tox
run: |
tox
run: tox
2 changes: 1 addition & 1 deletion examples/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def main():

if not args.C:
secure_socket.enable_crl(1)
secure_socket.load_crl_file(args.r, 1);
secure_socket.load_crl_file(args.r, 1)

secure_socket.connect((args.h, args.p))

Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

# pylint: disable=wrong-import-position

import os
import sys
from setuptools import setup
from setuptools.command.build_ext import build_ext

import re
VERSIONFILE = "wolfssl/_version.py"
Expand Down
6 changes: 3 additions & 3 deletions wolfssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from functools import wraps
import errno
from socket import (
socket, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_TYPE, error as socket_error
socket, AF_INET, SOCK_STREAM, error as socket_error
)

# pylint: disable=wildcard-import
Expand Down Expand Up @@ -487,7 +487,7 @@ def server_side(self):
"""
Returns True for server-side socket, otherwise False.
"""
return self._server_side;
return self._server_side

def dup(self):
raise NotImplementedError("Can't dup() %s instances" %
Expand Down Expand Up @@ -998,5 +998,5 @@ def _get_passwd(self, passwd, sz, rw, userdata):
for i in range(len(result)):
passwd[i] = result[i:i + 1]
return len(result)
except Exception as e:
except Exception:
raise ValueError("Problem getting password from callback")
3 changes: 1 addition & 2 deletions wolfssl/_build_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

# pylint: disable=missing-docstring, invalid-name

import argparse
from contextlib import contextmanager
from distutils.util import get_platform
from cffi import FFI
Expand Down Expand Up @@ -105,7 +104,7 @@ def checkout_ref(ref):
current = subprocess.check_output(
["git", "describe", "--all", "--exact-match"]
).strip().decode().split('/')[-1]
except:
except Exception:
pass

if current != ref:
Expand Down