Skip to content

Commit 4994453

Browse files
committed
CAP-ADD: ruff + fixes for ruff precommit added
1 parent 5037234 commit 4994453

44 files changed

Lines changed: 89 additions & 195 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/cgal/auxiliary/gdb/test-gdb.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@
1111

1212
import sys
1313
import os
14-
import gdb
1514

1615
sys.path.insert(0, os.getcwd() + '/python')
17-
18-
import CGAL.printers

deps/cgal/cmake/modules/Help/cmake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def run(self):
8080
settings.record_dependencies.add(path)
8181
f = io.FileInput(source_path=path, encoding=encoding,
8282
error_handler=e_handler)
83-
except UnicodeEncodeError as error:
83+
except UnicodeEncodeError:
8484
raise self.severe('Problems with "%s" directive path:\n'
8585
'Cannot encode input file path "%s" '
8686
'(wrong locale?).' %

doc/test_pybind_dll_smoke.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
""" This file contains a simple test for the Python bindings to the C++ code (dlls reading, pyd importing etc). """
22

3-
import pytest
43
import os
54
import sys
65

@@ -10,7 +9,7 @@
109
sys.path.append(extra_dll_dir) # Add this directory to the Python path
1110
# os.add_dll_directory(extra_dll_dir) # For finding DLL dependencies on Windows
1211
try:
13-
import diffCheck.diffcheck_bindings as dfb
12+
import diffCheck.diffcheck_bindings as dfb # noqa: F401
1413
except ImportError as e:
1514
print(f"Failed to import diffcheck_bindings: {e}")
1615
print("Current sys.path directories:")

environment.yml

42 Bytes
Binary file not shown.

invokes/flagerize.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import argparse
66
import re
77

8-
import typing
98

109

1110
def main(
@@ -122,11 +121,11 @@ def main(
122121
if is_version_ok:
123122
print("\t[x] Correct version format")
124123
else:
125-
print(f"\t[ ] Correct version format")
124+
print("\t[ ] Correct version format")
126125
if is_source_populated:
127126
print(f"\t[x] Source folder is populated {args.source} with {nbr_pycode_files} components")
128127
else:
129-
print(f"\t[ ] Source folder is populated")
128+
print("\t[ ] Source folder is populated")
130129

131130
if parse_errors.__len__() != 0:
132131
for error in parse_errors:

invokes/ghcomponentize/ghcomponentizer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import re
66
import sys
77
import tempfile
8-
import urllib.request, urllib.parse, urllib.error
8+
import urllib.request
9+
import urllib.parse
10+
import urllib.error
911
import zipfile
1012
from io import BytesIO
1113

@@ -134,8 +136,6 @@ def validate_source_bundle(source):
134136
)
135137
)
136138

137-
ghpython = data.get("ghpython")
138-
139139
if r'"""' not in python_code:
140140
python_code = r'"""{}"""{}{}'.format(
141141
data.get("description", "Generated by Componentizer"),

invokes/pypireize.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
import argparse
66

7-
import typing
87

98
def main(
109
setup_path: str,
@@ -13,8 +12,8 @@ def main(
1312
setup_dir = os.path.dirname(setup_path)
1413
os.chdir(setup_dir)
1514
try:
16-
os.system(f"python setup.py sdist")
17-
os.system(f"python setup.py bdist_wheel")
15+
os.system("python setup.py sdist")
16+
os.system("python setup.py bdist_wheel")
1817
except Exception as e:
1918
print(f"Failed to build the package: {e}")
2019
return False

invokes/versionize.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import argparse
66
import re
77

8-
import typing
98

109

1110
def main(
@@ -78,8 +77,6 @@ def main(
7877
with open(path_init, "w") as f:
7978
f.write(init)
8079

81-
# modify the CMake file
82-
cmake_crt_version = None
8380
# search the first "project" line
8481
with open(path_cmake, "r") as f:
8582
cmake = f.read()

invokes/yakerize/yakerize.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
import argparse
66
import shutil
7-
import typing
87

98
def main(
109
gh_components_dir: str,

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,12 @@ ignore_missing_imports = true
2424

2525
[[tool.mypy.overrides]]
2626
module = "pefile"
27-
ignore_missing_imports = true
27+
ignore_missing_imports = true
28+
29+
30+
[tool.ruff]
31+
exclude = [
32+
"doc/",
33+
"deps/",
34+
"temp/"
35+
]

0 commit comments

Comments
 (0)