chore: move to ruff-format (#1651)
* chore: move to ruff-format Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Apply suggestions from code review * Apply suggestions from code review * chore: bump Ruff Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
@@ -3,9 +3,7 @@ from __future__ import annotations
|
||||
from . import test_projects, utils
|
||||
|
||||
before_test_project = test_projects.new_c_project()
|
||||
before_test_project.files[
|
||||
"test/spam_test.py"
|
||||
] = r"""
|
||||
before_test_project.files["test/spam_test.py"] = r"""
|
||||
import sys
|
||||
import os
|
||||
from unittest import TestCase
|
||||
|
||||
@@ -99,9 +99,7 @@ cpp17_project = cpp_test_project.copy()
|
||||
cpp17_project.template_context["extra_compile_args"] = [
|
||||
"/std:c++17" if utils.platform == "windows" else "-std=c++17"
|
||||
]
|
||||
cpp17_project.template_context[
|
||||
"spam_cpp_top_level_add"
|
||||
] = r"""
|
||||
cpp17_project.template_context["spam_cpp_top_level_add"] = r"""
|
||||
#include <utility>
|
||||
auto a = std::pair(5.0, false);
|
||||
"""
|
||||
|
||||
@@ -135,9 +135,7 @@ def test_dependency_constraints_file(tmp_path, build_frontend_env):
|
||||
wheel=={wheel}
|
||||
virtualenv=={virtualenv}
|
||||
importlib-metadata<3,>=0.12; python_version < "3.8"
|
||||
""".format(
|
||||
**tool_versions
|
||||
)
|
||||
""".format(**tool_versions)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -8,9 +8,7 @@ from . import test_projects, utils
|
||||
|
||||
project_with_a_test = test_projects.new_c_project()
|
||||
|
||||
project_with_a_test.files[
|
||||
"test/spam_test.py"
|
||||
] = r"""
|
||||
project_with_a_test.files["test/spam_test.py"] = r"""
|
||||
import spam
|
||||
|
||||
def test_spam():
|
||||
|
||||
+1
-3
@@ -19,9 +19,7 @@ basic_project = test_projects.new_c_project(
|
||||
)
|
||||
)
|
||||
|
||||
basic_project.files[
|
||||
"pyproject.toml"
|
||||
] = """
|
||||
basic_project.files["pyproject.toml"] = """
|
||||
[build-system]
|
||||
requires = [
|
||||
"setuptools >= 42",
|
||||
|
||||
@@ -8,9 +8,7 @@ import pytest
|
||||
from . import utils
|
||||
|
||||
pure_python_project = test_projects.TestProject()
|
||||
pure_python_project.files[
|
||||
"setup.py"
|
||||
] = """
|
||||
pure_python_project.files["setup.py"] = """
|
||||
from setuptools import Extension, setup
|
||||
|
||||
setup(
|
||||
@@ -20,9 +18,7 @@ setup(
|
||||
)
|
||||
"""
|
||||
|
||||
pure_python_project.files[
|
||||
"spam.py"
|
||||
] = """
|
||||
pure_python_project.files["spam.py"] = """
|
||||
def a_function():
|
||||
pass
|
||||
"""
|
||||
|
||||
@@ -8,9 +8,7 @@ import pytest
|
||||
from . import utils
|
||||
|
||||
basic_project = test_projects.new_c_project()
|
||||
basic_project.files[
|
||||
"repair.py"
|
||||
] = """
|
||||
basic_project.files["repair.py"] = """
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -14,9 +14,7 @@ subdir_package_project.files["src/spam/spam.c"] = jinja2.Template(SPAM_C_TEMPLAT
|
||||
subdir_package_project.template_context["spam_c_top_level_add"] = ""
|
||||
subdir_package_project.template_context["spam_c_function_add"] = ""
|
||||
|
||||
subdir_package_project.files[
|
||||
"src/spam/setup.py"
|
||||
] = r"""
|
||||
subdir_package_project.files["src/spam/setup.py"] = r"""
|
||||
from setuptools import Extension, setup
|
||||
|
||||
setup(
|
||||
@@ -26,15 +24,11 @@ setup(
|
||||
)
|
||||
"""
|
||||
|
||||
subdir_package_project.files[
|
||||
"src/spam/test/run_tests.py"
|
||||
] = r"""
|
||||
subdir_package_project.files["src/spam/test/run_tests.py"] = r"""
|
||||
print('run_tests.py executed!')
|
||||
"""
|
||||
|
||||
subdir_package_project.files[
|
||||
"bin/before_build.py"
|
||||
] = r"""
|
||||
subdir_package_project.files["bin/before_build.py"] = r"""
|
||||
print('before_build.py executed!')
|
||||
"""
|
||||
|
||||
|
||||
@@ -18,9 +18,7 @@ project_with_a_test = test_projects.new_c_project(
|
||||
)
|
||||
)
|
||||
|
||||
project_with_a_test.files[
|
||||
"test/spam_test.py"
|
||||
] = r'''
|
||||
project_with_a_test.files["test/spam_test.py"] = r'''
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
@@ -115,9 +113,7 @@ def test_extras_require(tmp_path):
|
||||
|
||||
|
||||
project_with_a_failing_test = test_projects.new_c_project()
|
||||
project_with_a_failing_test.files[
|
||||
"test/spam_test.py"
|
||||
] = r"""
|
||||
project_with_a_failing_test.files["test/spam_test.py"] = r"""
|
||||
from unittest import TestCase
|
||||
|
||||
class TestSpam(TestCase):
|
||||
|
||||
Reference in New Issue
Block a user