Skip to content

Commit 3c7c4bf

Browse files
committed
pkg_resources to pathlib etc.
1 parent ae6f7f6 commit 3c7c4bf

3 files changed

Lines changed: 7 additions & 28 deletions

File tree

allocator/tests/test_cluster_kahip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
import os
1010
import unittest
11-
from pkg_resources import resource_filename
11+
from pathlib import Path
1212

1313
from allocator.cluster_kahip import main
1414
from . import capture
1515

16-
17-
ROADS = resource_filename(__name__, "chonburi-roads-50.csv")
16+
TEST_DIR = Path(__file__).parent
17+
ROADS = str(TEST_DIR / "chonburi-roads-50.csv")
1818

1919

2020
def kahip_available():

allocator/tests/test_sort_by_distance.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
"""
88

99
import unittest
10-
from pkg_resources import resource_filename
10+
from pathlib import Path
1111

1212
from allocator.sort_by_distance import main
1313
from . import capture
1414

15-
CENTROIDS = resource_filename(__name__, "worker-locations.csv")
16-
ROADS = resource_filename(__name__, "chonburi-roads-50.csv")
15+
TEST_DIR = Path(__file__).parent
16+
CENTROIDS = str(TEST_DIR / "worker-locations.csv")
17+
ROADS = str(TEST_DIR / "chonburi-roads-50.csv")
1718

1819

1920
class TestSortByDistance(unittest.TestCase):

pyproject.toml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -107,28 +107,6 @@ python_files = ["test_*.py"]
107107
python_classes = ["Test*"]
108108
python_functions = ["test_*"]
109109

110-
[tool.flake8]
111-
max-line-length = 127
112-
max-complexity = 10
113-
select = ["E9", "F63", "F7", "F82"]
114-
ignore = ["E203", "W503"]
115-
exclude = [
116-
".git",
117-
"__pycache__",
118-
".venv",
119-
"venv",
120-
".env",
121-
"env",
122-
"dist",
123-
"build",
124-
"*.egg-info",
125-
".tox",
126-
".coverage",
127-
".coverage.*",
128-
".cache",
129-
".mypy_cache",
130-
".pytest_cache"
131-
]
132110

133111
[tool.coverage.run]
134112
source = ["allocator"]

0 commit comments

Comments
 (0)