diff --git a/setuptools/_normalization.py b/setuptools/_normalization.py index 6b8d4ddbf9..7b97a45734 100644 --- a/setuptools/_normalization.py +++ b/setuptools/_normalization.py @@ -147,7 +147,7 @@ def safer_name(value: str) -> str: def safer_best_effort_version(value: str) -> str: """Like ``best_effort_version`` but can be used as filename component for wheel""" - # See bdist_wheel.safer_verion + # See bdist_wheel.safer_version # TODO: Replace with only safe_version in the future (no need for best effort) return filename_component(best_effort_version(value)) diff --git a/setuptools/config/_apply_pyprojecttoml.py b/setuptools/config/_apply_pyprojecttoml.py index 4559193774..dd242f0b52 100644 --- a/setuptools/config/_apply_pyprojecttoml.py +++ b/setuptools/config/_apply_pyprojecttoml.py @@ -421,11 +421,11 @@ def _some_attrgetter(*items): True """ - def _acessor(obj): + def _accessor(obj): values = (_attrgetter(i)(obj) for i in items) return next((i for i in values if i is not None), None) - return _acessor + return _accessor PYPROJECT_CORRESPONDENCE: dict[str, _Correspondence] = { diff --git a/setuptools/config/_validate_pyproject/error_reporting.py b/setuptools/config/_validate_pyproject/error_reporting.py index 9ebe6a335c..729688ba1e 100644 --- a/setuptools/config/_validate_pyproject/error_reporting.py +++ b/setuptools/config/_validate_pyproject/error_reporting.py @@ -224,7 +224,7 @@ def __call__( if isinstance(schema, list): return self._handle_list(schema, prefix, _path) - filtered = self._filter_unecessary(schema, _path) + filtered = self._filter_unnecessary(schema, _path) simple = self._handle_simple_dict(filtered, _path) if simple: return f"{prefix}{simple}" @@ -239,7 +239,7 @@ def __call__( buffer.write(f"{line_prefix}{self._label(child_path)}:") # ^ just the first item should receive the complete prefix if isinstance(value, dict): - filtered = self._filter_unecessary(value, child_path) + filtered = self._filter_unnecessary(value, child_path) simple = self._handle_simple_dict(filtered, child_path) buffer.write( f" {simple}" @@ -256,19 +256,19 @@ def __call__( buffer.write(f" {self._value(value, child_path)}\n") return buffer.getvalue() - def _is_unecessary(self, path: Sequence[str]) -> bool: + def _is_unnecessary(self, path: Sequence[str]) -> bool: if self._is_property(path) or not path: # empty path => instruction @ root return False key = path[-1] return any(key.startswith(k) for k in "$_") or key in self._IGNORE - def _filter_unecessary( + def _filter_unnecessary( self, schema: dict[str, Any], path: Sequence[str] ) -> dict[str, Any]: return { key: value for key, value in schema.items() - if not self._is_unecessary([*path, key]) + if not self._is_unnecessary([*path, key]) } 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: def _handle_list( self, schemas: list, prefix: str = "", path: Sequence[str] = () ) -> str: - if self._is_unecessary(path): + if self._is_unnecessary(path): return "" repr_ = repr(schemas) diff --git a/setuptools/config/_validate_pyproject/extra_validations.py b/setuptools/config/_validate_pyproject/extra_validations.py index 72a7132f2b..14c3692db9 100644 --- a/setuptools/config/_validate_pyproject/extra_validations.py +++ b/setuptools/config/_validate_pyproject/extra_validations.py @@ -75,7 +75,7 @@ def validate_project_dynamic(pyproject: T) -> T: return pyproject -def validate_include_depenency(pyproject: T) -> T: +def validate_include_dependency(pyproject: T) -> T: dependency_groups = pyproject.get("dependency-groups", {}) for key, value in dependency_groups.items(): for each in value: @@ -146,6 +146,6 @@ def validate_import_name_issues(pyproject: T) -> T: EXTRA_VALIDATIONS = ( validate_project_dynamic, - validate_include_depenency, + validate_include_dependency, validate_import_name_issues, ) diff --git a/setuptools/config/_validate_pyproject/formats.py b/setuptools/config/_validate_pyproject/formats.py index fe958cc52a..949f2f2d51 100644 --- a/setuptools/config/_validate_pyproject/formats.py +++ b/setuptools/config/_validate_pyproject/formats.py @@ -270,9 +270,9 @@ def url(value: str) -> bool: # https://packaging.python.org/specifications/entry-points/ ENTRYPOINT_PATTERN = r"[^\[\s=]([^=]*[^\s=])?" ENTRYPOINT_REGEX = re.compile(f"^{ENTRYPOINT_PATTERN}$", re.IGNORECASE) -RECOMMEDED_ENTRYPOINT_PATTERN = r"[\w.-]+" -RECOMMEDED_ENTRYPOINT_REGEX = re.compile( - f"^{RECOMMEDED_ENTRYPOINT_PATTERN}$", re.IGNORECASE +RECOMMENDED_ENTRYPOINT_PATTERN = r"[\w.-]+" +RECOMMENDED_ENTRYPOINT_REGEX = re.compile( + f"^{RECOMMENDED_ENTRYPOINT_PATTERN}$", re.IGNORECASE ) ENTRYPOINT_GROUP_PATTERN = r"\w+(\.\w+)*" ENTRYPOINT_GROUP_REGEX = re.compile(f"^{ENTRYPOINT_GROUP_PATTERN}$", re.IGNORECASE) @@ -334,9 +334,9 @@ def python_entrypoint_name(value: str) -> bool: """ if not ENTRYPOINT_REGEX.match(value): return False - if not RECOMMEDED_ENTRYPOINT_REGEX.match(value): + if not RECOMMENDED_ENTRYPOINT_REGEX.match(value): msg = f"Entry point `{value}` does not follow recommended pattern: " - msg += RECOMMEDED_ENTRYPOINT_PATTERN + msg += RECOMMENDED_ENTRYPOINT_PATTERN _logger.warning(msg) return True diff --git a/setuptools/tests/config/test_setupcfg.py b/setuptools/tests/config/test_setupcfg.py index 495337a9a5..01db7bd1e2 100644 --- a/setuptools/tests/config/test_setupcfg.py +++ b/setuptools/tests/config/test_setupcfg.py @@ -350,7 +350,7 @@ def test_unknown_meta_item(self, tmpdir): with get_dist(tmpdir, parse=False) as dist: dist.parse_config_files() # Skip unknown. - def test_usupported_section(self, tmpdir): + def test_unsupported_section(self, tmpdir): fake_env(tmpdir, '[metadata.some]\nkey = val\n') with get_dist(tmpdir, parse=False) as dist: with pytest.raises(DistutilsOptionError): diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 2cd0a0a8ed..853c4b7257 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -64,7 +64,7 @@ def method(*args, **kw): pytest.xfail(f"Backend did not respond before timeout ({TIMEOUT} s)") except (futures.process.BrokenProcessPool, MemoryError, OSError): if IS_PYPY: - pytest.xfail("PyPy frequently fails tests with ProcessPoolExector") + pytest.xfail("PyPy frequently fails tests with ProcessPoolExecutor") raise return method diff --git a/setuptools/tests/test_config_discovery.py b/setuptools/tests/test_config_discovery.py index b5df8203cd..4a071c6940 100644 --- a/setuptools/tests/test_config_discovery.py +++ b/setuptools/tests/test_config_discovery.py @@ -78,7 +78,7 @@ def test_sdist_filelist(self, tmp_path, circumstance): files, options = self._get_info(circumstance) _populate_project_dir(tmp_path, files, options) - _, cmd = _run_sdist_programatically(tmp_path, options) + _, cmd = _run_sdist_programmatically(tmp_path, options) manifest = [f.replace(os.sep, "/") for f in cmd.filelist.files] for file in files: @@ -635,7 +635,7 @@ def _get_dist(dist_path, attrs): return dist -def _run_sdist_programatically(dist_path, attrs): +def _run_sdist_programmatically(dist_path, attrs): dist = _get_dist(dist_path, attrs) cmd = sdist(dist) cmd.ensure_finalized()