Skip to content

Commit

Permalink
apply black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
engn33r committed Dec 3, 2023
1 parent 797b9a5 commit da7f286
Show file tree
Hide file tree
Showing 29 changed files with 1,599 additions and 616 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: websocket-client build and test
name: build and test

on: [push, pull_request]

Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/lint-black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Linting with black

on: [push, pull_request]

jobs:
black-lint:
runs-on: ubuntu-latest
name: black linting
steps:
- name: Check out source repository
uses: actions/checkout@v3
- name: Run black linting
uses: psf/black@stable
with:
options: "--check"
src: "."
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
flake8-lint:
runs-on: ubuntu-latest
name: lint
name: flake8 linting
steps:
- name: Check out source repository
uses: actions/checkout@v3
Expand All @@ -18,7 +18,7 @@ jobs:
run: |
pip3 install flake8
flake8 --version
flake8 . --show-source --statistics --count --ignore E231,E241,E501,E722,E741,F401,F403,F405,W504
flake8 . --show-source --statistics --count --ignore E231,E241,E501,E722,E741,F401,F403,F405,W503,W504
- name: Perform optional exit-zero flake8 linting
run: |
Expand Down
9 changes: 5 additions & 4 deletions compliance/test_fuzzingclient.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import traceback

import websocket

"""
Expand All @@ -21,8 +22,8 @@
limitations under the License.
"""

SERVER = 'ws://127.0.0.1:8642'
AGENT = 'py-websockets-client'
SERVER = "ws://127.0.0.1:8642"
AGENT = "py-websockets-client"


ws = websocket.create_connection(f"{SERVER}/getCaseCount")
Expand All @@ -32,7 +33,7 @@

case = 0
for case in range(1, count + 1):
url = f'{SERVER}/runCase?case={case}&agent={AGENT}'
url = f"{SERVER}/runCase?case={case}&agent={AGENT}"
status = websocket.STATUS_NORMAL
try:
ws = websocket.create_connection(url)
Expand All @@ -57,5 +58,5 @@
ws.close(status)

print(f"Ran {case} test cases.")
url = f'{SERVER}/updateReports?agent={AGENT}'
url = f"{SERVER}/updateReports?agent={AGENT}"
ws = websocket.create_connection(url)
27 changes: 16 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import os
import sys

sys.path.append(os.path.abspath('../..'))
sys.path.append(os.path.abspath('websocket'))
sys.path.append(os.path.abspath("../.."))
sys.path.append(os.path.abspath("websocket"))


# Don't skip __init__, which is skipped by default
Expand All @@ -29,25 +29,30 @@ def setup(app):


# -- Project information -----------------------------------------------------
project = 'websocket-client'
copyright = '2023'
author = 'liris'
project = "websocket-client"
copyright = "2023"
author = "liris"

# The full version, including alpha/beta/rc tags
release = '1.6.4'
release = "1.6.4"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.coverage',
'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
'sphinx.ext.autosectionlabel', 'sphinx.ext.doctest']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.autosectionlabel",
"sphinx.ext.doctest",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -60,7 +65,7 @@ def setup(app):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
14 changes: 7 additions & 7 deletions examples/echoapp_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import websocket
from threading import Thread
import time
import sys
import time
from threading import Thread

import websocket


def on_message(ws, message):
Expand Down Expand Up @@ -38,9 +39,8 @@ def run(*args):
host = "ws://echo.websocket.events/"
else:
host = sys.argv[1]
ws = websocket.WebSocketApp(host,
on_message=on_message,
on_error=on_error,
on_close=on_close)
ws = websocket.WebSocketApp(
host, on_message=on_message, on_error=on_error, on_close=on_close
)
ws.on_open = on_open
ws.run_forever()
3 changes: 2 additions & 1 deletion examples/rel_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import websocket
import rel

import websocket

addr = "wss://api.gemini.com/v1/marketdata/%s"

if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tag_date = 0
tag_svn_revision = 0

[flake8]
ignore = E231,E241,E501,E722,E741,F401,F403,F405,W504
ignore = E231,E241,E501,E722,E741,F401,F403,F405,W503,W504
statistics = True
count = True
show-source = True
25 changes: 12 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys

import pkg_resources
from setuptools import setup, find_packages
from setuptools import find_packages, setup

"""
setup.py
Expand Down Expand Up @@ -31,15 +32,15 @@
version=VERSION,
description="WebSocket client for Python with low level API options",
long_description=open("README.md").read(),
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
author="liris",
author_email="liris.pp@gmail.com",
maintainer="engn33r",
maintainer_email="websocket.client@proton.me",
license="Apache-2.0",
url="https://github.com/websocket-client/websocket-client.git",
download_url='https://github.com/websocket-client/websocket-client/releases',
python_requires='>=3.8',
download_url="https://github.com/websocket-client/websocket-client/releases",
python_requires=">=3.8",
extras_require={
"test": ["websockets"],
"optional": ["python-socks", "wsaccel"],
Expand All @@ -62,20 +63,18 @@
"Intended Audience :: Developers",
],
project_urls={
'Documentation': 'https://websocket-client.readthedocs.io/',
'Source': 'https://github.com/websocket-client/websocket-client/',
"Documentation": "https://websocket-client.readthedocs.io/",
"Source": "https://github.com/websocket-client/websocket-client/",
},
keywords='websockets client',
keywords="websockets client",
entry_points={
'console_scripts': [
'wsdump=websocket._wsdump:main',
"console_scripts": [
"wsdump=websocket._wsdump:main",
],
},
install_requires=install_requires,
packages=find_packages(),
package_data={
'websocket.tests': ['data/*.txt']
},
package_data={"websocket.tests": ["data/*.txt"]},
tests_require=tests_require,
test_suite="websocket.tests"
test_suite="websocket.tests",
)
Loading

0 comments on commit da7f286

Please sign in to comment.