## START: Set by rpmautospec ## (rpmautospec version 0.2.5) %define autorelease(e:s:pb:) %{?-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*}}%{?dist} ## END: Set by rpmautospec %global forgeurl https://github.com/BlueBrain/BluePyOpt # versioneer is used, so no tags for patch versions # use git tar since pypi does not include examples that are needed for tests. %global commit 6d4185479bc6dddb3daad84fa27e0b8457d69652 %bcond_without tests %global _description %{expand: The Blue Brain Python Optimisation Library (BluePyOpt) is an extensible framework for data-driven model parameter optimisation that wraps and standardises several existing open-source tools. It simplifies the task of creating and sharing these optimisations, and the associated techniques and knowledge. This is achieved by abstracting the optimisation and evaluation tasks into various reusable and flexible discrete elements according to established best-practices.} Name: python-bluepyopt Version: 1.11.5 Release: %autorelease Summary: Bluebrain Python Optimisation Library (bluepyopt) # This package is not noarch because it's tests are arch dependent but it does # not install any arch dependent files and so does not generate debuginfo %global debug_package %{nil} License: LGPLv3 %forgemeta URL: %forgeurl Source0: %forgesource # use _version file from pypi tar to trick versioneer Source1: _version.py # Not all requirements are listed, so we need to use explicit BRs also BuildRequires: python3-devel # Required to compile neuron based models BuildRequires: neuron-devel BuildRequires: gcc-c++ BuildRequires: libX11-devel BuildRequires: libXext-devel # To run tests %if %{with tests} BuildRequires: %{py3_dist future} BuildRequires: python3-jupyter-client BuildRequires: python3-nbconvert BuildRequires: %{py3_dist mock} BuildRequires: python3-neuron BuildRequires: %{py3_dist pytest} %endif %description %_description %package -n python3-bluepyopt Summary: %{summary} # Only need to list ones not listed in setup.py Requires: neuron-devel Requires: python3-neuron Requires: python3dist(setuptools) %description -n python3-bluepyopt %_description %package -n python3-bluepyopt-doc Summary: Documentation for bluepyopt %description -n python3-bluepyopt-doc %_description %prep %forgesetup cp -v %{SOURCE1} "bluepyopt/_version.py" # Optional dependency, remove so that automatic dep generator does not pick it up sed -i '/scoop/ d' setup.py # For tests, we install jupyter as BuildRequires # remove all Makefile deps on the jupyter target # need to check this for each update, in case the makefile changes sed -i 's/^\(.*:.*\)jupyter$/\1/' Makefile # Remove gitignore files in the examples find examples/ -name ".gitignore" -delete # Remove dummy files that keep the folder tracked in git for upstream find examples/ -name "dummy.inc" -delete # Correct shebangs find examples/ -type f -name "*.py" -exec sed -i 's|^#![ ]*/usr/bin/env.*$|#!/usr/bin/python3/|' '{}' 2>/dev/null \; find examples/ -type f -name "*.py" -exec chmod -x '{}' \; # Correct end of line encodings find examples/ -type f -name "*.mod" -exec sed -i 's/\r$//' '{}' \; find examples/ -type f -name "*.asc" -exec sed -i 's/\r$//' '{}' \; find examples/ -type f -name "*.csv" -exec sed -i 's/\r$//' '{}' \; # Makefile hard codes x86_64 # Tests also hard code the platform # Need to make sure it matches the arch used in NEURON # Macros don't work on 32bit builds, where we may get 1686 packages on i386 etc. export MODSUBDIR=$(grep "^MODSUBDIR" /usr/bin/nrnivmodl | cut -d "=" -f2) sed -i "s/x86_64/$MODSUBDIR/" Makefile sed -i "s/x86_64/$MODSUBDIR/" bluepyopt/tests/test_l5pc.py sed -i "s/x86_64/$MODSUBDIR/" bluepyopt/tests/test_stochkv.py %generate_buildrequires %pyproject_buildrequires %{?with_tests: -r} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files bluepyopt %check %if %{with tests} # Prepare for tests # Refer to: https://github.com/BlueBrain/BluePyOpt/blob/master/tox.ini # and https://github.com/BlueBrain/BluePyOpt/blob/master/Makefile make stochkv_prepare l5pc_prepare sc_prepare meta_prepare # test fail with a very slight approximation error PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} %{pytest} bluepyopt/tests/ -m "unit" -k "not test_metaparameter and not test_NrnRampPulse_instantiate" PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} %{pytest} bluepyopt/tests/ -m "not unit" # clean up whatever files were temporarily generated for tests make clean %endif %files -n python3-bluepyopt -f %{pyproject_files} %doc README.rst %{_bindir}/bpopt_tasksdb %files -n python3-bluepyopt-doc %license COPYING COPYING.lesser %doc examples %changelog * Sun Oct 03 2021 Ankur Sinha (Ankur Sinha Gmail) 1.11.5-1 - feat: update to 1.11.5 * Fri Jul 23 2021 Fedora Release Engineering 1.10.36-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint 1.10.36-4 - Rebuilt for Python 3.10 * Fri May 28 2021 Ankur Sinha (Ankur Sinha Gmail) 1.10.36-3 - fix: add tweak to make tests pass on all arches * Thu May 27 2021 Ankur Sinha (Ankur Sinha Gmail) 1.10.36-2 - feat: disable non unit tests * Thu May 27 2021 Ankur Sinha (Ankur Sinha Gmail) 1.10.36-1 - feat: update to latest upstream release * Wed Apr 14 2021 Ankur Sinha (Ankur Sinha Gmail) 1.9.149-1 - feat: initial import