Skip to content

Commit

Permalink
version: fixup error: KeyError: 'distutils'
Browse files Browse the repository at this point in the history
python version >= 3.7 and setuptools version >= 60

Info: userwarning: setuptools is replacing distutils
Link: pypa/setuptools#3297
  • Loading branch information
zoumingzhe committed Apr 1, 2024
1 parent 83cba4f commit 516d8bb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xpip_build/cmds/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from argparse import Namespace
import platform
import sys
from typing import List

from pip import __version__ as pip_version
from setuptools import __version__ as setuptools_version

from ..util import __version__ as xpip_version

Expand All @@ -15,7 +16,8 @@ def add_cmd(_arg: ArgumentParser):


def run_cmd(args: Namespace) -> int:
python_version = f"python {platform.python_version()}, pip {pip_version}"
sys.stderr.write(f"xpip-build {xpip_version} ({python_version})\n")
versions: List[str] = [f"python {platform.python_version()}",
f"setuptools {setuptools_version}"]
sys.stderr.write(f"xpip-build {xpip_version} ({', '.join(versions)})\n")
sys.stdout.flush()
return 0

0 comments on commit 516d8bb

Please sign in to comment.