Skip to content

Commit

Permalink
Remove references to LegacyVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch committed Nov 1, 2023
1 parent fffbbd3 commit 06b8744
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bumpreqs/core.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import logging

from typing import List, Optional, Union
from typing import List, Optional

import requests

from packaging.requirements import Requirement
from packaging.specifiers import SpecifierSet
from packaging.version import LegacyVersion, parse as parse_version, Version
from packaging.version import parse as parse_version, Version

from .marker_extract import extract_python

Expand Down Expand Up @@ -96,12 +96,12 @@ def fix(text: str, force: Optional[bool] = False) -> str:
def _fetch_versions(
project_name: str,
only_for_python: Optional[VersionIntervals] = None,
) -> List[Union[LegacyVersion, Version]]:
) -> List[Version]:
resp = requests.get(f"https://pypi.org/pypi/{project_name}/json")
resp.raise_for_status()
obj = resp.json()

versions: List[Union[LegacyVersion, Version]] = []
versions: List[Version] = []
for k, v in obj["releases"].items():
# Skip older releases that have no archives
if not v:
Expand Down
3 changes: 2 additions & 1 deletion bumpreqs/marker_extract.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Any, Iterator, Optional, Tuple

from packaging.markers import Marker, Variable
from packaging._parser import Variable
from packaging.markers import Marker

from .vrange import TooComplicated, VersionIntervals

Expand Down

0 comments on commit 06b8744

Please sign in to comment.