Skip to content

Commit

Permalink
Fix repo test
Browse files Browse the repository at this point in the history
Fixes the repo test by switching dependencies from setuptools._vender.packaging to packaging.version.
  • Loading branch information
HeroesLament committed Aug 21, 2024
1 parent 01f92c8 commit 4cde55d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/test_repo/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import re

import pytest
from setuptools._vendor import packaging

from packaging.version import Version, InvalidVersion

@pytest.fixture
def files():
Expand All @@ -29,6 +28,11 @@ def test_changelog(files):
for line in files['CHANGELOG.rst'].readlines():
if line[0] == '*':
break
static_version = packaging.version.parse(files['VERSION'].getvalue())
last_changelog_version = packaging.version.parse(line.split()[1])

try:
static_version = Version(files['VERSION'].getvalue().strip())
last_changelog_version = Version(line.split()[1])
except InvalidVersion as e:
pytest.fail(f"Invalid version encountered: {e}")

assert static_version >= last_changelog_version

0 comments on commit 4cde55d

Please sign in to comment.