From 1dbb8caf2d268c32af285824939881aefd64a660 Mon Sep 17 00:00:00 2001 From: noO0ob Date: Wed, 22 Jan 2025 15:23:31 +0800 Subject: [PATCH 1/2] remove third part package in setup --- lyrebird/version.py | 2 +- setup.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lyrebird/version.py b/lyrebird/version.py index b75092e9..83c094dd 100644 --- a/lyrebird/version.py +++ b/lyrebird/version.py @@ -1,3 +1,3 @@ -IVERSION = (3, 2, 0) +IVERSION = (3, 2, 1) VERSION = ".".join(str(i) for i in IVERSION) LYREBIRD = "Lyrebird " + VERSION diff --git a/setup.py b/setup.py index a6764e45..8818a2ac 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,7 @@ import runpy import os import sys -from packaging import version -from setuptools import setup, find_packages +from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) @@ -26,8 +25,8 @@ def check_version_condition(condition): if not condition.startswith('python_version'): return True op, ver = condition.split(' ', 1)[1].split(' ') - current_ver = version.parse('.'.join(map(str, sys.version_info[:2]))) - ver = version.parse(ver.strip('"')) + current_ver = sys.version_info[:2] + ver = tuple(map(int, ver.strip('"').split('.'))) return { '>': current_ver > ver, '>=': current_ver >= ver, @@ -68,6 +67,7 @@ def check_version_condition(condition): 'lyrebird = lyrebird.manager:main' ] }, + setup_requires=['packaging'], install_requires=read_requirements('requirements.txt.lock'), extras_require={ 'dev': read_requirements('requirements.dev.txt') From 3531a843083cbe3964c03b761e9cd994988094f7 Mon Sep 17 00:00:00 2001 From: noO0ob Date: Wed, 22 Jan 2025 15:59:54 +0800 Subject: [PATCH 2/2] add comment --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8818a2ac..4d3770f4 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ )["VERSION"] +# Formatting (Spaces, etc.) in requirement must be consistent based on string parsing def read_requirements(file_path): with open(file_path, encoding='utf-8') as f: return [ @@ -21,6 +22,7 @@ def read_requirements(file_path): ) ] + def check_version_condition(condition): if not condition.startswith('python_version'): return True @@ -33,7 +35,7 @@ def check_version_condition(condition): '<': current_ver < ver, '<=': current_ver <= ver, '==': current_ver == ver - }.get(op, False) + }.get(op) with open(os.path.join(here, 'README.md'), encoding='utf-8') as f: