Skip to content

Commit

Permalink
moving to ruff (#157)
Browse files Browse the repository at this point in the history
flake8 + black -> ruff
  • Loading branch information
tarekziade authored Nov 8, 2023
1 parent 27f7599 commit 6afd557
Show file tree
Hide file tree
Showing 40 changed files with 247 additions and 276 deletions.
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name: CI
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- 'pypy-3.8'
- 'pypy-3.9'
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "pypy-3.8"
- "pypy-3.9"
fail-fast: false
name: Test on Python ${{ matrix.python-version }}
steps:
Expand Down
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ test: build
docs: build
$(BIN)/tox -e docs

$(BIN)/black:
$(BIN)/pip install black
$(BIN)/ruff:
$(BIN)/pip install ruff

ruff: $(BIN)/ruff
$(BIN)/ruff check setup.py molotov/
$(BIN)/ruff format setup.py molotov/*.py

black: $(BIN)/black
$(BIN)/black setup.py molotov/
$(BIN)/flake8 molotov/
89 changes: 44 additions & 45 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,47 +31,48 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinxarg.ext', 'sphinx.ext.autodoc']
extensions = ["sphinxarg.ext", "sphinx.ext.autodoc"]

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

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'Molotov'
copyright = '2017, Tarek Ziadé'
author = 'Tarek Ziadé'
project = "Molotov"
copyright = "2017, Tarek Ziadé"
author = "Tarek Ziadé"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
import molotov
import molotov # noqa

release = version = molotov.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
Expand All @@ -82,48 +83,50 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
highlight_language = 'python3'
html_theme = "alabaster"
highlight_language = "python3"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
html_theme_options = {
'logo': 'logo.png',
'description': 'Load Testing Tool',
'github_user': 'tarekziade',
'github_repo': 'molotov',
'github_button': True,
'github_type': 'star',
'github_banner': True,
'travis_button': False,
'pre_bg': '#FFF6E5',
'note_bg': '#E5ECD1',
'note_border': '#BFCF8C',
'body_text': '#482C0A',
'sidebar_text': '#49443E',
'sidebar_header': '#4B4032',
"logo": "logo.png",
"description": "Load Testing Tool",
"github_user": "tarekziade",
"github_repo": "molotov",
"github_button": True,
"github_type": "star",
"github_banner": True,
"travis_button": False,
"pre_bg": "#FFF6E5",
"note_bg": "#E5ECD1",
"note_border": "#BFCF8C",
"body_text": "#482C0A",
"sidebar_text": "#49443E",
"sidebar_header": "#4B4032",
}


html_sidebars = {
'**': [
'about.html', 'navigation.html', 'searchbox.html',
"**": [
"about.html",
"navigation.html",
"searchbox.html",
]
}


# 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,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Molotovdoc'
htmlhelp_basename = "Molotovdoc"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -132,15 +135,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -150,19 +150,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Molotov.tex', 'Molotov Documentation',
'Tarek Ziadé', 'manual'),
(master_doc, "Molotov.tex", "Molotov Documentation", "Tarek Ziadé", "manual"),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'molotov', 'Molotov Documentation',
[author], 1)
]
man_pages = [(master_doc, "molotov", "Molotov Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -171,10 +167,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Molotov', 'Molotov Documentation',
author, 'Molotov', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Molotov",
"Molotov Documentation",
author,
"Molotov",
"One line description of project.",
"Miscellaneous",
),
]



5 changes: 2 additions & 3 deletions molotov/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import random
import functools
import asyncio

import functools
import random

_SCENARIO = {}

Expand Down
3 changes: 2 additions & 1 deletion molotov/dummy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
""" Molotov-based test.
"""
import molotov
import random
from time import sleep

import molotov


@molotov.global_setup()
def starting(args):
Expand Down
8 changes: 4 additions & 4 deletions molotov/quickstart/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
import shutil
import os
import argparse
from molotov import __version__
import os
import shutil
import sys

from molotov import __version__

_DEFAULTS = {"target_dir": "."}
_PREFIX = "> "
Expand Down
2 changes: 1 addition & 1 deletion molotov/quickstart/loadtest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
""" Molotov-based test.
"""
import json
from molotov import scenario, setup, global_setup, teardown, global_teardown

from molotov import global_setup, global_teardown, scenario, setup, teardown

# This is the service you want to load test
_API = "http://localhost:8080"
Expand Down
Loading

0 comments on commit 6afd557

Please sign in to comment.