!9 1.解决导入vllm时无版本号告警的问题 2.spec适配openeuler22.03

From: @renren247 
Reviewed-by: @rubickrt, @jimmy_hero 
Signed-off-by: @jimmy_hero
This commit is contained in:
openeuler-ci-bot 2025-03-29 10:01:09 +00:00 committed by Gitee
commit e837cfd11d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -3,7 +3,7 @@
Name: vllm Name: vllm
Version: 0.6.6.post1 Version: 0.6.6.post1
Release: 1 Release: 2
Summary: Powerful engine for LLMs Summary: Powerful engine for LLMs
License: (Apache-2.0 AND BSD-3-Clause) OR BSD-3-CLause License: (Apache-2.0 AND BSD-3-Clause) OR BSD-3-CLause
URL: https://github.com/vllm-project/vllm URL: https://github.com/vllm-project/vllm
@ -16,8 +16,8 @@ BuildArch: noarch
%package -n python3-%{_name} %package -n python3-%{_name}
Summary: %{summary} Summary: %{summary}
Buildrequires: cmake >= 3.26 python3-pip python3-devel python3-setuptools python3-pytest Buildrequires: cmake python3-pip python3-devel python3-setuptools python3-pytest
Buildrequires: python3-setuptools_scm python3-wheel python3-pytest-asyncio python3-grpcio Buildrequires: python3-setuptools_scm python3-wheel python3-grpcio
Buildrequires: python3-pytorch Buildrequires: python3-pytorch
%{?python_provide:%python_provide python3-%{_name}} %{?python_provide:%python_provide python3-%{_name}}
@ -30,12 +30,21 @@ Buildrequires: python3-pytorch
%autosetup -n %{name}-%{version} -N %autosetup -n %{name}-%{version} -N
%build %build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
export VLLM_TARGET_DEVICE=empty export VLLM_TARGET_DEVICE=empty
%py3_build %py3_build
%install %install
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
export VLLM_TARGET_DEVICE=empty export VLLM_TARGET_DEVICE=empty
%py3_install %py3_install
VERSION_FILE=$(find %{buildroot} -name '_version.py')
if [ -f "$VERSION_FILE" ]; then
sed -i 's/^version = /__version__ = /g' "$VERSION_FILE"
sed -i 's/^version_tuple = /__version_tuple__ = /g' "$VERSION_FILE"
fi
pushd %{buildroot} pushd %{buildroot}
if [ -d usr/lib ]; then if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
@ -60,5 +69,8 @@ mv %{buildroot}/filelist.lst .
%files -n python3-%{_name} -f filelist.lst %files -n python3-%{_name} -f filelist.lst
%changelog %changelog
* Thu Mar 27 2025 renwenjie<renwenjie5@huawei.com> - 0.6.6.post1-2
- solve 'no module named vllm._version' problem and adapted for openeuler22.03
* Fri Feb 28 2025 renwenjie<renwenjie5@huawei.com> - 0.6.6.post1-1 * Fri Feb 28 2025 renwenjie<renwenjie5@huawei.com> - 0.6.6.post1-1
- Package init - Package init