Skip to content

Commit

Permalink
fix #918: use packaging from setuptools for self-build
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Sep 21, 2023
1 parent 9d6ab45 commit 355e835
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
build-backend = "_own_version_helper"
requires = [
'importlib-metadata>=4.6; python_version < "3.10"',
"packaging>=20",
"rich",
"setuptools>=61",
'tomli; python_version < "3.11"',
Expand Down
8 changes: 6 additions & 2 deletions src/setuptools_scm/_version_cls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
from typing import Type
from typing import Union

from packaging.version import InvalidVersion
from packaging.version import Version as Version
try:
from packaging.version import InvalidVersion
from packaging.version import Version as Version
except ImportError:
from setuptools.extern.packaging.version import InvalidVersion # type: ignore
from setuptools.extern.packaging.version import Version as Version # type: ignore


class NonNormalizedVersion(Version):
Expand Down

0 comments on commit 355e835

Please sign in to comment.