11import runpy
22import os
33import sys
4- from packaging import version
5- from setuptools import setup , find_packages
4+ from setuptools import setup
65
76here = os .path .abspath (os .path .dirname (__file__ ))
87
1110)["VERSION" ]
1211
1312
13+ # Formatting (Spaces, etc.) in requirement must be consistent based on string parsing
1414def 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+
2526def 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
4041with 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