Skip to content

Commit

Permalink
Merge pull request #270590 from a-n-n-a-l-e-e/gentools-pyproject
Browse files Browse the repository at this point in the history
python311Packages.gentools: switch to pyproject; fix build
  • Loading branch information
fabaff authored Nov 28, 2023
2 parents 4c15843 + f3c4490 commit be5c9c1
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions pkgs/development/python-modules/gentools/default.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
{ buildPythonPackage, lib, fetchFromGitHub, pytest
, typing ? null, funcsigs ? null, pythonOlder
{ lib
, buildPythonPackage
, fetchFromGitHub
, importlib-metadata
, poetry-core
, pytestCheckHook
, pythonOlder
}:

buildPythonPackage rec {
pname = "gentools";
version = "1.2.1";
pyproject = true;

disabled = pythonOlder "3.7";

# Pypi doesn't ship the tests, so we fetch directly from GitHub
src = fetchFromGitHub {
owner = "ariebovenberg";
repo = pname;
repo = "gentools";
rev = "refs/tags/v${version}";
sha256 = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8=";
hash = "sha256-RBUIji3FOIRjfp4t7zBAVSeiWaYufz4ID8nTWmhDkf8=";
};

propagatedBuildInputs =
lib.optionals (pythonOlder "3.5") [ typing ] ++
lib.optionals (pythonOlder "3.4") [ funcsigs ];
nativeBuildInputs = [
poetry-core
];

propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [
importlib-metadata
];

nativeCheckInputs = [
pytestCheckHook
];

nativeCheckInputs = [ pytest ];
checkPhase = "pytest";
pythonImportCheck = [
"gentools"
];

meta = with lib; {
description = "Tools for generators, generator functions, and generator-based coroutines";
license = licenses.mit;
homepage = "https://gentools.readthedocs.io/";
changelog = "https://github.com/ariebovenberg/gentools/blob/v${version}/CHANGELOG.rst";
license = licenses.mit;
maintainers = with maintainers; [ mredaelli ];
};

}

0 comments on commit be5c9c1

Please sign in to comment.