[med-svn] [Git][med-team/pynn][master] patch-out usage of python3-mock

Alexandre Detiste (@detiste-guest) gitlab at salsa.debian.org
Sun Jan 7 15:40:25 GMT 2024



Alexandre Detiste pushed to branch master at Debian Med / pynn


Commits:
173b264e by Alexandre Detiste at 2024-01-07T16:39:54+01:00
patch-out usage of python3-mock

- - - - -


3 changed files:

- debian/control
- + debian/patches/remove-python3-mock.patch
- + debian/patches/series


Changes:

=====================================
debian/control
=====================================
@@ -11,7 +11,6 @@ Build-Depends: debhelper-compat (= 13),
                python3-all,
                python3-numpy,
                python3-pytest <!nocheck>,
-               python3-mock <!nocheck>,
                python3-cheetah <!nocheck>,
                python3-jinja2 <!nocheck>,
                python3-neuron <!nocheck>,


=====================================
debian/patches/remove-python3-mock.patch
=====================================
@@ -0,0 +1,146 @@
+From 9e0db7b69733e91750c17aef4a681fd1843ae5f3 Mon Sep 17 00:00:00 2001
+From: Alexandre Detiste <alexandre.detiste at gmail.com>
+Date: Sun, 7 Jan 2024 16:36:42 +0100
+Subject: [PATCH] remove references to old Python2 'mock'
+Forwarded: https://github.com/NeuralEnsemble/PyNN/pull/792
+
+--- a/doc/conf.py
++++ b/doc/conf.py
+@@ -16,7 +16,7 @@
+ 
+ 
+ if True:  # mock NEURON
+-    import mock
++    import unittest.mock as mock
+     # mocks are only wanted when building docs, not when running doctests
+     # is there any way to use them selectively, like this?
+     # also, the matplotlib figures need the real modules.
+@@ -30,7 +30,7 @@
+     sys.modules["neuron"] = MockNeuronModule()
+ 
+ if False:  # mock NEST
+-    import mock
++    import unittest.mock as mock
+ 
+     class MockNESTModule(mock.Mock):
+         GetKernelStatus = lambda self: {'num_processes': 1}
+--- a/requirements.txt
++++ b/requirements.txt
+@@ -1,6 +1,5 @@
+ Jinja2>=2.6
+ docutils>=0.10
+-mock>1.0
+ numpy>=1.18.5,<1.24
+ quantities>=0.12.1
+ lazyarray>=0.5.2
+--- a/test/unittests/test_assembly.py
++++ b/test/unittests/test_assembly.py
+@@ -11,10 +11,7 @@
+ import sys
+ import quantities as pq
+ from numpy.testing import assert_array_equal, assert_array_almost_equal
+-try:
+-    from unittest.mock import Mock, patch
+-except ImportError:
+-    from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from .mocks import MockRNG
+ import pyNN.mock as sim
+ from pyNN.parameters import Sequence
+--- a/test/unittests/test_descriptions.py
++++ b/test/unittests/test_descriptions.py
+@@ -2,10 +2,7 @@
+ 
+ from pyNN import common, errors, random, standardmodels, space, descriptions
+ import numpy as np
+-try:
+-    from unittest.mock import Mock
+-except ImportError:
+-    from mock import Mock
++from unittest.mock import Mock
+ import os.path
+ 
+ 
+--- a/test/unittests/test_lowlevelapi.py
++++ b/test/unittests/test_lowlevelapi.py
+@@ -1,9 +1,6 @@
+ from pyNN import common
+ from pyNN.common.populations import BasePopulation
+-try:
+-    from unittest.mock import Mock
+-except ImportError:
+-    from mock import Mock
++from unittest.mock import Mock
+ from inspect import isfunction
+ 
+ 
+--- a/test/unittests/test_neuron.py
++++ b/test/unittests/test_neuron.py
+@@ -1,10 +1,7 @@
+ # encoding: utf-8
+ 
+ import os
+-try:
+-    from unittest.mock import Mock
+-except ImportError:
+-    from mock import Mock
++from unittest.mock import Mock
+ try:
+     from neuron import h
+     import pyNN.neuron as sim
+--- a/test/unittests/test_population.py
++++ b/test/unittests/test_population.py
+@@ -11,10 +11,7 @@
+ import sys
+ from numpy.testing import assert_array_equal, assert_array_almost_equal
+ import quantities as pq
+-try:
+-    from unittest.mock import Mock, patch
+-except ImportError:
+-    from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from .mocks import MockRNG
+ import pyNN.mock as sim
+ from pyNN import random, errors, space
+--- a/test/unittests/test_populationview.py
++++ b/test/unittests/test_populationview.py
+@@ -11,10 +11,7 @@
+ import sys
+ from numpy.testing import assert_array_equal, assert_array_almost_equal
+ import quantities as pq
+-try:
+-    from unittest.mock import Mock, patch
+-except ImportError:
+-    from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from .mocks import MockRNG
+ import pyNN.mock as sim
+ from pyNN import random, errors, space
+--- a/test/unittests/test_projection.py
++++ b/test/unittests/test_projection.py
+@@ -12,10 +12,7 @@
+ import sys
+ from numpy.testing import assert_array_equal
+ 
+-try:
+-    from unittest.mock import Mock, patch
+-except ImportError:
+-    from mock import Mock, patch
++from unittest.mock import Mock, patch
+ from .mocks import MockRNG
+ import pyNN.mock as sim
+ 
+--- a/test/unittests/test_standardmodels.py
++++ b/test/unittests/test_standardmodels.py
+@@ -3,10 +3,7 @@
+ from pyNN.standardmodels.synapses import StaticSynapse, STDPMechanism
+ from pyNN import errors
+ from pyNN.parameters import ParameterSpace
+-try:
+-    from unittest.mock import Mock
+-except ImportError:
+-    from mock import Mock
++from unittest.mock import Mock
+ import pytest
+ import numpy as np
+ 


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+remove-python3-mock.patch



View it on GitLab: https://salsa.debian.org/med-team/pynn/-/commit/173b264e75dd7cb93c84975dae4fbb1a8e33a250

-- 
View it on GitLab: https://salsa.debian.org/med-team/pynn/-/commit/173b264e75dd7cb93c84975dae4fbb1a8e33a250
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240107/59a88ce7/attachment-0001.htm>


More information about the debian-med-commit mailing list