diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d3ebb4..a8630ef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,14 +15,14 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0-beta.5"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [macOS-latest, ubuntu-latest, windows-latest] steps: - name: Checkout - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Set Up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install diff --git a/bumpreqs/core.py b/bumpreqs/core.py index 235df52..d48b5de 100644 --- a/bumpreqs/core.py +++ b/bumpreqs/core.py @@ -6,7 +6,7 @@ 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 @@ -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: @@ -109,8 +109,10 @@ def _fetch_versions( requires_python = v[0].get("requires_python") if requires_python and only_for_python: if only_for_python.intersect(VersionIntervals.from_str(requires_python)): + # TODO try/except versions.append(parse_version(k)) else: + # TODO try/except versions.append(parse_version(k)) return versions