From debdc91d5c08fffd951d8ba9b95f017bafe908de Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Sat, 24 Aug 2024 09:04:42 +0200 Subject: [PATCH 1/2] python3Packages.python-datemath: 1.5.5 -> 3.0.1 --- .../python-datemath/default.nix | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/python-datemath/default.nix b/pkgs/development/python-modules/python-datemath/default.nix index 4c2215602fff..dbe968a8f01f 100644 --- a/pkgs/development/python-modules/python-datemath/default.nix +++ b/pkgs/development/python-modules/python-datemath/default.nix @@ -6,11 +6,13 @@ fetchpatch, pythonOlder, pytestCheckHook, + freezegun, + pytz, }: buildPythonPackage rec { pname = "python-datemath"; - version = "1.5.5"; + version = "3.0.1"; format = "setuptools"; disabled = pythonOlder "3.8"; @@ -18,30 +20,28 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "nickmaccarthy"; repo = pname; - rev = "v${version}"; - hash = "sha256-WVWGhyBguE1+KEMQu0N5QxO7IC4rPEJ/2L3VWUCQNi4="; + 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="; - }) - ]; - - propagatedBuildInputs = [ arrow ]; + dependencies = [ arrow ]; nativeCheckInputs = [ pytestCheckHook ]; + checkInputs = [ + freezegun + 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 ]; }; } From 01eaff8de4f30fcc1f781cad0d53fe35ee0d1feb Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 26 Aug 2024 11:10:54 +0200 Subject: [PATCH 2/2] python312Packages.python-datemath: refactor --- .../python-modules/python-datemath/default.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/python-datemath/default.nix b/pkgs/development/python-modules/python-datemath/default.nix index dbe968a8f01f..44b05d8fa72d 100644 --- a/pkgs/development/python-modules/python-datemath/default.nix +++ b/pkgs/development/python-modules/python-datemath/default.nix @@ -4,32 +4,34 @@ buildPythonPackage, fetchFromGitHub, fetchpatch, - pythonOlder, - pytestCheckHook, freezegun, + pytestCheckHook, + pythonOlder, pytz, + setuptools, }: buildPythonPackage rec { pname = "python-datemath"; version = "3.0.1"; - format = "setuptools"; + pyproject = true; disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "nickmaccarthy"; - repo = pname; + repo = "python-datemath"; rev = "refs/tags/v${version}"; hash = "sha256-BL+F2oHM49QiwV1/rjXz3wLp+EaTfmc5tAdlsGKq8ag="; }; + build-system = [ setuptools ]; + dependencies = [ arrow ]; - nativeCheckInputs = [ pytestCheckHook ]; - - checkInputs = [ + nativeCheckInputs = [ freezegun + pytestCheckHook pytz ]; @@ -40,7 +42,7 @@ buildPythonPackage rec { meta = { description = "Python module to emulate the date math used in SOLR and Elasticsearch"; homepage = "https://github.com/nickmaccarthy/python-datemath"; - changelog = "https://github.com/nickmaccarthy/python-datemath/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/nickmaccarthy/python-datemath/blob/v${version}/CHANGELOG.md"; license = with lib.licenses; [ asl20 ]; maintainers = with lib.maintainers; [ fab ]; };