Skip to content

Commit 7e66382

Browse files
Fix typos
1 parent 725b3e7 commit 7e66382

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

setuptools/_normalization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def safer_name(value: str) -> str:
147147

148148
def safer_best_effort_version(value: str) -> str:
149149
"""Like ``best_effort_version`` but can be used as filename component for wheel"""
150-
# See bdist_wheel.safer_verion
150+
# See bdist_wheel.safer_version
151151
# TODO: Replace with only safe_version in the future (no need for best effort)
152152
return filename_component(best_effort_version(value))
153153

setuptools/config/_apply_pyprojecttoml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,11 @@ def _some_attrgetter(*items):
421421
True
422422
"""
423423

424-
def _acessor(obj):
424+
def _accessor(obj):
425425
values = (_attrgetter(i)(obj) for i in items)
426426
return next((i for i in values if i is not None), None)
427427

428-
return _acessor
428+
return _accessor
429429

430430

431431
PYPROJECT_CORRESPONDENCE: dict[str, _Correspondence] = {

setuptools/config/_validate_pyproject/error_reporting.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def __call__(
224224
if isinstance(schema, list):
225225
return self._handle_list(schema, prefix, _path)
226226

227-
filtered = self._filter_unecessary(schema, _path)
227+
filtered = self._filter_unnecessary(schema, _path)
228228
simple = self._handle_simple_dict(filtered, _path)
229229
if simple:
230230
return f"{prefix}{simple}"
@@ -239,7 +239,7 @@ def __call__(
239239
buffer.write(f"{line_prefix}{self._label(child_path)}:")
240240
# ^ just the first item should receive the complete prefix
241241
if isinstance(value, dict):
242-
filtered = self._filter_unecessary(value, child_path)
242+
filtered = self._filter_unnecessary(value, child_path)
243243
simple = self._handle_simple_dict(filtered, child_path)
244244
buffer.write(
245245
f" {simple}"
@@ -256,19 +256,19 @@ def __call__(
256256
buffer.write(f" {self._value(value, child_path)}\n")
257257
return buffer.getvalue()
258258

259-
def _is_unecessary(self, path: Sequence[str]) -> bool:
259+
def _is_unnecessary(self, path: Sequence[str]) -> bool:
260260
if self._is_property(path) or not path: # empty path => instruction @ root
261261
return False
262262
key = path[-1]
263263
return any(key.startswith(k) for k in "$_") or key in self._IGNORE
264264

265-
def _filter_unecessary(
265+
def _filter_unnecessary(
266266
self, schema: dict[str, Any], path: Sequence[str]
267267
) -> dict[str, Any]:
268268
return {
269269
key: value
270270
for key, value in schema.items()
271-
if not self._is_unecessary([*path, key])
271+
if not self._is_unnecessary([*path, key])
272272
}
273273

274274
def _handle_simple_dict(self, value: dict, path: Sequence[str]) -> str | None:
@@ -281,7 +281,7 @@ def _handle_simple_dict(self, value: dict, path: Sequence[str]) -> str | None:
281281
def _handle_list(
282282
self, schemas: list, prefix: str = "", path: Sequence[str] = ()
283283
) -> str:
284-
if self._is_unecessary(path):
284+
if self._is_unnecessary(path):
285285
return ""
286286

287287
repr_ = repr(schemas)

setuptools/config/_validate_pyproject/extra_validations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def validate_project_dynamic(pyproject: T) -> T:
7575
return pyproject
7676

7777

78-
def validate_include_depenency(pyproject: T) -> T:
78+
def validate_include_dependency(pyproject: T) -> T:
7979
dependency_groups = pyproject.get("dependency-groups", {})
8080
for key, value in dependency_groups.items():
8181
for each in value:
@@ -146,6 +146,6 @@ def validate_import_name_issues(pyproject: T) -> T:
146146

147147
EXTRA_VALIDATIONS = (
148148
validate_project_dynamic,
149-
validate_include_depenency,
149+
validate_include_dependency,
150150
validate_import_name_issues,
151151
)

setuptools/config/_validate_pyproject/formats.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,9 @@ def url(value: str) -> bool:
270270
# https://packaging.python.org/specifications/entry-points/
271271
ENTRYPOINT_PATTERN = r"[^\[\s=]([^=]*[^\s=])?"
272272
ENTRYPOINT_REGEX = re.compile(f"^{ENTRYPOINT_PATTERN}$", re.IGNORECASE)
273-
RECOMMEDED_ENTRYPOINT_PATTERN = r"[\w.-]+"
274-
RECOMMEDED_ENTRYPOINT_REGEX = re.compile(
275-
f"^{RECOMMEDED_ENTRYPOINT_PATTERN}$", re.IGNORECASE
273+
RECOMMENDED_ENTRYPOINT_PATTERN = r"[\w.-]+"
274+
RECOMMENDED_ENTRYPOINT_REGEX = re.compile(
275+
f"^{RECOMMENDED_ENTRYPOINT_PATTERN}$", re.IGNORECASE
276276
)
277277
ENTRYPOINT_GROUP_PATTERN = r"\w+(\.\w+)*"
278278
ENTRYPOINT_GROUP_REGEX = re.compile(f"^{ENTRYPOINT_GROUP_PATTERN}$", re.IGNORECASE)
@@ -334,9 +334,9 @@ def python_entrypoint_name(value: str) -> bool:
334334
"""
335335
if not ENTRYPOINT_REGEX.match(value):
336336
return False
337-
if not RECOMMEDED_ENTRYPOINT_REGEX.match(value):
337+
if not RECOMMENDED_ENTRYPOINT_REGEX.match(value):
338338
msg = f"Entry point `{value}` does not follow recommended pattern: "
339-
msg += RECOMMEDED_ENTRYPOINT_PATTERN
339+
msg += RECOMMENDED_ENTRYPOINT_PATTERN
340340
_logger.warning(msg)
341341
return True
342342

setuptools/tests/config/test_setupcfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def test_unknown_meta_item(self, tmpdir):
350350
with get_dist(tmpdir, parse=False) as dist:
351351
dist.parse_config_files() # Skip unknown.
352352

353-
def test_usupported_section(self, tmpdir):
353+
def test_unsupported_section(self, tmpdir):
354354
fake_env(tmpdir, '[metadata.some]\nkey = val\n')
355355
with get_dist(tmpdir, parse=False) as dist:
356356
with pytest.raises(DistutilsOptionError):

setuptools/tests/test_build_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def method(*args, **kw):
6565
pytest.xfail(f"Backend did not respond before timeout ({TIMEOUT} s)")
6666
except (futures.process.BrokenProcessPool, MemoryError, OSError):
6767
if IS_PYPY:
68-
pytest.xfail("PyPy frequently fails tests with ProcessPoolExector")
68+
pytest.xfail("PyPy frequently fails tests with ProcessPoolExecutor")
6969
raise
7070

7171
return method

setuptools/tests/test_config_discovery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_sdist_filelist(self, tmp_path, circumstance):
7878
files, options = self._get_info(circumstance)
7979
_populate_project_dir(tmp_path, files, options)
8080

81-
_, cmd = _run_sdist_programatically(tmp_path, options)
81+
_, cmd = _run_sdist_programmatically(tmp_path, options)
8282

8383
manifest = [f.replace(os.sep, "/") for f in cmd.filelist.files]
8484
for file in files:
@@ -635,7 +635,7 @@ def _get_dist(dist_path, attrs):
635635
return dist
636636

637637

638-
def _run_sdist_programatically(dist_path, attrs):
638+
def _run_sdist_programmatically(dist_path, attrs):
639639
dist = _get_dist(dist_path, attrs)
640640
cmd = sdist(dist)
641641
cmd.ensure_finalized()

setuptools/tests/test_egg_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ def test_license_file_attr_pkg_info(self, tmpdir_cwd, env):
10701070
]
10711071

10721072
# Only 'NOTICE', LICENSE-ABC', and 'LICENSE-XYZ' should have been matched
1073-
# Also assert that order from license_files is keeped
1073+
# Also assert that order from license_files is kept
10741074
assert len(license_file_lines) == 4
10751075
assert "License-File: NOTICE" == license_file_lines[0]
10761076
assert "License-File: LICENSE-ABC" in license_file_lines[1:]

0 commit comments

Comments
 (0)