diff --git a/python-netpyne.spec b/python-netpyne.spec index 0edce41..d5e6bfe 100644 --- a/python-netpyne.spec +++ b/python-netpyne.spec @@ -1,14 +1,15 @@ # No tests, they run examples for tests. # https://github.com/Neurosim-lab/netpyne/blob/development/.travis.yml -# Require optional pyneuroml, which cannot be packaged in Fedora. + +# Some tests require optional pyneuroml, which cannot be packaged in Fedora. # Refer to https://docs.fedoraproject.org/en-US/neurofedora/copr/ for more information. -# So tests are disabled +# So these tests are disabled # We add + enable the NeuroFedora COPR for pyneuroml in mock and run tests # manually -# mock -r fedora-rawhide-x86_64 rebuild --enablerepo=neurofedora-copr --with=tests +# mock -r fedora-rawhide-x86_64 rebuild --enablerepo=neurofedora-copr --with=pyneuroml -%bcond_with tests +%bcond_with pyneuroml # Missing a dep, currently disabled %bcond_with docs @@ -43,8 +44,12 @@ BuildArch: noarch %package -n python3-%{pypi_name} Summary: %{summary} +BuildRequires: gcc-g++ +BuildRequires: neuron-devel BuildRequires: python3-devel BuildRequires: python3-setuptools +BuildRequires: python3-neuron + # Docs %if %{with docs} @@ -53,20 +58,13 @@ BuildRequires: %{py3_dist sphinx} # BuildRequires: %%{py3_dist autodocsum} %endif -%if %{with tests} -BuildRequires: gcc-g++ -BuildRequires: %{py3_dist bokeh} -BuildRequires: %{py3_dist scipy} -BuildRequires: %{py3_dist future} -BuildRequires: %{py3_dist matplotlib} -BuildRequires: %{py3_dist matplotlib-scalebar} -BuildRequires: neuron-devel -BuildRequires: %{py3_dist numpy} -BuildRequires: %{py3_dist pandas} +%if %{with pyneuroml} BuildRequires: %{py3_dist pyneuroml} %endif +# Not mentioned in setup.py etc. Requires: %{py3_dist neuron} + # Optional dep in COPR, users will have to install it manually if they want to use its features # Requires: %%{py3_dist pyneuroml} @@ -80,13 +78,15 @@ Documentation for %{name}. %prep %autosetup -n %{pypi_name}-%{version} -rm -rf %{pypi_name}.egg-info # None executable script find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';' +%generate_buildrequires +%pyproject_buildrequires + %build -%py3_build +%pyproject_wheel %if %{with docs} pushd doc/ @@ -95,10 +95,13 @@ popd %endif %install -%py3_install +%pyproject_install +%pyproject_save_files netpyne %check -%if %{with tests} +# Do not test optional modules that have requirements not yet packaged in Fedora +%pyproject_check_import -e *optuna* + export PYTHONPATH=$RPM_BUILD_ROOT/%{python3_sitelib} pushd doc/source/code nrnivmodl mod @@ -112,19 +115,25 @@ popd pushd examples/HHTut %{python3} HHTut_run.py -nogui +%if %{with pyneuroml} %{python3} HHTut_export.py -nogui +%endif popd pushd examples/HybridTut nrnivmodl . %{python3} HybridTut_run.py -nogui +%if %{with pyneuroml} %{python3} HybridTut_export.py -nogui +%endif popd pushd examples/M1 nrnivmodl . %{python3} M1_run.py -nogui +%if %{with pyneuroml} %{python3} M1_export.py -nogui +%endif popd pushd examples/PTcell @@ -150,17 +159,15 @@ nrnivmodl mod %{python3} init.py -nogui popd +%if %{with pyneuroml} pushd examples/NeuroMLImport/ nrnivmodl . %{python3} SimpleNet_import.py -nogui popd %endif -%files -n python3-%{pypi_name} -%license LICENSE +%files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.md CHANGES.md -%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info -%{python3_sitelib}/%{pypi_name} %if %{with docs} %files doc