Skip to content

Commit e857d3b

Browse files
noO0oOo0obnoO0ob
andauthored
Bugfix/fix packaging error in pipline (#894)
* remove third part package in setup * add comment --------- Co-authored-by: noO0ob <wujiasheng03@meituan.com>
1 parent a1f1098 commit e857d3b

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

lyrebird/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
IVERSION = (3, 2, 0)
1+
IVERSION = (3, 2, 1)
22
VERSION = ".".join(str(i) for i in IVERSION)
33
LYREBIRD = "Lyrebird " + VERSION

setup.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import runpy
22
import os
33
import sys
4-
from packaging import version
5-
from setuptools import setup, find_packages
4+
from setuptools import setup
65

76
here = os.path.abspath(os.path.dirname(__file__))
87

@@ -11,6 +10,7 @@
1110
)["VERSION"]
1211

1312

13+
# Formatting (Spaces, etc.) in requirement must be consistent based on string parsing
1414
def read_requirements(file_path):
1515
with open(file_path, encoding='utf-8') as f:
1616
return [
@@ -22,19 +22,20 @@ def read_requirements(file_path):
2222
)
2323
]
2424

25+
2526
def check_version_condition(condition):
2627
if not condition.startswith('python_version'):
2728
return True
2829
op, ver = condition.split(' ', 1)[1].split(' ')
29-
current_ver = version.parse('.'.join(map(str, sys.version_info[:2])))
30-
ver = version.parse(ver.strip('"'))
30+
current_ver = sys.version_info[:2]
31+
ver = tuple(map(int, ver.strip('"').split('.')))
3132
return {
3233
'>': current_ver > ver,
3334
'>=': current_ver >= ver,
3435
'<': current_ver < ver,
3536
'<=': current_ver <= ver,
3637
'==': current_ver == ver
37-
}.get(op, False)
38+
}.get(op)
3839

3940

4041
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
@@ -68,6 +69,7 @@ def check_version_condition(condition):
6869
'lyrebird = lyrebird.manager:main'
6970
]
7071
},
72+
setup_requires=['packaging'],
7173
install_requires=read_requirements('requirements.txt.lock'),
7274
extras_require={
7375
'dev': read_requirements('requirements.dev.txt')

0 commit comments

Comments
 (0)