{ lib, buildPythonPackage, fetchPypi
, cryptography, ecdsa
, pytestrunner, pytestcov, pytest_37 }:

buildPythonPackage rec {
  pname = "PyJWT";
  version = "1.6.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "4ee413b357d53fd3fb44704577afac88e72e878716116270d722723d65b42176";
  };

  propagatedBuildInputs = [ cryptography ecdsa ];

  checkInputs = [ pytestrunner pytestcov pytest_37 ];

  # pytest 3.9.0 changed behavior of deprecated_call, see release notes
  postPatch = ''
    for x in tests/test_api_*py; do
      substituteInPlace "$x" --replace AssertionError pytest.fail.Exception
    done
  '';

  meta = with lib; {
    description = "JSON Web Token implementation in Python";
    homepage = https://github.com/jpadilla/pyjwt;
    license = licenses.mit;
    maintainers = with maintainers; [ prikhi ];
  };
}

{ lib, buildPythonPackage, fetchPypi
, cryptography, ecdsa
, pytestrunner, pytestcov, pytest }:

buildPythonPackage rec {
  pname = "PyJWT";
  version = "1.6.4";

  src = fetchPypi {
    inherit pname version;
    sha256 = "4ee413b357d53fd3fb44704577afac88e72e878716116270d722723d65b42176";
  };

  propagatedBuildInputs = [ cryptography ecdsa ];

  checkInputs = [ pytestrunner pytestcov pytest ];

  # pytest 3.9.0 changed behavior of deprecated_call, see release notes
  postPatch = ''
    for x in tests/test_api_*py; do
      substituteInPlace "$x" --replace AssertionError pytest.fail.Exception
    done
  '';

  meta = with lib; {
    description = "JSON Web Token implementation in Python";
    homepage = https://github.com/jpadilla/pyjwt;
    license = licenses.mit;
    maintainers = with maintainers; [ prikhi ];
  };
}

Revert "python: pyjwt: fix build"
Revert "python: pyjwt: fix build"

This reverts commit bcf736b325cbc577ed083995366396656e93e96c.

28cdb6e841b9098517c2a7957454437387ca887d fixed the issue with pytest-3.9.0.
