diff options
author | Fabian Affolter <fabian@affolter-engineering.ch> | 2024-04-23 13:14:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-23 13:14:36 +0200 |
commit | 51dfb8a9c7a9464b20ccf04fe81cb0d0171ef463 (patch) | |
tree | c1563dfecfe72ac503de9ec901bb3d509a1056d7 /pkgs/development | |
parent | f505639614c71d3dee7dc9713d6b02a3f294f24e (diff) | |
parent | f747fb392392211fbecec1b28078e609002dcfc8 (diff) |
Merge pull request #306196 from fabaff/timecop-refactor
python312Packages.timecop: refactor, python312Packages.onetimepass: refactor
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/python-modules/onetimepass/default.nix | 29 | ||||
-rw-r--r-- | pkgs/development/python-modules/timecop/default.nix | 21 |
2 files changed, 39 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/onetimepass/default.nix b/pkgs/development/python-modules/onetimepass/default.nix index 3bea443a36f23..dde4983c2afea 100644 --- a/pkgs/development/python-modules/onetimepass/default.nix +++ b/pkgs/development/python-modules/onetimepass/default.nix @@ -1,23 +1,35 @@ -{ lib, buildPythonPackage, fetchFromGitHub, six, timecop }: +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + setuptools, + six, + timecop, + unittestCheckHook, +}: buildPythonPackage rec { pname = "onetimepass"; version = "1.0.1"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "tadeck"; - repo = pname; - rev = "v${version}"; - sha256 = "0wmv62l3r8r4428gdzyj80lhgadfqvj220khz1wnm9alyzg60wkh"; + repo = "onetimepass"; + rev = "refs/tags/v${version}"; + hash = "sha256-cHJg3vdUpWp5+HACIeTGrqkHKUDS//aQICSjPKgwu3I="; }; - propagatedBuildInputs = [ - six - ]; + build-system = [ setuptools ]; + + dependencies = [ six ]; nativeCheckInputs = [ timecop + unittestCheckHook ]; pythonImportsCheck = [ "onetimepass" ]; @@ -25,6 +37,7 @@ buildPythonPackage rec { meta = with lib; { description = "One-time password library for HMAC-based (HOTP) and time-based (TOTP) passwords"; homepage = "https://github.com/tadeck/onetimepass"; + changelog = "https://github.com/tadeck/onetimepass/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ zakame ]; }; diff --git a/pkgs/development/python-modules/timecop/default.nix b/pkgs/development/python-modules/timecop/default.nix index fb455d079b0e4..443b609fb4c4f 100644 --- a/pkgs/development/python-modules/timecop/default.nix +++ b/pkgs/development/python-modules/timecop/default.nix @@ -1,20 +1,35 @@ -{ lib, buildPythonPackage, fetchPypi }: +{ + lib, + buildPythonPackage, + fetchPypi, + pythonOlder, + setuptools, + unittestCheckHook, +}: buildPythonPackage rec { pname = "timecop"; version = "0.5.0dev"; - format = "setuptools"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "0zbi58sw2yp1qchzfhyi7bsrwxajiypphg65fir98kvj03g011wd"; + hash = "sha256-jYcA3gByT5RydMU8eK+PUnWe9TrRQ/chw+F6wTUqcX0="; }; + build-system = [ setuptools ]; + + nativeCheckInputs = [ unittestCheckHook ]; + # test_epoch fails, see https://github.com/bluekelp/pytimecop/issues/4 preCheck = '' sed -i 's/test_epoch/_test_epoch/' timecop/tests/test_freeze.py ''; + pythonImportsCheck = [ "timecop" ]; + meta = with lib; { description = "A port of the most excellent TimeCop Ruby Gem for Python"; homepage = "https://github.com/bluekelp/pytimecop"; |