Merge pull request #306196 from fabaff/timecop-refactor

python312Packages.timecop: refactor, python312Packages.onetimepass: refactor
This commit is contained in:
Fabian Affolter 2024-04-23 13:14:36 +02:00 committed by GitHub
commit 51dfb8a9c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 61 additions and 33 deletions

View File

@ -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 ];
};

View File

@ -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";

View File

@ -1,17 +1,29 @@
{ lib, python3Packages, fetchFromGitHub }:
{
lib,
fetchFromGitHub,
python3,
}:
python3Packages.buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
pname = "awslimitchecker";
version = "12.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "jantman";
repo = "awslimitchecker";
rev = version;
sha256 = "1p6n4kziyl6sfq7vgga9v88ddwh3sgnfb1m1cx6q25n0wyl7phgv";
rev = "refs/tags/${version}";
hash = "sha256-+8F7qOfAFoFNZ6GG5ezTA/LWENpJvbcPdtpQH/8k1tw=";
};
propagatedBuildInputs = with python3Packages; [
patches = [
# Fix the version lookup to use only the hardcoded version in the source package
./version.patch
];
build-system = with python3.pkgs; [ setuptools ];
dependencies = with python3.pkgs; [
boto3
botocore
pytz
@ -19,27 +31,15 @@ python3Packages.buildPythonApplication rec {
versionfinder
];
nativeCheckInputs = with python3Packages; [
nativeCheckInputs = with python3.pkgs; [
freezegun
onetimepass
pytestCheckHook
pyotp
mock
(pytestCheckHook.override { pytest = pytest_7; })
testfixtures
];
patches = [
# Fix the version lookup to use only the hardcoded version in the source package
./version.patch
];
pytestFlagsArray = [
"awslimitchecker/tests"
# Upstream did not adapt to pytest 8 yet.
"-W"
"ignore::pytest.PytestRemovedIn8Warning"
];
disabledTestPaths = [
# AWS tests that use the network
"awslimitchecker/tests/services"
@ -53,11 +53,11 @@ python3Packages.buildPythonApplication rec {
pythonImportsCheck = [ "awslimitchecker.checker" ];
meta = with lib; {
description = "A script and python package to check your AWS service limits and usage via boto3";
homepage = "http://awslimitchecker.readthedocs.org";
changelog = "https://github.com/jantman/awslimitchecker/blob/${version}/CHANGES.rst";
description = "A script and python package to check your AWS service limits and usage via boto3";
mainProgram = "awslimitchecker";
license = licenses.agpl3Plus;
maintainers = with maintainers; [ zakame ];
mainProgram = "awslimitchecker";
};
}