# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class PyMock(PythonPackage):
    """mock is a library for testing in Python. It allows you to replace parts
    of your system under test with mock objects and make assertions about how
    they have been used."""

    homepage = "https://github.com/testing-cabal/mock"
    pypi = "mock/mock-3.0.5.tar.gz"

    version('3.0.5', sha256='83657d894c90d5681d62155c82bda9c1187827525880eda8ff5df4ec813437c3')
    version('2.0.0', sha256='b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba')
    version('1.3.0', sha256='1e247dbecc6ce057299eb7ee019ad68314bb93152e81d9a6110d35f4d5eca0f6')

    depends_on('python@2.7:2.8,3.4:', type=('build', 'run'))
    depends_on('py-setuptools', type='build')
    depends_on('py-six@1.7:', type=('build', 'run'))
    depends_on('py-six@1.9:', type=('build', 'run'), when='@2.0.0:')
    depends_on('py-funcsigs@1:', type=('build', 'run'), when='^python@:3.2')

@@ -505,21 +505,21 @@
 ck/mock-
-3.0.5
+4.0.3
 .tar.gz%22
@@ -520,16 +520,112 @@
 ar.gz%22%0A%0A
+    version('4.0.3', sha256='7d3fbbde18228f4ff2f1f119a45cdffa458b4c0dee32eb4d2bb2f82554bac7bc')%0A
     vers
@@ -905,16 +905,88 @@
 a0f6')%0A%0A
+    depends_on('python@3.6:',         type=('build', 'run'), when='@3')%0A
     depe
@@ -1028,32 +1028,44 @@
 ('build', 'run')
+, when='@:2'
 )%0A    depends_on
@@ -1079,16 +1079,22 @@
 tuptools
+@17.1:
 ', type=
@@ -1125,18 +1125,26 @@
 'py-
-six@1.7
+pbr@1.3
 :',
+        
  typ
@@ -1153,24 +1153,36 @@
 ('build'
+)
 , 
-'run')
+       when='@:2'
 )%0A    de
@@ -1204,16 +1204,24 @@
 x@1.9:',
+        
  type=('
@@ -1247,14 +1247,10 @@
 n='@
-2.0.0
 :
+2
 ')%0A 

fix depends of `@:2.0.0` and bump version (#26336)