#3 feat: update to 0.11.0 (fixes rhbz#2209829)
Merged 11 months ago by ankursinha. Opened 11 months ago by ankursinha.
rpms/ ankursinha/python-pynn feat/rawhide-v0.11.0  into  rawhide

file modified
+1
@@ -1,3 +1,4 @@ 

  /PyNN-0.9.6.tar.gz

  /PyNN-0.10.0.tar.gz

  /PyNN-0.10.1.tar.gz

+ /PyNN-0.11.0.tar.gz

@@ -1,94 +0,0 @@ 

- --- PyNN/setup.py.orig	2023-01-13 10:21:41.331314707 +0000

- +++ PyNN/setup.py	2023-01-13 10:21:59.655009538 +0000

- @@ -2,83 +2,9 @@

-  

-  try:

-      from setuptools import setup

- -    from setuptools.command.build_py import build_py as _build

-      tests_req = ["mpi4py", "scipy", "matplotlib", "Cheetah3", "h5py"]

-  except ImportError:

-      from distutils.core import setup

- -    from distutils.command.build_py import build_py as _build

- -

- -import os

- -import subprocess

- -

- -

- -def run_command(path, working_directory):

- -    p = subprocess.Popen(path, shell=True, stdin=subprocess.PIPE,

- -                         stdout=subprocess.PIPE, stderr=subprocess.STDOUT,

- -                         universal_newlines=True,

- -                         cwd=working_directory)

- -    stdout, stderr = p.communicate()

- -    return p.returncode, stdout.split("\n")

- -

- -

- -class build(_build):

- -    """At the end of the build process, try to compile NEURON and NEST extensions."""

- -

- -    def run(self):

- -        self.distribution.convert_2to3_doctests = []  # workaround for bug

- -        # see https://app.travis-ci.com/github/NeuralEnsemble/PyNN/jobs/582235672

- -        _build.run(self)

- -        # try to compile NEURON extensions

- -        nrnivmodl = self.find("nrnivmodl")

- -

- -        if nrnivmodl:

- -            print("nrnivmodl found at", nrnivmodl)

- -            result, stdout = run_command(nrnivmodl,

- -                                         os.path.join(os.getcwd(), self.build_lib, 'pyNN/neuron/nmodl'))

- -            # test if nrnivmodl was successful

- -            if result != 0:

- -                print("Unable to compile NEURON extensions. Output was:")

- -                print('  '.join([''] + stdout))  # indent error msg for easy comprehension

- -            else:

- -                print("Successfully compiled NEURON extensions.")

- -        else:

- -            print("Unable to find nrnivmodl. It will not be possible to use the pyNN.neuron module.")

- -        # try to compile NEST extensions

- -        nest_config = self.find("nest-config")

- -        if nest_config:

- -            print("nest-config found at", nest_config)

- -            nest_build_dir = os.path.join(os.getcwd(), self.build_lib, 'pyNN/nest/_build')

- -            if not os.path.exists(nest_build_dir):

- -                os.mkdir(nest_build_dir)

- -            result, stdout = run_command("cmake -Dwith-nest={} ../extensions".format(nest_config),

- -                                         nest_build_dir)

- -            if result != 0:

- -                print("Problem running cmake. Output was:")

- -                print('  '.join([''] + stdout))

- -            else:

- -                result, stdout = run_command("make", nest_build_dir)

- -                if result != 0:

- -                    print("Unable to compile NEST extensions. Output was:")

- -                    print('  '.join([''] + stdout))

- -                else:

- -                    # should really move this to install stage

- -                    result, stdout = run_command("make install", nest_build_dir)

- -                    if result != 0:

- -                        print("Unable to install NEST extensions. Output was:")

- -                        print('  '.join([''] + stdout))

- -                    else:

- -                        print("Successfully compiled NEST extensions.")

- -

- -    def find(self, command):

- -        """Try to find an executable file."""

- -        path = os.environ.get("PATH", "").split(os.pathsep)

- -        cmd = ''

- -        for dir_name in path:

- -            abs_name = os.path.abspath(os.path.normpath(os.path.join(dir_name, command)))

- -            if os.path.isfile(abs_name):

- -                cmd = abs_name

- -                break

- -        return cmd

-  

-  

-  setup(

- @@ -116,7 +42,6 @@

-                   'Programming Language :: Python :: 3.9',

-                   'Programming Language :: Python :: 3.10',

-                   'Topic :: Scientific/Engineering'],

- -    cmdclass={'build_py': build},

-      install_requires=['numpy>=1.18.5', 'lazyarray>=0.5.2', 'neo>=0.11.0',

-                        'quantities>=0.12.1'],

-      extras_require={

@@ -1,52 +0,0 @@ 

- From b45ef114410dd978f4198e416d0e098e8d23f870 Mon Sep 17 00:00:00 2001

- From: Andrew Davison <andrew.davison@cnrs.fr>

- Date: Tue, 23 May 2023 16:51:40 +0200

- Subject: [PATCH] update NEST extension module

- 

- ---

-  pyNN/nest/extensions/simple_stochastic_synapse.h | 6 +++---

-  pyNN/nest/extensions/stochastic_stp_synapse.h    | 2 +-

-  2 files changed, 4 insertions(+), 4 deletions(-)

- 

- diff --git a/pyNN/nest/extensions/simple_stochastic_synapse.h b/pyNN/nest/extensions/simple_stochastic_synapse.h

- index 12df525b..f98a672b 100644

- --- a/pyNN/nest/extensions/simple_stochastic_synapse.h

- +++ b/pyNN/nest/extensions/simple_stochastic_synapse.h

- @@ -81,7 +81,7 @@ class simple_stochastic_synapse : public nest::Connection< targetidentifierT >

-     * can be created.

-     *

-     * `handles_test_event()` should be added for all event types that the

- -   * synapse can transmit. The methods shall return `invalid_port_`; the

- +   * synapse can transmit. The methods shall return `invalid_port`; the

-     * return value will be ignored.

-     *

-     * Since this is a synapse model dropping spikes, it is only for spikes,

- @@ -97,13 +97,13 @@ class simple_stochastic_synapse : public nest::Connection< targetidentifierT >

-      nest::port

-      handles_test_event( nest::SpikeEvent&, nest::rport )

-      {

- -      return nest::invalid_port_;

- +      return nest::invalid_port;

-      }

-  

-      nest::port

-      handles_test_event( nest::DSSpikeEvent&, nest::rport )

-      {

- -      return nest::invalid_port_;

- +      return nest::invalid_port;

-      }

-    };

-  

- diff --git a/pyNN/nest/extensions/stochastic_stp_synapse.h b/pyNN/nest/extensions/stochastic_stp_synapse.h

- index 145de04d..c7005810 100644

- --- a/pyNN/nest/extensions/stochastic_stp_synapse.h

- +++ b/pyNN/nest/extensions/stochastic_stp_synapse.h

- @@ -113,7 +113,7 @@ class stochastic_stp_synapse : public nest::Connection< targetidentifierT >

-      nest::port

-      handles_test_event( nest::SpikeEvent&, nest::rport )

-      {

- -      return nest::invalid_port_;

- +      return nest::invalid_port;

-      }

-    };

-  

file modified
+34 -55
@@ -1,11 +1,5 @@ 

- %bcond_without mpich

- %bcond_without openmpi

- 

- # Tests

- # https://github.com/NeuralEnsemble/PyNN/blob/master/ci/test_script.sh

- # Use nose, so disabled by default, but tested locally with --with-nosetests

- # Issue filed upstream: https://github.com/NeuralEnsemble/PyNN/issues/705

- %bcond_with nosetests

+ %bcond_with mpich

+ %bcond_with openmpi

  

  # Issue filed about warnings while compiling NEURON mod files:

  # https://github.com/NeuralEnsemble/PyNN/issues/707
@@ -13,7 +7,7 @@ 

  

  # Exclude privately used libnrnmech from provides

  %global __provides_exclude ^libnrnmech\\.so.*$

- %global __requires_exclude   ^libnrnmech\\.so.*$

+ %global __requires_exclude ^libnrnmech\\.so.*$

  

  %global _description %{expand:

  PyNN (pronounced 'pine') is a simulator-independent language for building
@@ -44,7 +38,7 @@ 

  This package supports the NEURON, NEST, and Brian simulators.}

  

  Name:           python-pynn

- Version:        0.10.1

+ Version:        0.11.0

  Release:        %autorelease

  Summary:        A package for simulator-independent specification of neuronal network models

  
@@ -65,14 +59,6 @@ 

  # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval

  ExcludeArch:    mips64r2 mips32r2 s390x %{ix86}

  

- # Disable pynn's way of building extensions

- # We do it ourselves

- Patch0:         0001-Disable-nest-extension-build-by-setup.patch

- # nest-simulator 3.4 changes header definition

- # https://github.com/nest/nest-simulator/commit/5d85811af7a6aebb8de75adb3930a4a5a575f887

- # https://github.com/NeuralEnsemble/PyNN/commit/b45ef114410dd978f4198e416d0e098e8d23f870

- Patch1:         0002-update-nest-header-3_4.patch

- 

  # For extensions

  BuildRequires:  boost-devel

  BuildRequires:  cmake
@@ -81,7 +67,7 @@ 

  BuildRequires:  gsl-devel

  BuildRequires:  libneurosim-devel

  BuildRequires:  ncurses-devel

- BuildRequires:  nest-devel >= 3.0

+ BuildRequires:  nest-devel >= 3.4

  BuildRequires:  neuron-devel

  BuildRequires:  libtool-ltdl-devel

  BuildRequires:  readline-devel
@@ -93,18 +79,18 @@ 

  BuildRequires:  %{py3_dist matplotlib}

  BuildRequires:  %{py3_dist mock}

  BuildRequires:  %{py3_dist neo}

- BuildRequires:  %{py3_dist nose}

- BuildRequires:  %{py3_dist nose-testconfig}

  BuildRequires:  %{py3_dist numpy}

- BuildRequires:  python3-nest >= 3.0

- BuildRequires:  nest >= 3.0

+ BuildRequires:  python3-nest >= 3.4

+ BuildRequires:  nest >= 3.4

  BuildRequires:  python3-neuron

  BuildRequires:  %{py3_dist quantities}

  

+ BuildRequires:  %{py3_dist pytest}

+ 

  %if %{with mpich}

  BuildRequires:  python3-mpi4py-mpich

- BuildRequires:  python3-nest-mpich >= 3.0

- BuildRequires:  nest-mpich >= 3.0

+ BuildRequires:  python3-nest-mpich >= 3.4

+ BuildRequires:  nest-mpich >= 3.4

  BuildRequires:  python3-neuron-mpich

  BuildRequires:  rpm-mpi-hooks

  BuildRequires:  mpich
@@ -113,8 +99,8 @@ 

  

  %if %{with openmpi}

  BuildRequires:  python3-mpi4py-openmpi

- BuildRequires:  python3-nest-openmpi >= 3.0

- BuildRequires:  nest-openmpi >= 3.0

+ BuildRequires:  python3-nest-openmpi >= 3.4

+ BuildRequires:  nest-openmpi >= 3.4

  BuildRequires:  python3-neuron-openmpi

  BuildRequires:  rpm-mpi-hooks

  BuildRequires:  openmpi
@@ -147,13 +133,15 @@ 

  Documentation for %{name}.

  

  %prep

- %autosetup -n PyNN-%{version} -p1

+ %autosetup -n PyNN-%{version}

  rm -rfv PyNN-%{version}/pyNN.egg-info

  

+ # we install NEST libraries in standard directories, and that's where NEST expects to find extensions also

+ sed -i 's|\${NEST_LIBDIR}/nest|\${NEST_LIBDIR}|' pyNN/nest/extensions/CMakeLists.txt

+ 

  %build

  %py3_build

  

- # Build NEURON modules

  pushd ./build/lib/pyNN/neuron/nmodl/ || exit 1

      nrnivmodl .

  popd
@@ -168,14 +156,10 @@ 

      %cmake_build

  popd

  

+ 

  %install

  %py3_install

  

- # NEST extensions

- pushd ./build/lib/pyNN/nest/extensions/ || exit 1

-     %cmake_install

- popd

- 

  # Includes compiled arch specific files but installs in /lib

  # Manually move to arch specific folder

  %if "%{python3_sitelib}" != "%{python3_sitearch}"
@@ -184,30 +168,28 @@ 

  mv $RPM_BUILD_ROOT/%{python3_sitelib}/PyNN-%{version}-py%{python3_version}.egg-info $RPM_BUILD_ROOT/%{python3_sitearch}/

  %endif

  

- # Delete temporary files that do not need to be installed

- rm -rf $RPM_BUILD_ROOT/%{python3_sitearch}/pyNN/nest/extensions

+ # NEST extensions

+ pushd ./build/lib/pyNN/nest/extensions/ || exit 1

+     %cmake_install

+ popd

+ 

+ # remove temporary build files

+ rm -rf $RPM_BUILD_ROOT%{python3_sitearch}/pyNN/nest/extensions/redhat-linux-build/

+ rm -rf $RPM_BUILD_ROOT%{python3_sitearch}/pyNN/nest/_build

  

  %check

- %py3_check_import pyNN pyNN.nest pyNN.neuron pyNN.brian2

+ # skip pyNN.nest because it looks for nest extensions outside the buildroot

+ %py3_check_import pyNN pyNN.neuron pyNN.brian2

  

- %if %{with nosetests}

- pushd test

- export PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python3_sitearch}:$RPM_BUILD_ROOT/%{python3_sitelib}

- nosetests-%{python3_version} -e backends --verbosity=3 --tests=unittests

- unset PYTHONPATH

- popd

- %endif

+ %pytest test/unittests -k "not test_partitioning"

  

  %if %{with mpich}

  %{_mpich_load}

  export PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python3_sitearch}:$RPM_BUILD_ROOT/%{python3_sitelib}:$RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH:$MPI_PYTHON3_SITEARCH

  %py3_check_import pyNN pyNN.nest pyNN.neuron pyNN.brian2

  

- %if %{with nosetests}

- pushd test

- nosetests-%{python3_version} -e backends --verbosity=3 --tests=unittests

- popd

- %endif

+ %pytest test/unittests

+ 

  unset PYTHONPATH

  %{_mpich_unload}

  %endif
@@ -217,11 +199,8 @@ 

  export PYTHONPATH=$PYTHONPATH:$RPM_BUILD_ROOT/%{python3_sitearch}:$RPM_BUILD_ROOT/%{python3_sitelib}:$RPM_BUILD_ROOT/$MPI_PYTHON3_SITEARCH:$MPI_PYTHON3_SITEARCH

  %py3_check_import pyNN pyNN.nest pyNN.neuron pyNN.brian2

  

- %if %{with nosetests}

- pushd test

- nosetests-%{python3_version} -e backends --verbosity=3 --tests=unittests

- popd

- %endif

+ %pytest test/unittests

+ 

  unset PYTHONPATH

  %{_openmpi_unload}

  %endif
@@ -236,7 +215,7 @@ 

  %files -n python3-pynn

  %license LICENSE

  %doc README.rst AUTHORS changelog

- %{_libdir}/nest/

+ %{_libdir}/*pynn*so

  %{_datadir}/nest/sli/pynn_extensions-init.sli

  %{python3_sitearch}/pyNN

  %{python3_sitearch}/PyNN-%{version}-py%{python3_version}.egg-info

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (PyNN-0.10.1.tar.gz) = 292d824922c7dbf9e49810f382e54ab7fc342e559af287efaf630c676df67910815ad71684d8ca14e4ad38a28e5dcf5807764346976761d945919cdc33a1ae78

+ SHA512 (PyNN-0.11.0.tar.gz) = f867b8b7fc6204d11373095b0978b53259dfe8381de4cfe3243b645e60ecd3744c2f73b9ad2c3c24a9cc08999af40d8ff927d9c8af69bb4e0e6d7cbeb9faa4f6