Skip to content

Commit

Permalink
Deprecate rather than remove parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Jan 22, 2023
1 parent 80b8193 commit a4064ad
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/poetry/core/packages/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import copy
import re
import warnings

from contextlib import contextmanager
from pathlib import Path
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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`.",
Expand All @@ -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`.",
Expand Down

0 comments on commit a4064ad

Please sign in to comment.