Skip to content

Commit

Permalink
Bugfix/fix packaging error in pipline (#894)
Browse files Browse the repository at this point in the history
* remove third part package in setup

* add comment

---------

Co-authored-by: noO0ob <[email protected]>
  • Loading branch information
noO0oOo0ob and noO0ob authored Jan 22, 2025
1 parent a1f1098 commit e857d3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lyrebird/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
IVERSION = (3, 2, 0)
IVERSION = (3, 2, 1)
VERSION = ".".join(str(i) for i in IVERSION)
LYREBIRD = "Lyrebird " + VERSION
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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__))

Expand All @@ -11,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 [
Expand All @@ -22,19 +22,20 @@ def read_requirements(file_path):
)
]


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,
'<': 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:
Expand Down Expand Up @@ -68,6 +69,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')
Expand Down

0 comments on commit e857d3b

Please sign in to comment.