## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

Name:           python-pyxdf
Version:        1.17.0
Release:        %autorelease
Summary:        Python package for working with XDF files

License:        BSD-2-Clause
URL:            https://github.com/xdf-modules/pyxdf
Source0:        %{pypi_source pyxdf}
# Required to run some of the tests. This is not mandatory, but why not run all
# the tests we can?  The contents of this archive are licensed (SPDX) MIT, but
# are not installed and do not contribute to the licenses of the binary RPMs.
# The commit hash should be the latest one at the time of the packaged release.
%global ex_commit 387ba537c3a0dd5da2c9a51c578c8f1296e3edeb
%global ex_url https://github.com/xdf-modules/example-files
Source1:        %{ex_url}/archive/%{ex_commit}/example-files-%{ex_commit}.tar.gz

# The package is pure Python and contains no compiled code; however, it has a
# history of endian-dependent test failures, so we make the base package arched
# to ensure the tests run on all architectures (so that any future regressions
# are detected quickly). All binary packages are noarch.
%global debug_package %{nil}
 
BuildRequires:  python3-devel

# See the “dev” dependency group, which also includes unwanted linters etc.
BuildRequires:  %{py3_dist pytest}

%global common_description %{expand:
pyXDF is a Python importer for XDF files.}

%description %{common_description}


%package -n     python3-pyxdf
Summary:        %{summary}

BuildArch:      noarch

%description -n python3-pyxdf %{common_description}

See python3-pyxdf-examples for the command-line examples (pyxdf.cli).


%package -n     python3-pyxdf-examples
Summary:        %{summary}

BuildArch:      noarch

Requires:       python3-pyxdf = %{version}-%{release}

# This is also a dependency of python3-pyxdf, but we make it explicit since it
# is imported in the example code.
Requires:       %{py3_dist numpy}
# If pylsl (https://pypi.org/project/pylsl/) is ever packaged, we should add a
# manual dependency on it to this subpackage, since pyxdf.cli.playback_lsl
# uses it.

%description -n python3-pyxdf-examples %{common_description}

This package contains the examples (pyxdf.cli). These can be run from the
command line for basic functionality.

  • print_metadata will enable a DEBUG logger to log read messages, then it
    will print basic metadata about each found stream.
      â—¦ python3 -m pyxdf.cli.print_metadata -f=/path/to/my.xdf

  • playback_lsl will open an XDF file then replay its data in an infinite
    loop, but using current timestamps. This is useful for prototyping online
    processing.
      â—¦ python3 -m pyxdf.cli.playback_lsl /path/to/my.xdf


%prep
%autosetup -n pyxdf-%{version} -p1
%setup -q -n pyxdf-%{version} -T -D -b 1
ln -s ../example-files-%{ex_commit}/ example-files


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files -l pyxdf


%check
%pytest


%files -n python3-pyxdf -f %{pyproject_files}
%doc CHANGELOG.md
%doc README.md

%exclude %{python3_sitelib}/pyxdf/cli/


%files -n python3-pyxdf-examples
%{python3_sitelib}/pyxdf/cli/


%changelog
## START: Generated by rpmautospec
* Thu Jan 16 2025 Packit <hello@packit.dev> - 1.17.0-1
- Update to 1.17.0 upstream release
- Resolves: rhbz#2336120
- The pyxdf.examples package is renamed to pyxdf.cli; we still package it
  as python3-pyxdf-examples.

* Thu Jul 18 2024 Packit <hello@packit.dev> - 1.16.8-1
- Update to 1.16.8 upstream release
- Resolves: rhbz#2298637

* Wed Jul 17 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.16.7-1
- Update to 1.16.7 (close RHBZ#2298482)

* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 1.16.6-2
- Rebuilt for Python 3.13

* Thu Apr 18 2024 Packit <hello@packit.dev> - 1.16.6-1
- Update to 1.16.6 upstream release
- Resolves: rhbz#2275890
- Splits the examples into a separate subpackage

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.16.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.16.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Fri Jan 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.16.5-2
- Fix reading numeric array data on big-endian hosts
- Build on all architectures (arched base package) to help detect any
  future endian-related regressions

* Fri Jan 12 2024 Benjamin A. Beasley <code@musicinmybrain.net> - 1.16.5-1
- Update to 1.16.5 (close RHBZ#2258032)

* Mon Dec 18 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.16.4-4
- Assert that %%pyproject_files contains a license file

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.16.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon Jun 26 2023 Python Maint <python-maint@redhat.com> - 1.16.4-2
- Rebuilt for Python 3.12

* Wed May 10 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 1.16.4-1
- Initial package (close RHBZ#2196859)
## END: Generated by rpmautospec