SHA256
1
0
forked from pool/python-onnx
Files
python-onnx/python-onnx.spec

196 lines
6.2 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-onnx
#
Accepting request 872358 from home:Guillaume_G:branches:science:machinelearning - Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1 * Bug fixes: - #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling - #3171 Fix bugs in external data helpers and add add size thresholds for converting - #2961 Fix build issues on some distributions of linux due to hard dependency on python2 - #3221 Fix mypy wrapper error while using ONNX as a submodule - Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0 * Training - Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954 - Removed GraphCall; eliminated need to implement GraphCall #2964 - Created a tool and example for users to use TrainingInfoProto for training #3008 * Shape Inference and Checker - Large model (>2GB model) support added for checker and shape_inference #2744 - Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023 - Node level shape inference fixes for operators * Version Converter - More operators supported #2664 * General Features - Added serialization for inputs and outputs of Sequence and Map data types #2581 - Added programmatic access to version-table and extend make-model #2918 - Added size check to make_tensor #2987 - Drop patch as the related problem has been fixed upstream: * using-onnxruntime-proto.patch OBS-URL: https://build.opensuse.org/request/show/872358 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=27
2021-02-15 12:43:38 +00:00
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%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
Name: python-onnx
Accepting request 872358 from home:Guillaume_G:branches:science:machinelearning - Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1 * Bug fixes: - #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling - #3171 Fix bugs in external data helpers and add add size thresholds for converting - #2961 Fix build issues on some distributions of linux due to hard dependency on python2 - #3221 Fix mypy wrapper error while using ONNX as a submodule - Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0 * Training - Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954 - Removed GraphCall; eliminated need to implement GraphCall #2964 - Created a tool and example for users to use TrainingInfoProto for training #3008 * Shape Inference and Checker - Large model (>2GB model) support added for checker and shape_inference #2744 - Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023 - Node level shape inference fixes for operators * Version Converter - More operators supported #2664 * General Features - Added serialization for inputs and outputs of Sequence and Map data types #2581 - Added programmatic access to version-table and extend make-model #2918 - Added size check to make_tensor #2987 - Drop patch as the related problem has been fixed upstream: * using-onnxruntime-proto.patch OBS-URL: https://build.opensuse.org/request/show/872358 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=27
2021-02-15 12:43:38 +00:00
Version: 1.8.1
Release: 0
Summary: Open Neural Network eXchange
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
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module protobuf}
BuildRequires: %{python_module pybind11-devel}
BuildRequires: %{python_module pybind11}
BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module six}
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: protobuf-devel
BuildRequires: python-rpm-macros
Requires: libonnx == %version
Requires: libonnx_proto == %version
Requires: libonnxifi_dummy == %version
Requires: python-numpy
Requires: python-protobuf
Requires: python-six
Requires: python-typing_extensions >= 3.6.2.1
Requires(post): update-alternatives
Accepting request 872358 from home:Guillaume_G:branches:science:machinelearning - Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1 * Bug fixes: - #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling - #3171 Fix bugs in external data helpers and add add size thresholds for converting - #2961 Fix build issues on some distributions of linux due to hard dependency on python2 - #3221 Fix mypy wrapper error while using ONNX as a submodule - Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0 * Training - Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954 - Removed GraphCall; eliminated need to implement GraphCall #2964 - Created a tool and example for users to use TrainingInfoProto for training #3008 * Shape Inference and Checker - Large model (>2GB model) support added for checker and shape_inference #2744 - Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023 - Node level shape inference fixes for operators * Version Converter - More operators supported #2664 * General Features - Added serialization for inputs and outputs of Sequence and Map data types #2581 - Added programmatic access to version-table and extend make-model #2918 - Added size check to make_tensor #2987 - Drop patch as the related problem has been fixed upstream: * using-onnxruntime-proto.patch OBS-URL: https://build.opensuse.org/request/show/872358 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=27
2021-02-15 12:43:38 +00:00
Requires(postun):update-alternatives
Provides: python-onnx-devel = %{version}-%{release}
Obsoletes: python-onnx-devel < %{version}-%{release}
%python_subpackages
%description
Open format to represent deep learning models. With ONNX, AI developers can
more easily move models between state-of-the-art tools and choose the
combination that is best for them. ONNX is developed and supported by a
community of partners.
%package -n onnx-devel
Summary: Header files of onnx
Requires: libonnx == %version
Requires: libonnx_proto == %version
Requires: libonnxifi_dummy == %version
%description -n onnx-devel
Accepting request 872358 from home:Guillaume_G:branches:science:machinelearning - Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1 * Bug fixes: - #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling - #3171 Fix bugs in external data helpers and add add size thresholds for converting - #2961 Fix build issues on some distributions of linux due to hard dependency on python2 - #3221 Fix mypy wrapper error while using ONNX as a submodule - Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0 * Training - Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954 - Removed GraphCall; eliminated need to implement GraphCall #2964 - Created a tool and example for users to use TrainingInfoProto for training #3008 * Shape Inference and Checker - Large model (>2GB model) support added for checker and shape_inference #2744 - Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023 - Node level shape inference fixes for operators * Version Converter - More operators supported #2664 * General Features - Added serialization for inputs and outputs of Sequence and Map data types #2581 - Added programmatic access to version-table and extend make-model #2918 - Added size check to make_tensor #2987 - Drop patch as the related problem has been fixed upstream: * using-onnxruntime-proto.patch OBS-URL: https://build.opensuse.org/request/show/872358 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=27
2021-02-15 12:43:38 +00:00
Header files of ONNX.
%package -n libonnxifi_dummy
Summary: Library for ONNX Interface for Framework Integration
%description -n libonnxifi_dummy
This package exists to create libonnx_proto, so you do no want
to install this package.
%package -n libonnx
Summary: Shared library for onnx
%description -n libonnx
This package exists to create libonnx_proto, so you do no want
to install this package.
%package -n libonnx_proto
Summary: Shared library for onnx protocul bufer
%description -n libonnx_proto
Shared library for the protocol buffer library, packaged separately to be
used by external project.
%package -n onnx-backend-test
Summary: Test data
%description -n onnx-backend-test
This packages includes the data for testing the backend.
%prep
%setup -q -n onnx-%{version}
# avoid bundles
rm -rf third_party
%autopatch -p1
# 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
sed -i -e '/addopts/d' setup.cfg
# do not pull in pytest-runner as it is deprecated
sed -i -e '/pytest-runner/d' setup.py
%build
%{python_expand # Generate the build system using the distro macro, configuring everything to taste for every python flavor.
%cmake -DONNX_USE_PROTOBUF_SHARED_LIBS:BOOL=ON \
-DONNX_WERROR:BOOL=OFF
# the macro stays in build/
cd ..
}
# let setup.py do the cmake build call (for every flavor)
%python_build
%install
%python_install
%cmake_install
%python_clone -a %{buildroot}%{_bindir}/backend-test-tools
%python_clone -a %{buildroot}%{_bindir}/check-node
%python_clone -a %{buildroot}%{_bindir}/check-model
%{python_expand # fix shebang
shebang_files="%{$python_sitearch}/onnx/backend/test/stat_coverage.py %{$python_sitearch}/onnx/defs/gen_doc.py %{$python_sitearch}/onnx/gen_proto.py"
for file in $shebang_files ; do
sed -i 's|%{_bindir}/env python.*$|%{_bindir}/$python|' %{buildroot}/$file
chmod 755 %{buildroot}/$file
done
}
%{?python_compileall}
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
Accepting request 872358 from home:Guillaume_G:branches:science:machinelearning - Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1 * Bug fixes: - #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling - #3171 Fix bugs in external data helpers and add add size thresholds for converting - #2961 Fix build issues on some distributions of linux due to hard dependency on python2 - #3221 Fix mypy wrapper error while using ONNX as a submodule - Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0 * Training - Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954 - Removed GraphCall; eliminated need to implement GraphCall #2964 - Created a tool and example for users to use TrainingInfoProto for training #3008 * Shape Inference and Checker - Large model (>2GB model) support added for checker and shape_inference #2744 - Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023 - Node level shape inference fixes for operators * Version Converter - More operators supported #2664 * General Features - Added serialization for inputs and outputs of Sequence and Map data types #2581 - Added programmatic access to version-table and extend make-model #2918 - Added size check to make_tensor #2987 - Drop patch as the related problem has been fixed upstream: * using-onnxruntime-proto.patch OBS-URL: https://build.opensuse.org/request/show/872358 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=27
2021-02-15 12:43:38 +00:00
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}"
# copy tests into clean subdir and test the installed lib in sitearch
mkdir cleantestdir
cp -r onnx/test onnx/examples cleantestdir/
pushd cleantestdir
# skip online tests
donttest=" test_bvlc_alexnet_cpu \
or test_shufflenet_cpu \
or test_densenet121_cpu \
or test_squeezenet_cpu \
or test_inception_v1_cpu \
or test_vgg19_cpu \
or test_inception_v2_cpu \
or test_zfnet512_cpu \
or test_resnet50_cpu"
%pytest_arch -n auto -k "not ($donttest)" -ra
popd
%post
%python_install_alternative backend-test-tools
%python_install_alternative check-node
%python_install_alternative check-model
%postun
%python_uninstall_alternative backend-test-tools
%python_uninstall_alternative check-node
%python_uninstall_alternative check-model
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/check-model
%python_alternative %{_bindir}/check-node
%python_alternative %{_bindir}/backend-test-tools
%{python_sitearch}/onnx*
%files -n onnx-devel
%{_includedir}/onnx
%{_libdir}/cmake/*
%exclude %{_includedir}/onnx/backend
%files -n onnx-backend-test
%{_includedir}/onnx/backend
%files -n libonnxifi_dummy
%{_libdir}/libonnxifi*.so
%{_libdir}/libonnxifi_loader.*
/usr/lib/libonnxifi.so
%files -n libonnx
%{_libdir}/libonnx.so
Accepting request 872358 from home:Guillaume_G:branches:science:machinelearning - Update to 1.8.1: https://github.com/onnx/onnx/releases/tag/v1.8.1 * Bug fixes: - #3169 To resolve memory crash on Windows, register python exceptions and update exceptions handling - #3171 Fix bugs in external data helpers and add add size thresholds for converting - #2961 Fix build issues on some distributions of linux due to hard dependency on python2 - #3221 Fix mypy wrapper error while using ONNX as a submodule - Changes from skipped 1.8.0: https://github.com/onnx/onnx/releases/tag/v1.8.0 * Training - Added Differentiable tags to make Gradient operator better defined #2723, #2893, #2911, #2954 - Removed GraphCall; eliminated need to implement GraphCall #2964 - Created a tool and example for users to use TrainingInfoProto for training #3008 * Shape Inference and Checker - Large model (>2GB model) support added for checker and shape_inference #2744 - Graph level shape inference fixes to patch the IR gap introduced since IR version 4 #3023 - Node level shape inference fixes for operators * Version Converter - More operators supported #2664 * General Features - Added serialization for inputs and outputs of Sequence and Map data types #2581 - Added programmatic access to version-table and extend make-model #2918 - Added size check to make_tensor #2987 - Drop patch as the related problem has been fixed upstream: * using-onnxruntime-proto.patch OBS-URL: https://build.opensuse.org/request/show/872358 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=27
2021-02-15 12:43:38 +00:00
%files -n libonnx_proto
%{_libdir}/libonnx_proto.so
%changelog