From b69fb6f920c4f37eb87c8e660ef602e7c08148e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Feb 2026 22:40:22 +0000 Subject: [PATCH] Fix documentation grammar, typos, and clarity issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix typos - Fix grammar: "help installer" → "help installers" in index.rst - Fix phrase: "Most of the times" → "Most of the time" in quickstart.rst - Fix capitalization: "python" → "Python" in quickstart.rst - Fix word order: "that not necessarily should be" → "that should not necessarily be" in quickstart.rst - Fix grammar: "content type is used" → "content type used" in keywords.rst - Fix duplicate word: "are are" → "are" in easy_install.rst - Fix subject-verb: "aggregate" → "aggregates" in pyproject_config.rst - Fix plural: "practice" → "practices" in deprecated/index.rst - Fix glob pattern: "AUTHORS**" → "AUTHORS*" in miscellaneous.rst Co-authored-by: DimitriPapadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> --- docs/deprecated/easy_install.rst | 2 +- docs/deprecated/index.rst | 2 +- docs/references/keywords.rst | 2 +- docs/userguide/index.rst | 2 +- docs/userguide/interfaces.rst | 2 +- docs/userguide/miscellaneous.rst | 2 +- docs/userguide/pyproject_config.rst | 2 +- docs/userguide/quickstart.rst | 6 +++--- setuptools/_normalization.py | 2 +- setuptools/config/_apply_pyprojecttoml.py | 4 ++-- .../config/_validate_pyproject/error_reporting.py | 12 ++++++------ .../config/_validate_pyproject/extra_validations.py | 4 ++-- setuptools/config/_validate_pyproject/formats.py | 10 +++++----- setuptools/tests/config/test_setupcfg.py | 2 +- setuptools/tests/test_build_meta.py | 2 +- setuptools/tests/test_config_discovery.py | 10 +++++----- setuptools/tests/test_dist.py | 6 +++--- 17 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/deprecated/easy_install.rst b/docs/deprecated/easy_install.rst index ab3d38a061..8dedb2edef 100644 --- a/docs/deprecated/easy_install.rst +++ b/docs/deprecated/easy_install.rst @@ -42,7 +42,7 @@ You will need at least Python 3.5 or 2.7. An ``easy_install`` script will be installed in the normal location for Python scripts on your platform. Note that the instructions on the setuptools PyPI page assume that you are -are installing to Python's primary ``site-packages`` directory. If this is +installing to Python's primary ``site-packages`` directory. If this is not the case, you should consult the section below on `Custom Installation Locations`_ before installing. (And, on Windows, you should not use the ``.exe`` installer when installing to an alternate location.) diff --git a/docs/deprecated/index.rst b/docs/deprecated/index.rst index 9db1729a40..b1ebd15235 100644 --- a/docs/deprecated/index.rst +++ b/docs/deprecated/index.rst @@ -3,7 +3,7 @@ Guides on backward compatibility & deprecated practice ====================================================== ``Setuptools`` has undergone tremendous changes since its first debut. As its -development continues to roll forward, many of the practice and mechanisms it +development continues to roll forward, many of the practices and mechanisms it had established are now considered deprecated. But they still remain relevant as a plethora of libraries continue to depend on them. Many people also find it necessary to equip themselves with the knowledge to better support backward diff --git a/docs/references/keywords.rst b/docs/references/keywords.rst index 41d30c33d4..f6a533fc4e 100644 --- a/docs/references/keywords.rst +++ b/docs/references/keywords.rst @@ -54,7 +54,7 @@ extensions). .. _keyword/long_description_content_type: ``long_description_content_type`` - A string specifying the content type is used for the ``long_description`` + A string specifying the content type used for the ``long_description`` (e.g. ``text/markdown``) .. _keyword/author: diff --git a/docs/userguide/index.rst b/docs/userguide/index.rst index fd9947ee79..c4bf5e0f78 100644 --- a/docs/userguide/index.rst +++ b/docs/userguide/index.rst @@ -6,7 +6,7 @@ The first step towards sharing a Python library or program is to build a distribution package [#package-overload]_. This includes adding a set of additional files containing metadata and configuration to not only instruct ``setuptools`` on how the distribution should be built but also -to help installer (such as :pypi:`pip`) during the installation process. +to help installers (such as :pypi:`pip`) during the installation process. This document contains information to help Python developers through this process. Please check the :doc:`/userguide/quickstart` for an overview of diff --git a/docs/userguide/interfaces.rst b/docs/userguide/interfaces.rst index ad747b48d5..f8fe0f574d 100644 --- a/docs/userguide/interfaces.rst +++ b/docs/userguide/interfaces.rst @@ -54,7 +54,7 @@ carefully attempt to find alternatives before resorting to unscheduled removals. In the context of ``setuptools``, the introduction of :py:mod:`warnings` (including deprecation warnings) is not considered a breaking change *per se*. Instead it is considered a backwards compatible *communication action* that - precedes an upcoming breaking change. This is becauset code + precedes an upcoming breaking change. This is because code containing warnings typically does not fail and can successfully terminate execution, unless users explicitly opt into transforming those warnings into errors (e.g., via Python's :external+python:ref:`-W option or diff --git a/docs/userguide/miscellaneous.rst b/docs/userguide/miscellaneous.rst index 1b493fba3b..6141a063cf 100644 --- a/docs/userguide/miscellaneous.rst +++ b/docs/userguide/miscellaneous.rst @@ -24,7 +24,7 @@ files are included in a source distribution by default: in ``pyproject.toml`` and/or equivalent in ``setup.cfg``/``setup.py``; note that if you don't explicitly set this parameter, ``setuptools`` will include any files that match the following glob patterns: - ``LICEN[CS]E*``, ``COPYING*``, ``NOTICE*``, ``AUTHORS**``; + ``LICEN[CS]E*``, ``COPYING*``, ``NOTICE*``, ``AUTHORS*``; - ``pyproject.toml``; - ``setup.cfg``; - ``setup.py``; diff --git a/docs/userguide/pyproject_config.rst b/docs/userguide/pyproject_config.rst index 0b37749064..b1f4b9f97e 100644 --- a/docs/userguide/pyproject_config.rst +++ b/docs/userguide/pyproject_config.rst @@ -170,7 +170,7 @@ existing packages should consider migrating to alternatives. packages = ["my_package"] If you want to publish a distribution that does not include any Python module - (e.g. a "meta-distribution" that just aggregate dependencies), please + (e.g. a "meta-distribution" that just aggregates dependencies), please consider something like the following: .. code-block:: toml diff --git a/docs/userguide/quickstart.rst b/docs/userguide/quickstart.rst index 606654f86c..4138f48865 100644 --- a/docs/userguide/quickstart.rst +++ b/docs/userguide/quickstart.rst @@ -9,7 +9,7 @@ You can install the latest version of ``setuptools`` using :pypi:`pip`:: pip install --upgrade setuptools[core] -Most of the times, however, you don't have to... +Most of the time, however, you don't have to... Instead, when creating new Python packages, it is recommended to use a command line tool called :pypi:`build`. This tool will automatically download @@ -33,7 +33,7 @@ This will allow you to run the command: ``python -m build``. check out :doc:`pip installation docs `. -Every python package must provide a ``pyproject.toml`` and specify +Every Python package must provide a ``pyproject.toml`` and specify the backend (build system) it wants to use. The distribution can then be generated with whatever tool that provides a ``build sdist``-like functionality. @@ -200,7 +200,7 @@ Package discovery For projects that follow a simple directory structure, ``setuptools`` should be able to automatically detect all :term:`packages ` and :term:`namespaces `. However, complex projects might include -additional folders and supporting files that not necessarily should be +additional folders and supporting files that should not necessarily be distributed (or that can confuse ``setuptools`` auto discovery algorithm). Therefore, ``setuptools`` provides a convenient way to customize 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..1ce4b69a19 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: @@ -117,7 +117,7 @@ def test_project(self, tmp_path, circumstance): assert "build" not in files assert "dist" not in files - PURPOSEFULLY_EMPY = { + PURPOSEFULLY_EMPYY = { "setup.cfg": DALS( """ [metadata] @@ -176,11 +176,11 @@ def test_purposefully_empty(self, tmp_path, config_file, param, circumstance): template_param = param.replace("_", "-") else: # Make sure build works with or without setup.cfg - pyproject = self.PURPOSEFULLY_EMPY["template-pyproject.toml"] + pyproject = self.PURPOSEFULLY_EMPYY["template-pyproject.toml"] (tmp_path / "pyproject.toml").write_text(pyproject, encoding="utf-8") template_param = param - config = self.PURPOSEFULLY_EMPY[config_file].format(param=template_param) + config = self.PURPOSEFULLY_EMPYY[config_file].format(param=template_param) (tmp_path / config_file).write_text(config, encoding="utf-8") dist = _get_dist(tmp_path, {}) @@ -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() diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index 9685dcd7cb..b7ef53da86 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -183,11 +183,11 @@ def test_dist_default_py_modules(tmp_path, dist_name, py_module): dist.set_defaults() assert dist.py_modules == [py_module] # When `py_modules` is given, don't do anything - dist = Distribution({**attrs, "py_modules": ["explicity_py_module"]}) + dist = Distribution({**attrs, "py_modules": ["explicitly_py_module"]}) dist.set_defaults() - assert dist.py_modules == ["explicity_py_module"] + assert dist.py_modules == ["explicitly_py_module"] # When `packages` is given, don't do anything - dist = Distribution({**attrs, "packages": ["explicity_package"]}) + dist = Distribution({**attrs, "packages": ["explicitly_package"]}) dist.set_defaults() assert not dist.py_modules