|
6 | 6 |
|
7 | 7 | def install_requirements(): |
8 | 8 | print("\nInstalling requirements...") |
9 | | - return subprocess.run((sys.executable, "-m", "pip", "install", "--upgrade", "isort", "black")) |
| 9 | + subprocess.check_call((sys.executable, "-m", "pip", "install", "pip>=25.1")) |
| 10 | + subprocess.check_call((sys.executable, "-m", "pip", "install", "--upgrade", "--group", "hygiene")) |
10 | 11 |
|
11 | 12 |
|
12 | | -def run_isort(): |
13 | | - print("\nRunning isort...") |
14 | | - return subprocess.run((sys.executable, "-m", "isort", ".")) |
| 13 | +def run_ruff_fix(): |
| 14 | + print("\nRunning Ruff check --fix...") |
| 15 | + return subprocess.run((sys.executable, "-m", "ruff", "check", "--fix")) |
15 | 16 |
|
16 | 17 |
|
17 | | -def run_black(): |
18 | | - print("\nRunning Black...") |
19 | | - return subprocess.run((sys.executable, "-m", "black", ".")) |
| 18 | +def run_ruff_format(): |
| 19 | + print("\nRunning Ruff format...") |
| 20 | + return subprocess.run((sys.executable, "-m", "ruff", "format")) |
20 | 21 |
|
21 | 22 |
|
22 | 23 | def main(): |
23 | | - test_folder = Path(__file__).parent |
24 | | - root = test_folder.parent |
25 | | - os.chdir(root) |
| 24 | + os.chdir(Path(__file__).parent.parent) |
26 | 25 |
|
27 | | - install_requirements().check_returncode() |
| 26 | + install_requirements() |
28 | 27 | results = ( |
29 | | - run_isort(), |
30 | | - run_black(), |
| 28 | + run_ruff_fix(), |
| 29 | + run_ruff_format(), |
31 | 30 | ) |
32 | 31 | if sum([result.returncode for result in results]) > 0: |
33 | 32 | print("\nOne or more tests failed. See above for details.") |
|
0 commit comments