SHA256
1
0
forked from pool/python-onnx

Accepting request 974888 from home:mcepl:branches:science:machinelearning

- Add 3734-enable-python310.patch to make the package Python 3.10
  compatible (gh#onnx/onnx#3734).
- Remove no-python2.patch, it is really better to fix shebang
  with a sed command.

OBS-URL: https://build.opensuse.org/request/show/974888
OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=31
This commit is contained in:
2022-05-05 10:14:06 +00:00
committed by Git OBS Bridge
parent 3f07f08da9
commit 625cc2ead1
5 changed files with 1118 additions and 15 deletions

View File

@@ -20,8 +20,6 @@
%define skip_python2 1
# Tumbleweed does not have a python36-numpy anymore: NEP 29 dropped Python 3.6 for NumPy 1.20
%define skip_python36 1
# onnx 1.10.2 is not yet ready for python 3.10
%define skip_python310 1
Name: python-onnx
Version: 1.10.2
Release: 0
@@ -30,7 +28,9 @@ License: MIT
URL: https://onnx.ai/
Source0: https://github.com/onnx/onnx/archive/v%{version}.tar.gz#/onnx-%{version}.tar.gz
Source1: %{name}-rpmlintrc
Patch1: no-python2.patch
# PATCH-FIX-UPSTREAM 3734-enable-python310.patch gh#onnx/onnx#3734 mcepl@suse.com
# Make the package Python 3.10 compatible
Patch0: 3734-enable-python310.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module protobuf}
@@ -102,9 +102,14 @@ This packages includes the data for testing the backend.
%prep
%setup -q -n onnx-%{version}
# avoid bundles
rm -rf third_party
%autopatch -p1
# fix shebang
sed -i "s|^#!\s*%{_bindir}/env python|#!%{_bindir}/python3|" tools/protoc-gen-mypy.py
# build inside python_expand shuffled build dir also used by the cmake macro instead of upstream's custom dirname
sed -i "/^CMAKE_BUILD_DIR = / s/TOP_DIR, '.setuptools-cmake-build'/TOP_DIR, 'build'/" setup.py
# do not require extra pytest modules