## START: Set by rpmautospec ## (rpmautospec version 0.2.6) %define autorelease(e:s:pb:) %{?-p:0.}%{lua: release_number = 4; 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 7dfae69884564cba4a49fdb4e6494eedb4abc7bb %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.15 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 BuildArch: noarch 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 * Tue Jun 21 2022 Python Maint 1.11.15-4 - Rebuilt for Python 3.11 * Wed Feb 09 2022 Ankur Sinha (Ankur Sinha Gmail) 1.11.15-3 - chore: bump for branch * Tue Feb 08 2022 Ankur Sinha (Ankur Sinha Gmail) 1.11.15-2 - bump * Fri Jul 23 2021 Fedora Release Engineering - 1.10.36-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Fri Jun 04 2021 Python Maint - 1.10.36-3 - Rebuilt for Python 3.10 * Thu May 27 2021 Ankur Sinha - 1.10.36-2 - make package archful, since tests are arch dependent * Thu May 27 2021 Ankur Sinha - 1.10.36-1 - ignore non-unit tests, these fail on ppc64le etc. * Thu May 27 2021 Ankur Sinha - 1.10.36-1 - Update to latest release - Use pytest and enable tests by default * Wed Apr 14 2021 Ankur Sinha - 1.9.149-1 - Correct pyprovide macro - Include examples - Split examples to sub-package * Sun Apr 11 2021 Ankur Sinha - 1.9.149-1 - Update to latest release * Mon Jul 06 2020 Anil Tuncel - 1.9.48-1 - Move neuron requirement to subpackage - Enable tests - Use github tar since pypi tar does not include examples * Thu Jun 25 2020 Anil Tuncel - 1.9.48-1 - Removed INSTALLED_FILES method - Updated file checks - Added check to run tests - Removed the %%clean tag - use autosetup, py3_build, py3_install - use pypi_source macro - removed deprecated release, vengor and group tags * Wed Jun 17 2020 Anil Tuncel - 1.9.48-1 - Initial package generated using python setup.py bdist --formats=rpm