Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove code that has been deprecated for a while #769

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions src/poetry/core/masonry/builder.py

This file was deleted.

37 changes: 0 additions & 37 deletions src/poetry/core/packages/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import os
import re
import warnings

from contextlib import suppress
from pathlib import Path
Expand Down Expand Up @@ -81,8 +80,6 @@ def __init__(

self._python_versions = "*"
self._python_constraint = parse_constraint("*")
self._transitive_python_versions: str | None = None
self._transitive_python_constraint: VersionConstraint | None = None
self._transitive_marker: BaseMarker | None = None

self._in_extras: Sequence[NormalizedName] = []
Expand Down Expand Up @@ -137,28 +134,6 @@ def python_versions(self, value: str) -> None:
)
)

@property
def transitive_python_versions(self) -> str:
warnings.warn(
"'transitive_python_versions' is deprecated and will be removed.",
DeprecationWarning,
stacklevel=2,
)
if self._transitive_python_versions is None:
return self._python_versions

return self._transitive_python_versions

@transitive_python_versions.setter
def transitive_python_versions(self, value: str) -> None:
warnings.warn(
"'transitive_python_versions' is deprecated and will be removed.",
DeprecationWarning,
stacklevel=2,
)
self._transitive_python_versions = value
self._transitive_python_constraint = parse_constraint(value)

@property
def marker(self) -> BaseMarker:
return self._marker
Expand Down Expand Up @@ -216,18 +191,6 @@ def transitive_marker(self, value: BaseMarker) -> None:
def python_constraint(self) -> VersionConstraint:
return self._python_constraint

@property
def transitive_python_constraint(self) -> VersionConstraint:
warnings.warn(
"'transitive_python_constraint' is deprecated and will be removed.",
DeprecationWarning,
stacklevel=2,
)
if self._transitive_python_constraint is None:
return self._python_constraint

return self._transitive_python_constraint

@property
def extras(self) -> frozenset[NormalizedName]:
# extras activated in a dependency is the same as features
Expand Down
30 changes: 0 additions & 30 deletions src/poetry/core/packages/package.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import re
import warnings

from typing import TYPE_CHECKING
from typing import ClassVar
Expand Down Expand Up @@ -60,7 +59,6 @@ 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 @@ -75,14 +73,6 @@ 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,
stacklevel=2,
)

super().__init__(
name,
source_type=source_type,
Expand Down Expand Up @@ -116,8 +106,6 @@ def __init__(

self._dependency_groups: Mapping[str, DependencyGroup] = {}

# Category is heading towards deprecation.
self._category = "main"
self.files: Sequence[Mapping[str, str]] = []
self.optional = False

Expand Down Expand Up @@ -376,24 +364,6 @@ def urls(self) -> dict[str, str]:

return urls

@property
def category(self) -> str:
warnings.warn(
"`category` is deprecated and will be removed in a future release.",
DeprecationWarning,
stacklevel=2,
)
return self._category

@category.setter
def category(self, category: str) -> None:
warnings.warn(
"Setting `category` is deprecated and will be removed in a future release.",
DeprecationWarning,
stacklevel=2,
)
self._category = category

@property
def yanked(self) -> bool:
return isinstance(self._yanked, str) or bool(self._yanked)
Expand Down
11 changes: 0 additions & 11 deletions src/poetry/core/packages/project_package.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

import warnings

from typing import TYPE_CHECKING
from typing import Any
from typing import Mapping
Expand All @@ -24,16 +22,7 @@ def __init__(
self,
name: str,
version: str | Version,
pretty_version: str | None = None,
) -> None:
if pretty_version is not None:
warnings.warn(
"The `pretty_version` parameter is deprecated and will be removed"
" in a future release.",
DeprecationWarning,
stacklevel=2,
)

super().__init__(name, version)

# Attributes must be immutable for clone() to be safe!
Expand Down
51 changes: 0 additions & 51 deletions src/poetry/core/packages/utils/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import posixpath
import re
import urllib.parse as urlparse
import warnings

from functools import cached_property
from typing import TYPE_CHECKING
Expand Down Expand Up @@ -187,32 +186,6 @@ def metadata_hashes(self) -> Mapping[str, str]:
return {match.group(1): match.group(2)}
return {}

@property
def metadata_hash(self) -> str | None:
warnings.warn(
"metadata_hash is deprecated. Use metadata_hashes instead.",
DeprecationWarning,
stacklevel=2,
)
if self.has_metadata and isinstance(self._metadata, str):
match = self._hash_re.search(self._metadata)
if match:
return match.group(2)
return None

@property
def metadata_hash_name(self) -> str | None:
warnings.warn(
"metadata_hash_name is deprecated. Use metadata_hashes instead.",
DeprecationWarning,
stacklevel=2,
)
if self.has_metadata and isinstance(self._metadata, str):
match = self._hash_re.search(self._metadata)
if match:
return match.group(1)
return None

@cached_property
def hashes(self) -> Mapping[str, str]:
if self._hashes:
Expand All @@ -222,30 +195,6 @@ def hashes(self) -> Mapping[str, str]:
return {match.group(1): match.group(2)}
return {}

@property
def hash(self) -> str | None:
warnings.warn(
"hash is deprecated. Use hashes instead.",
DeprecationWarning,
stacklevel=2,
)
match = self._hash_re.search(self.url)
if match:
return match.group(2)
return None

@property
def hash_name(self) -> str | None:
warnings.warn(
"hash_name is deprecated. Use hashes instead.",
DeprecationWarning,
stacklevel=2,
)
match = self._hash_re.search(self.url)
if match:
return match.group(1)
return None

@cached_property
def show_url(self) -> str:
return posixpath.basename(self.url.split("#", 1)[0].split("?", 1)[0])
Expand Down
88 changes: 0 additions & 88 deletions tests/masonry/test_builder.py

This file was deleted.

Loading
Loading