From a4064ad76f4e51daceb0712834a2dd92cd24ef6a Mon Sep 17 00:00:00 2001 From: David Hotham Date: Sun, 22 Jan 2023 14:12:08 +0000 Subject: [PATCH] Deprecate rather than remove parameter --- src/poetry/core/packages/package.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/poetry/core/packages/package.py b/src/poetry/core/packages/package.py index 58346b825..74a8cee3b 100644 --- a/src/poetry/core/packages/package.py +++ b/src/poetry/core/packages/package.py @@ -2,6 +2,7 @@ import copy import re +import warnings from contextlib import contextmanager from pathlib import Path @@ -54,6 +55,7 @@ def __init__( self, name: str, version: str | Version, + pretty_version: str | None = None, source_type: str | None = None, source_url: str | None = None, source_reference: str | None = None, @@ -68,6 +70,13 @@ def __init__( """ from poetry.core.version.markers import AnyMarker + if pretty_version is not None: + warnings.warn( + "The `pretty_version` parameter is deprecated and will be removed" + " in a future release.", + DeprecationWarning, + ) + super().__init__( name, source_type=source_type, @@ -364,8 +373,6 @@ def urls(self) -> dict[str, str]: @property def readme(self) -> Path | None: - import warnings - warnings.warn( "`readme` is deprecated: you are getting only the first readme file. Please" " use the plural form `readmes`.", @@ -375,8 +382,6 @@ def readme(self) -> Path | None: @readme.setter def readme(self, path: Path) -> None: - import warnings - warnings.warn( "`readme` is deprecated. Please assign a tuple to the plural form" " `readmes`.",