From: JinWang An Date: Mon, 27 Mar 2023 08:02:49 +0000 (+0900) Subject: Imported Upstream version 62.3.2 X-Git-Tag: upstream/62.3.2^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=263921c366dcbaee345c04dd0325b017b51bffc1;p=platform%2Fupstream%2Fpython-setuptools.git Imported Upstream version 62.3.2 --- diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4b8d9d0..755cb1b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 62.3.1 +current_version = 62.3.2 commit = True tag = True diff --git a/CHANGES.rst b/CHANGES.rst index d301529..3249289 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,12 @@ +v62.3.2 +------- + + +Misc +^^^^ +* #3328: Include a first line summary to some of the existing multi-line warnings. + + v62.3.1 ------- diff --git a/setup.cfg b/setup.cfg index f4a5473..7380717 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools -version = 62.3.1 +version = 62.3.2 author = Python Packaging Authority author_email = distutils-sig@python.org description = Easily download, build, install, upgrade, and uninstall Python packages diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py index 91f4741..d2ccb51 100644 --- a/setuptools/command/build_py.py +++ b/setuptools/command/build_py.py @@ -256,6 +256,7 @@ class _IncludePackageDataAbuse: """Inform users that package or module is included as 'data file'""" MESSAGE = """\ + Installing {importable!r} as data is deprecated, please list it in `packages`. !!\n\n ############################ # Package would be ignored # @@ -266,7 +267,9 @@ class _IncludePackageDataAbuse: therefore is considered deprecated). Please make sure that {importable!r} is included as a package by using - setuptools' `packages` configuration field or the proper discovery methods. + setuptools' `packages` configuration field or the proper discovery methods + (for example by using `find_namespace_packages(...)`/`find_namespace:` + instead of `find_packages(...)`/`find:`). You can read more about "package discovery" and "data files" on setuptools documentation page. diff --git a/setuptools/command/dist_info.py b/setuptools/command/dist_info.py index 8b8509f..ca540ad 100644 --- a/setuptools/command/dist_info.py +++ b/setuptools/command/dist_info.py @@ -54,7 +54,8 @@ def _version(version: str) -> str: try: return str(packaging.version.Version(v)).replace("-", "_") except packaging.version.InvalidVersion: - msg = f"""!!\n\n + msg = f"""Invalid version: {version!r}. + !!\n\n ################### # Invalid version # ################### diff --git a/setuptools/config/_apply_pyprojecttoml.py b/setuptools/config/_apply_pyprojecttoml.py index 4b4ed9d..3bf8cc2 100644 --- a/setuptools/config/_apply_pyprojecttoml.py +++ b/setuptools/config/_apply_pyprojecttoml.py @@ -341,7 +341,10 @@ _PREVIOUSLY_DEFINED = { class _WouldIgnoreField(UserWarning): - """Inform users that ``pyproject.toml`` would overwrite previously defined metadata: + """Inform users that ``pyproject.toml`` would overwrite previous metadata.""" + + MESSAGE = """\ + {field!r} defined outside of `pyproject.toml` would be ignored. !!\n\n ########################################################################## # configuration would be ignored/result in error due to `pyproject.toml` # @@ -369,5 +372,4 @@ class _WouldIgnoreField(UserWarning): @classmethod def message(cls, field, value): from inspect import cleandoc - msg = "\n".join(cls.__doc__.splitlines()[1:]) - return cleandoc(msg.format(field=field, value=value)) + return cleandoc(cls.MESSAGE.format(field=field, value=value)) diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index be81214..976eb06 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -418,7 +418,7 @@ class _ExperimentalProjectMetadata(UserWarning): class _InvalidFile(UserWarning): - """Inform users that the given `pyproject.toml` is experimental: + """The given `pyproject.toml` file is invalid and would be ignored. !!\n\n ############################ # Invalid `pyproject.toml` # @@ -436,5 +436,4 @@ class _InvalidFile(UserWarning): @classmethod def message(cls): from inspect import cleandoc - msg = "\n".join(cls.__doc__.splitlines()[1:]) - return cleandoc(msg) + return cleandoc(cls.__doc__)