mirror of
https://github.com/andreinechaev/nvcc4jupyter.git
synced 2026-06-13 18:50:47 +05:30
Move flake8 config from toml to .flake8 as flake8 does not play nice with pyproject.toml and add pre-commit hook for flake8
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
[flake8]
|
||||||
|
max-line-length = 79
|
||||||
|
select = F,E,W,B,B901,B902,B903
|
||||||
|
exclude = .eggs,.git,.tox,nssm,obj,out,packages,pywin32,tests,swagger_client
|
||||||
|
ignore = E722,B001,W503,E203
|
||||||
+15
-1
@@ -22,4 +22,18 @@ repos:
|
|||||||
rev: 23.1.0
|
rev: 23.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: [--line-length, "79", --experimental-string-processing]
|
args: ["--config", "pyproject.toml"]
|
||||||
|
|
||||||
|
# python import sorting
|
||||||
|
- repo: https://github.com/PyCQA/isort
|
||||||
|
rev: 5.12.0
|
||||||
|
hooks:
|
||||||
|
- id: isort
|
||||||
|
args: ["--settings-path", "pyproject.toml"]
|
||||||
|
|
||||||
|
# python check (PEP8), programming errors and code complexity
|
||||||
|
- repo: https://github.com/PyCQA/flake8
|
||||||
|
rev: 6.0.0
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
args: ["--config", ".flake8"]
|
||||||
|
|||||||
Vendored
+2
-1
@@ -24,7 +24,8 @@
|
|||||||
"--config=pyproject.toml"
|
"--config=pyproject.toml"
|
||||||
],
|
],
|
||||||
"flake8.args": [
|
"flake8.args": [
|
||||||
"--toml-config=pyproject.toml"
|
"--config",
|
||||||
|
".flake8"
|
||||||
],
|
],
|
||||||
"isort.args": [
|
"isort.args": [
|
||||||
"--settings-path=pyproject.toml"
|
"--settings-path=pyproject.toml"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
from .plugin import NVCCPlugin, load_ipython_extension
|
from .plugin import NVCCPlugin, load_ipython_extension # noqa: F401
|
||||||
|
|
||||||
__version__ = "1.0.2"
|
__version__ = "1.0.2"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ def get_parser_cuda() -> argparse.ArgumentParser:
|
|||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=(
|
description=(
|
||||||
"%%cuda magic that compiles and runs CUDA C++ code in this cell."
|
"%%cuda magic that compiles and runs CUDA C++ code in this cell."
|
||||||
" See https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda"
|
" See https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda" # noqa: E501
|
||||||
" for usage details."
|
" for usage details."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -20,7 +20,7 @@ def get_parser_cuda_group_run() -> argparse.ArgumentParser:
|
|||||||
parser.description = (
|
parser.description = (
|
||||||
"%%cuda_group_run magic that compiles and runs source files in a given"
|
"%%cuda_group_run magic that compiles and runs source files in a given"
|
||||||
" group. See"
|
" group. See"
|
||||||
" https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-run"
|
" https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-run" # noqa: E501
|
||||||
" for usage details."
|
" for usage details."
|
||||||
)
|
)
|
||||||
parser.add_argument("-g", "--group", type=str, required=True)
|
parser.add_argument("-g", "--group", type=str, required=True)
|
||||||
@@ -32,7 +32,7 @@ def get_parser_cuda_group_save() -> argparse.ArgumentParser:
|
|||||||
description=(
|
description=(
|
||||||
"%%cuda_group_save magic that saves CUDA C++ code in this cell for"
|
"%%cuda_group_save magic that saves CUDA C++ code in this cell for"
|
||||||
" later compilation and execution with possibly more source files."
|
" later compilation and execution with possibly more source files."
|
||||||
" See https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-save"
|
" See https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-save" # noqa: E501
|
||||||
" for usage details."
|
" for usage details."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -45,7 +45,7 @@ def get_parser_cuda_group_delete() -> argparse.ArgumentParser:
|
|||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description=(
|
description=(
|
||||||
"%%cuda_group_delete magic that deletes all files in a group. See"
|
"%%cuda_group_delete magic that deletes all files in a group. See"
|
||||||
" https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-delete"
|
" https://nvcc4jupyter.readthedocs.io/en/latest/magics.html#cuda-group-delete" # noqa: E501
|
||||||
" for usage details."
|
" for usage details."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ SHARED_GROUP_NAME = "shared"
|
|||||||
|
|
||||||
|
|
||||||
def print_out(out: str):
|
def print_out(out: str):
|
||||||
for l in out.split("\n"):
|
for line in out.split("\n"):
|
||||||
print(l)
|
print(line)
|
||||||
|
|
||||||
|
|
||||||
@magics_class
|
@magics_class
|
||||||
|
|||||||
@@ -85,28 +85,6 @@ experimental-string-processing = true
|
|||||||
[tool.coverage.run]
|
[tool.coverage.run]
|
||||||
branch = true
|
branch = true
|
||||||
|
|
||||||
[tool.flake8]
|
|
||||||
max-line-length = 79
|
|
||||||
select = "F,E,W,B,B901,B902,B903"
|
|
||||||
exclude = [
|
|
||||||
".eggs",
|
|
||||||
".git",
|
|
||||||
".tox",
|
|
||||||
"nssm",
|
|
||||||
"obj",
|
|
||||||
"out",
|
|
||||||
"packages",
|
|
||||||
"pywin32",
|
|
||||||
"tests",
|
|
||||||
"swagger_client"
|
|
||||||
]
|
|
||||||
ignore = [
|
|
||||||
"E722",
|
|
||||||
"B001",
|
|
||||||
"W503",
|
|
||||||
"E203"
|
|
||||||
]
|
|
||||||
|
|
||||||
[tool.pyright]
|
[tool.pyright]
|
||||||
include = ["src"]
|
include = ["src"]
|
||||||
exclude = [
|
exclude = [
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
from .fixtures.fixtures import *
|
from .fixtures.fixtures import * # noqa: F401,F403
|
||||||
|
|||||||
Vendored
+1
-1
@@ -30,7 +30,7 @@ def fixtures_path(tests_path):
|
|||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def sample_magic_cu_line():
|
def sample_magic_cu_line():
|
||||||
# fmt: off
|
# fmt: off
|
||||||
return '--profile --profiler-args "--metrics l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum"'
|
return '--profile --profiler-args "--metrics l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum"' # noqa: E501
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user