## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; 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 %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. # Upstream tags with every push to master (why?) # Use commit found in bluepyopt/_version.py of the PyPI release %global commit 43d63a88c0c9fc5b33cd69d6c5ce0db77f6dea1e # 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} # Run tests %bcond tests 1 %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.14.11 Release: %autorelease Summary: Bluebrain Python Optimisation Library (bluepyopt) %forgemeta # pyedflib excludes s390x, so all deps also exclude it # lfpy excludes ppc64le, se we follow suite # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: s390x %{ix86} %{power64} License: LGPL-3.0-only URL: %forgeurl Source0: %forgesource # use _version file from pypi tar to trick versioneer Source1: _version.py # Fix exclusion in setup.py (these are globs) # https://github.com/BlueBrain/BluePyOpt/pull/467 Patch: https://github.com/BlueBrain/BluePyOpt/pull/467.patch # 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 BuildRequires: python3-matplotlib # To run tests %if %{with tests} BuildRequires: python3-jupyter-client BuildRequires: python3-nbconvert BuildRequires: python3-neuron BuildRequires: python3-pytest BuildRequires: python3-lfpy BuildRequires: python3-papermill BuildRequires: python3-meautility BuildRequires: python3-arbor %endif %description %_description %package -n python3-bluepyopt Summary: %{summary} # Only need to list ones not listed in setup.py %if 0%{?python3_version_nodots} >= 312 Requires: python%{python3_pkgversion}-zombie-imp %endif Requires: neuron-devel Requires: python3-neuron Requires: python3-setuptools %description -n python3-bluepyopt %_description %package -n python3-bluepyopt-doc BuildArch: noarch Summary: Documentation for bluepyopt %description -n python3-bluepyopt-doc %_description %prep %forgeautosetup -p1 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 # convert python to python3 sed -i 's/python l5pc_validate_neuron_arbor_pm.py/python3 l5pc_validate_neuron_arbor_pm.py/g' Makefile # remove neuroml test script: pyneuroml cannot be packaged for Fedora because of java issues rm -f bluepyopt/tests/test_neuroml_fcts.py # 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 -l bluepyopt %check %pyproject_check_import -e *neuroml* -e bluepyopt.tests* %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 %{py3_test_envvars} %make_build \ stochkv_prepare l5pc_prepare sc_prepare meta_prepare # test fail with a very slight approximation error # neuroml test requires pyneuroml which cannot be included in fedora because of java things k="${k-}${k+ and }not test_metaparameter" k="${k-}${k+ and }not test_NrnRampPulse_instantiate" k="${k-}${k+ and }not test_DEAPOptimisation_run" k="${k-}${k+ and }not test_DEAPOptimisation_run_from_parents" k="${k-}${k+ and }not test_optimisationsCMA_SO_run" k="${k-}${k+ and }not test_optimisationsCMA_MO_run" # This tests still fails after (fixed) `abor` has been added as BR k="${k-}${k+ and }not test_LFPySquarePulse_instantiate" # Test fails on koji; emits warning on local mock build k="${k-}${k+ and }not test_write_acc_expsyn" # Why do we run pytest twice? %{pytest} bluepyopt/tests/ -v -m "unit and not neuroml" "${k:+-k $k}" %{pytest} bluepyopt/tests/ -v -m "not unit and not neuroml" "${k:+-k $k}" # 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 ## START: Generated by rpmautospec * Fri Jul 19 2024 Fedora Release Engineering - 1.14.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Jun 14 2024 Python Maint - 1.14.11-2 - Rebuilt for Python 3.13 * Sat Apr 06 2024 Sandro - 1.14.11-1 - Update to 1.14.11 (RHBZ#2271369) - Latest release works with pytest 8 (RHBZ#2273607) - Drop Versioneer patch - Drop `zombie-imp` dependency (no longer required, RHBZ#2262408) * Tue Feb 06 2024 Sandro - 1.14.10-1 - Update to 1.14.10 (RHBZ#2257632) * Mon Feb 05 2024 Sandro - 1.14.8-4 - Run tests verbosely * Mon Feb 05 2024 Sandro - 1.14.8-3 - Revert "Re-enable test that no longer fails" * Mon Feb 05 2024 Sandro - 1.14.8-2 - Re-enable test that no longer fails * Mon Feb 05 2024 Sandro - 1.14.8-1 - Update to 1.14.8 (RHBZ#2257632) * Mon Feb 05 2024 Sandro - 1.14.6-14 - Use human friendly bcond * Mon Feb 05 2024 Sandro - 1.14.6-13 - Whitespace changes and rearrangement * Mon Feb 05 2024 Sandro - 1.14.6-12 - Standardize BRs * Fri Feb 02 2024 Karolina Surma - 1.14.6-11 - Don't BR python3-future, it's been removed since 1.14.5 * Sat Jan 27 2024 Maxwell G - 1.14.6-10 - Remove unused python3-mock test dependency * Fri Jan 26 2024 Fedora Release Engineering - 1.14.6-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 1.14.6-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Jan 02 2024 Benjamin A. Beasley - 1.14.6-7 - Assert that the .dist-info directory contains a license file * Fri Nov 17 2023 Sandro - 1.14.6-6 - Fix tests exclusion syntax * Mon Nov 13 2023 Sandro - 1.14.6-5 - Exclude ppc64le following `python-lfpy` * Tue Nov 07 2023 Sandro - 1.14.6-4 - Exclude another failing test * Tue Nov 07 2023 Sandro - 1.14.6-3 - Run arbor related tests now arbor has been fixed * Mon Nov 06 2023 Sandro - 1.14.6-2 - Add `arbor` as BR for tests * Mon Oct 23 2023 Sandro - 1.14.6-1 - Update to 1.14.6 (RHBZ#2241359) * Mon Oct 23 2023 Sandro - 1.14.3-3 - Re-enable tests now `pebble` is `>=4.6` - two tests still fail - double run of `pytest` could use some comment or fixing * Wed Oct 18 2023 Benjamin A. Beasley - 1.14.3-2 - F38+: Use %%%%{py3_test_envvars} to set up test environments * Sun Sep 10 2023 Ankur Sinha (Ankur Sinha Gmail) - 1.14.3-1 - feat: update to 1.14.3 (fixes rh#2233456) * Sat Jul 29 2023 Ankur Sinha (Ankur Sinha Gmail) - 1.14.0-2 - feat: limit tests to import checks (fixes rhbz#2220136, rhbz#2226532, rhbz#2145122) * Fri Jul 21 2023 Sandro - 1.14.0-1 - Update to 1.14.0 (RHBZ#2145122) - Remove unused patch (merged upstream) - Add patch for updating Versioneer (RHBZ#2220136) - Add patch for excluding examples/ - Update bundled _version.py * Fri Jul 21 2023 Fedora Release Engineering - 1.13.3-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Mon Feb 20 2023 Benjamin A. Beasley - 1.13.3-5 - Work around numpy.int/numpy.float deprecation * Fri Feb 03 2023 Benjamin A. Beasley - 1.13.3-4 - Leaf package on ix86: drop ix86 support * Fri Jan 20 2023 Fedora Release Engineering - 1.13.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Sun Oct 09 2022 Ankur Sinha (Ankur Sinha Gmail) - 1.13.3-2 - feat: exclude s390x * Sun Oct 09 2022 Ankur Sinha (Ankur Sinha Gmail) - 1.13.3-1 - feat: update to 1.13.3 (fixes rh#2059645) * Fri Jul 22 2022 Fedora Release Engineering - 1.11.15-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * 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 ## END: Generated by rpmautospec