From 389fd79a0a252393778b5dd138bab01d252a5531 Mon Sep 17 00:00:00 2001 From: Andreas Bichinger Date: Sat, 1 Jun 2024 19:56:17 +0200 Subject: [PATCH] fix: use packaging instead of pkg_resources.packaging #37 --- lib/py/requirements.txt | 3 ++- lib/util.ts | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/py/requirements.txt b/lib/py/requirements.txt index 0836eba..d292151 100644 --- a/lib/py/requirements.txt +++ b/lib/py/requirements.txt @@ -2,4 +2,5 @@ pip~=23.2 build~=1.0 setuptools~=68.2 twine~=4.0 -tomlkit~=0.12 \ No newline at end of file +tomlkit~=0.12 +packaging~=24.0 \ No newline at end of file diff --git a/lib/util.ts b/lib/util.ts index 767a39b..02a25c3 100644 --- a/lib/util.ts +++ b/lib/util.ts @@ -4,8 +4,7 @@ import path from 'path'; async function normalizeVersion(version: string) { const { stdout } = await execa('python3', [ '-c', - 'import pkg_resources\n' + - `print(pkg_resources.packaging.version.Version('${version}'))`, + `from packaging.version import Version\nprint(Version('${version}'))`, ]); return stdout; }