Unverified Commit 1fb03d03 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

Merge pull request #336963 from onny/datemath-update

python3Packages.python-datemath: 1.5.5 -> 3.0.1
parents d5fd8a7c 01eaff8d
Loading
Loading
Loading
Loading
+20 −18
Original line number Diff line number Diff line
@@ -4,44 +4,46 @@
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  pythonOlder,
  freezegun,
  pytestCheckHook,
  pythonOlder,
  pytz,
  setuptools,
}:

buildPythonPackage rec {
  pname = "python-datemath";
  version = "1.5.5";
  format = "setuptools";
  version = "3.0.1";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "nickmaccarthy";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-WVWGhyBguE1+KEMQu0N5QxO7IC4rPEJ/2L3VWUCQNi4=";
    repo = "python-datemath";
    rev = "refs/tags/v${version}";
    hash = "sha256-BL+F2oHM49QiwV1/rjXz3wLp+EaTfmc5tAdlsGKq8ag=";
  };

  patches = [
    (fetchpatch {
      name = "remove-unittest2.patch";
      url = "https://github.com/nickmaccarthy/python-datemath/commit/781daa0241ed327d5f211f3b62f553f3ee3d86e0.patch";
      hash = "sha256-WD6fuDaSSNXgYWoaUexiWnofCzEZzercEUlqTvOUT5I=";
    })
  ];
  build-system = [ setuptools ];

  propagatedBuildInputs = [ arrow ];
  dependencies = [ arrow ];

  nativeCheckInputs = [ pytestCheckHook ];
  nativeCheckInputs = [
    freezegun
    pytestCheckHook
    pytz
  ];

  pytestFlagsArray = [ "tests.py" ];

  pythonImportsCheck = [ "datemath" ];

  meta = with lib; {
  meta = {
    description = "Python module to emulate the date math used in SOLR and Elasticsearch";
    homepage = "https://github.com/nickmaccarthy/python-datemath";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ fab ];
    changelog = "https://github.com/nickmaccarthy/python-datemath/blob/v${version}/CHANGELOG.md";
    license = with lib.licenses; [ asl20 ];
    maintainers = with lib.maintainers; [ fab ];
  };
}