Skip to content

Commit

Permalink
Merge pull request #14 from HaoZeke/morePrecommit
Browse files Browse the repository at this point in the history
MAINT,BLD: More precommit
  • Loading branch information
HaoZeke authored Jul 9, 2023
2 parents 0b11a17 + bfc2538 commit 4ee482b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.257'
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.272
hooks:
- id: ruff
args: ["--fix"]
args: ["--fix", "--show-source"]
4 changes: 1 addition & 3 deletions asv_runner/benchmarks/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ def _get_attr(source, name, ignore_case=False):
"""
if not ignore_case:
return getattr(source, name, None)
attrs = [
getattr(source, key) for key in dir(source) if key.lower() == name.lower()
]
attrs = [getattr(source, key) for key in dir(source) if key.lower() == name.lower()]

if len(attrs) > 1:
raise ValueError(f"{source.__name__} contains multiple {name} functions.")
Expand Down
4 changes: 1 addition & 3 deletions asv_runner/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def _run_server(args):
# Import benchmark suite before forking.
# Capture I/O to a file during import.
with posix_redirect_output(stdout_file, permanent=False):
for _ in disc_benchmarks(
benchmark_dir, ignore_import_errors=True
):
for _ in disc_benchmarks(benchmark_dir, ignore_import_errors=True):
pass

# Report result
Expand Down
39 changes: 19 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'asv_runner'
copyright = '2023, asv Developers'
author = 'asv Developers'
release = '0.0.6'
project = "asv_runner"
copyright = "2023, asv Developers"
author = "asv Developers"
release = "0.0.6"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'myst_parser',
'autodoc2',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.githubpages',
'sphinx_contributors',
'sphinx_copybutton',
'sphinx_design',
'sphinxcontrib.spelling',
"myst_parser",
"autodoc2",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.githubpages",
"sphinx_contributors",
"sphinx_copybutton",
"sphinx_design",
"sphinxcontrib.spelling",
]

autodoc2_render_plugin = "myst"
Expand All @@ -37,20 +37,19 @@
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'asv': ('https://asv.readthedocs.io/en/latest/', None),
"python": ("https://docs.python.org/3/", None),
"asv": ("https://asv.readthedocs.io/en/latest/", None),
}

templates_path = ['_templates']
templates_path = ["_templates"]
exclude_patterns = []



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'furo'
html_static_path = ['_static']
html_theme = "furo"
html_static_path = ["_static"]

html_theme_options = {
"source_repository": "https://github.com/HaoZeke/asv_runner/",
Expand Down

0 comments on commit 4ee482b

Please sign in to comment.