2013-04-30 13:22:38 +02:00
|
|
|
#
|
2024-02-29 02:59:54 +01:00
|
|
|
# spec file for package python-construct
|
2013-04-30 13:22:38 +02:00
|
|
|
#
|
2024-01-02 21:42:59 +01:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2013-04-30 13:22:38 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-12-04 14:21:13 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-05-08 15:16:42 +02:00
|
|
|
#
|
2013-04-30 13:22:38 +02:00
|
|
|
|
|
|
|
|
2019-12-15 14:20:28 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
2020-02-12 13:21:40 +01:00
|
|
|
%bcond_without test
|
2019-12-15 14:20:28 +01:00
|
|
|
%else
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2023-12-29 19:15:59 +01:00
|
|
|
%{?sle15_python_module_pythons}
|
2019-12-15 14:20:28 +01:00
|
|
|
Name: python-construct%{?psuffix}
|
2023-12-29 19:15:59 +01:00
|
|
|
Version: 2.10.70
|
2013-04-30 13:22:38 +02:00
|
|
|
Release: 0
|
2017-08-26 19:09:05 +02:00
|
|
|
Summary: A declarative parser/builder for binary data
|
2014-05-08 15:16:42 +02:00
|
|
|
License: MIT
|
2019-01-02 10:57:00 +01:00
|
|
|
URL: https://github.com/construct/construct
|
2021-02-14 01:05:37 +01:00
|
|
|
Source: https://github.com/construct/construct/archive/v%{version}.tar.gz#/construct-%{version}.tar.gz
|
2019-01-11 10:56:50 +01:00
|
|
|
Patch0: split_debug.patch
|
2023-12-29 19:15:59 +01:00
|
|
|
BuildRequires: %{python_module pip}
|
2024-01-02 21:42:59 +01:00
|
|
|
BuildRequires: %{python_module setuptools}
|
2023-12-29 19:15:59 +01:00
|
|
|
BuildRequires: %{python_module wheel}
|
2019-12-15 14:20:28 +01:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2020-02-12 13:21:40 +01:00
|
|
|
Requires: python-arrow
|
2021-02-14 01:05:37 +01:00
|
|
|
Recommends: python-cloudpickle
|
|
|
|
Recommends: python-lz4
|
2020-02-12 13:21:40 +01:00
|
|
|
Recommends: python-numpy
|
|
|
|
Recommends: python-ruamel.yaml
|
|
|
|
BuildArch: noarch
|
2019-12-15 14:20:28 +01:00
|
|
|
%if %{with test}
|
2019-01-02 10:57:00 +01:00
|
|
|
BuildRequires: %{python_module arrow}
|
2021-02-14 01:05:37 +01:00
|
|
|
BuildRequires: %{python_module cloudpickle}
|
2024-01-02 21:44:24 +01:00
|
|
|
BuildRequires: %{python_module cryptography}
|
2021-02-14 01:05:37 +01:00
|
|
|
BuildRequires: %{python_module lz4}
|
2024-01-02 21:44:24 +01:00
|
|
|
BuildRequires: %{python_module numpy}
|
2019-01-02 10:57:00 +01:00
|
|
|
BuildRequires: %{python_module pytest-benchmark}
|
|
|
|
BuildRequires: %{python_module pytest}
|
2020-02-12 13:21:40 +01:00
|
|
|
BuildRequires: %{python_module ruamel.yaml}
|
2019-01-02 10:57:00 +01:00
|
|
|
%endif
|
2017-04-26 07:34:51 +02:00
|
|
|
%python_subpackages
|
2013-04-30 13:22:38 +02:00
|
|
|
|
|
|
|
%description
|
2017-08-26 19:09:05 +02:00
|
|
|
Construct is a declarative parser (and builder) for binary data.
|
2013-04-30 13:22:38 +02:00
|
|
|
|
2017-08-26 19:09:05 +02:00
|
|
|
Instead of writing imperative code to parse a piece of data, a data
|
|
|
|
structure that describes the data is declared. As this data structure is not
|
2018-12-04 18:11:33 +01:00
|
|
|
code, it can be used in one direction to parse data into Pythonic objects,
|
2017-08-26 19:09:05 +02:00
|
|
|
and in the other direction to convert ("build") objects into binary data.
|
2013-04-30 13:22:38 +02:00
|
|
|
|
|
|
|
%prep
|
2024-02-29 02:59:54 +01:00
|
|
|
%autosetup -p1 -n construct-%{version}
|
2019-01-11 10:56:50 +01:00
|
|
|
|
2019-01-02 10:57:00 +01:00
|
|
|
# remove gallery tests that require in place stuff
|
|
|
|
rm -rf tests/gallery
|
|
|
|
rm -rf tests/deprecated_gallery
|
2013-04-30 13:22:38 +02:00
|
|
|
|
|
|
|
%build
|
2019-12-15 14:20:28 +01:00
|
|
|
%if %{without test}
|
2023-12-29 19:15:59 +01:00
|
|
|
%pyproject_wheel
|
2019-12-15 14:20:28 +01:00
|
|
|
%endif
|
2013-04-30 13:22:38 +02:00
|
|
|
|
|
|
|
%install
|
2019-12-15 14:20:28 +01:00
|
|
|
%if %{without test}
|
2023-12-29 19:15:59 +01:00
|
|
|
%pyproject_install
|
2019-10-14 13:40:38 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2019-12-15 14:20:28 +01:00
|
|
|
%endif
|
2013-04-30 13:22:38 +02:00
|
|
|
|
2019-01-02 10:57:00 +01:00
|
|
|
%check
|
2019-12-15 14:20:28 +01:00
|
|
|
%if %{with test}
|
2020-06-23 18:31:52 +02:00
|
|
|
# local source dir is needed for tests
|
|
|
|
export PYTHONPATH=$(pwd)
|
2021-02-14 01:05:37 +01:00
|
|
|
# Don't test with NumPy in the python36 flavor, because python36-numpy is not in TW anymore
|
2021-11-07 20:18:27 +01:00
|
|
|
python36_donttest="numpy or test_overall_parse or test_overall_build or test_compiled_example_benchmark or test_compiled_example_integrity"
|
2021-02-14 01:05:37 +01:00
|
|
|
%pytest --benchmark-disable ${$python_donttest:+ -k "not (${$python_donttest})"}
|
2019-12-15 14:20:28 +01:00
|
|
|
%endif
|
2019-01-02 10:57:00 +01:00
|
|
|
|
2019-12-15 14:20:28 +01:00
|
|
|
%if %{without test}
|
2017-04-26 07:34:51 +02:00
|
|
|
%files %{python_files}
|
2018-12-04 18:11:33 +01:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.rst
|
2017-04-26 07:34:51 +02:00
|
|
|
%{python_sitelib}/construct
|
2023-12-29 19:15:59 +01:00
|
|
|
%{python_sitelib}/construct-%{version}.dist-info
|
2019-12-15 14:20:28 +01:00
|
|
|
%endif
|
2013-04-30 13:22:38 +02:00
|
|
|
|
2014-05-08 15:16:42 +02:00
|
|
|
%changelog
|