diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..092259c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/libNeuroML-0.2.45.tar.gz diff --git a/libNeuroML-0.2.45-disable-mongodb-test.patch b/libNeuroML-0.2.45-disable-mongodb-test.patch new file mode 100644 index 0000000..7d4f0c1 --- /dev/null +++ b/libNeuroML-0.2.45-disable-mongodb-test.patch @@ -0,0 +1,19 @@ +diff -ur libNeuroML-0.2.45.orig/neuroml/test/test_writers.py libNeuroML-0.2.45/neuroml/test/test_writers.py +--- libNeuroML-0.2.45.orig/neuroml/test/test_writers.py 2018-10-25 19:16:24.810033738 +0100 ++++ libNeuroML-0.2.45/neuroml/test/test_writers.py 2018-10-25 19:20:13.278585079 +0100 +@@ -68,6 +68,7 @@ + self.test_doc.cells.append(self.cell_3) + self.test_doc.cells.append(neuroml_cell) + ++ @unittest.skip("Skipping mongodb test") + def test_write_to_mongodb_backend(self): + writer_method = neuroml.writers.JSONWriter.write_to_mongodb + +@@ -77,6 +78,7 @@ + except: + self.fail("Exception raised!") + ++ @unittest.skip("Skipping mongodb test") + def test_write_to_mongodb_expected(self): + """ + More of an integration test, write a file and confirm the contents are diff --git a/python-libNeuroML.spec b/python-libNeuroML.spec new file mode 100644 index 0000000..46765aa --- /dev/null +++ b/python-libNeuroML.spec @@ -0,0 +1,151 @@ +%global srcname libNeuroML + +%global with_py2 1 + +%global _description \ +This package provides Python libNeuroML, for working with neuronal models \ +specified in NeuroML 2 (http://neuroml.org/neuromlv2). NeuroML provides an \ +object model for describing neuronal morphologies, ion channels, synapses and \ +3D network structure. Documentation is available at \ +http://readthedocs.org/docs/libneuroml/en/latest/ + + +Name: python-%{srcname} +Version: 0.2.45 +Release: 4%{?dist} +Summary: Python libNeuroML for working with neuronal models specified in NeuroML + +License: BSD +URL: https://pypi.python.org/pypi/%{srcname} +Source0: %{pypi_source} +# These require a mongodb db set up, so we disable them +Patch0: %{srcname}-%{version}-disable-mongodb-test.patch + +BuildArch: noarch + +%description +%{_description} + +%package -n python3-%{srcname} +Summary: %{summary} +BuildRequires: python3-devel +BuildRequires: %{py3_dist lxml} +BuildRequires: %{py3_dist nose} +BuildRequires: %{py3_dist numpy} +BuildRequires: %{py3_dist tables} +BuildRequires: %{py3_dist jsonpickle} +BuildRequires: %{py3_dist pymongo} +BuildRequires: %{py3_dist sphinx} +Requires: %{py3_dist lxml} +Requires: %{py3_dist numpy} +Requires: %{py3_dist tables} +Requires: %{py3_dist jsonpickle} +Requires: %{py3_dist pymongo} +%{?python_provide:%python_provide python3-%{srcname}} + +%description -n python3-%{srcname} +%{_description} + +%package doc +Summary: Documentation for %{srcname} + +%description doc +%{_description} + +%if %{with_py2} +%package -n python2-%{srcname} +Summary: %{summary} +BuildRequires: python2-devel +BuildRequires: %{py2_dist lxml} +BuildRequires: %{py2_dist nose} +BuildRequires: %{py2_dist numpy} +BuildRequires: %{py2_dist tables} +BuildRequires: %{py2_dist jsonpickle} +BuildRequires: %{py2_dist pymongo} +Requires: %{py2_dist lxml} +Requires: %{py2_dist numpy} +Requires: %{py2_dist tables} +Requires: %{py2_dist jsonpickle} +Requires: %{py2_dist pymongo} +%{?python_provide:%python_provide python2-%{srcname}} + +%description -n python2-%{srcname} +%{_description} +%endif + +%prep +%autosetup -p 1 -n %{srcname}-%{version} + +# correct end of line encoding +sed -i 's/\r$//' neuroml/examples/test_files/tmp2.swc + +# remove shebang +sed -i '1d' neuroml/nml/nml.py + +# remove egg info +rm -fv %{name}.egg-info + +%build +%py3_build + +%if %{with_py2} +%py2_build +%endif + +# Make documentation +pushd doc && \ + make html SPHINXBUILD=sphinx-build-3 && \ + rm _build/html/.buildinfo -fv && \ +popd || exit -1 + +%install +%py3_install + +%if %{with_py2} +%py2_install +%endif + +%check +nosetests-3 + +%if %{with_py2} +nosetests-2 +%endif + +%files -n python3-%{srcname} +%license LICENSE +%doc README.md AUTHORS +%{python3_sitelib}/%{srcname}-*.egg-info/ +%{python3_sitelib}/neuroml + +%files doc +%license LICENSE +%doc README.md AUTHORS +%doc neuroml/examples doc/_build/html/ + +%if %{with_py2} +%files -n python2-%{srcname} +%license LICENSE +%doc README.md AUTHORS +%{python2_sitelib}/%{srcname}-*.egg-info/ +%{python2_sitelib}/neuroml +%endif + +%changelog +* Fri Oct 26 2018 Ankur Sinha - 0.2.45-4 +- Correct license +- Remove bcond +- Remove hidden buildinfo file +- Correct end of line encoding +- Remove unneeded shebang (https://github.com/NeuralEnsemble/libNeuroML/issues/77) +- Add missing requires + +* Thu Oct 25 2018 Ankur Sinha - 0.2.45-3 +- Correct doc build +- Temporarily use bcond + +* Thu Oct 25 2018 Ankur Sinha - 0.2.45-2 +- Correct doc sub package name + +* Thu Oct 25 2018 Ankur Sinha - 0.2.45-1 +- Initial build diff --git a/sources b/sources new file mode 100644 index 0000000..7a70b2f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (libNeuroML-0.2.45.tar.gz) = 5703f5c9cca48c684fecf64390c864bd0cfd7adc9dd3ee9288ac262c3bf4fbe5ce4aff5aa02b8717752c135b9c5484eb60c0b0b7015c1dc918d2fafb4aaab7fb