Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.expiringdict: Python 3.12 compatibility #326665

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions pkgs/development/python-modules/expiringdict/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
dill,
coverage,
coveralls,
mock,
nose,
pytestCheckHook,
setuptools
}:

buildPythonPackage rec {
pname = "expiringdict";
version = "1.2.2";
format = "setuptools";
pyproject = true;

# use fetchFromGitHub instead of fetchPypi because the test suite of
# the package is not included into the PyPI tarball
Expand All @@ -23,20 +23,28 @@ buildPythonPackage rec {
hash = "sha256-vRhJSHIqc51I+s/wndtfANM44CKW3QS1iajqyoSBf0I=";
};

patches = [
# apply mailgun/expiringdict#49 to address NixOS/nixpkgs#326513
(fetchpatch2 {
url = "https://github.com/mailgun/expiringdict/commit/1c0f82232d20f8b3b31c9269a4d0e9510c1721a6.patch";
hash = "sha256-IeeJVb2tOwRhEPNGqM30fNZyz3jFcnZNWC3I6K1+hSY=";
})

# apply mailgun/expiringdict#56 for compatibility with Python 3.12
(fetchpatch2 {
url = "https://github.com/mailgun/expiringdict/commit/976faf3664d54049e443aca054f5819db834577b.patch";
hash = "sha256-FNdnU6iUMyED5j8oAjhmJTR7zQeEc/Z5s64pdeT4F8w=";
})
];

build-system = [ setuptools ];

nativeCheckInputs = [
dill
coverage
coveralls
mock
nose
pytestCheckHook
];

checkPhase = ''
runHook preCheck
nosetests -v --with-coverage --cover-package=expiringdict
runHook postCheck
'';

pythonImportsCheck = [ "expiringdict" ];

meta = with lib; {
Expand Down