From c546f91e9ca1ff5e3e1f21e6c5e17607cd9c29c3 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 04 2023 19:28:59 +0000 Subject: feat: fix build using snapshot (fixes rhbz#2220333, rhbz#2203048) --- diff --git a/.gitignore b/.gitignore index 543efed..433ff9f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /python-mne-1.3.0.tar.gz /python-mne-1.3.1.tar.gz /python-mne-1.5.0.tar.gz +/python-mne-f44636f.tar.gz diff --git a/python-mne.spec b/python-mne.spec index b5469bb..1275b4b 100644 --- a/python-mne.spec +++ b/python-mne.spec @@ -1,3 +1,10 @@ +# use snapshot to include bugfix +# https://github.com/mne-tools/mne-python/issues/11931 +%global commit f44636f00666b8eb869417960926d01690ff4f42 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global checkout_date 2023094 +%global upstream_version 1.5.0 + # setup.py does not list all requirements, and we also unbundle quite a few # from the externals folder, so we can't only rely on the automatic generator # here. @@ -5,7 +12,15 @@ # in setup.py for install_requires. Name: python-mne -Version: 1.5.0 + +%if "0%{?commit}" != "0" +Version: %{upstream_version}^%{checkout_date}git%{shortcommit} +%global python_version %{upstream_version}.dev%{checkout_date} +%else +Version: %{upstream_version} +%global python_version %{version} +%endif + Release: %autorelease Summary: Magnetoencephalography (MEG) and Electroencephalography (EEG) data analysis @@ -15,7 +30,14 @@ Summary: Magnetoencephalography (MEG) and Electroencephalography (EEG) da License: BSD URL: http://martinos.org/mne/ + + +%if "0%{?commit}" != "0" +Source0: https://github.com/mne-tools/mne-python/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +%else Source0: https://github.com/mne-tools/mne-python/archive/v%{version}/%{name}-%{version}.tar.gz +%endif + #Source1: https://s3.amazonaws.com/mne-python/datasets/MNE-sample-data-processed.tar.gz # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval @@ -113,7 +135,11 @@ Recommends: python3-Traits %description -n python3-mne %_description %prep -%autosetup -n mne-python-%{version} -p1 +%if "0%{?commit}" != "0" +%autosetup -n mne-python-%{commit} +%else +%autosetup -n mne-python-%{version} +%endif # fix non-executable scripts sed -i -e '1{\@^#!/usr/bin/env python@d}' mne/commands/*.py @@ -122,23 +148,23 @@ sed -i -e '1{\@^#!/usr/bin/env python@d}' mne/stats/cluster_level.py %generate_buildrequires -export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' +export SETUPTOOLS_SCM_PRETEND_VERSION='%{python_version}' %pyproject_buildrequires -r #cp -p %{SOURCE1} . #python -c "import mne; mne.datasets.sample.data_path(verbose=True, download=False)" %build -export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' +export SETUPTOOLS_SCM_PRETEND_VERSION='%{python_version}' %pyproject_wheel %install -export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' +export SETUPTOOLS_SCM_PRETEND_VERSION='%{python_version}' %pyproject_install %pyproject_save_files mne %check -export SETUPTOOLS_SCM_PRETEND_VERSION='%{version}' +export SETUPTOOLS_SCM_PRETEND_VERSION='%{python_version}' export MNE_SKIP_TESTING_DATASET_TESTS=true export MNE_SKIP_NETWORK_TESTS=1 export MNE_DONTWRITE_HOME=true diff --git a/sources b/sources index 6a06006..0343ac4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-mne-1.5.0.tar.gz) = bd63e5da10fa323d725661de8a0ae91666af20c0b3b7bbbc90ed2d248a0c9708150e91c466c924c1de2fa62551bb3ee0fb6127c1039362a8f39086f2483d753e +SHA512 (python-mne-f44636f.tar.gz) = f2e88c735f11aac790af46e7ab0b480eba00de6f1d8380e75a4c24d1a7e7244f730cdaee6df0aeac037bf5bd8dc96b421adbdcd623da178038cc3df6cf88814b