1a04744f74
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
setuptools,
|
|
pytestCheckHook,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "frozendict";
|
|
version = "2.4.7";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Marco-Sulla";
|
|
repo = "python-frozendict";
|
|
tag = "v${version}";
|
|
hash = "sha256-ehx8X3jbKls/DVgCzWJ+nTX+m/Cdknnu/sjrAMxnJFo=";
|
|
};
|
|
|
|
# build C version if it exists
|
|
preBuild = ''
|
|
version_str=$(python -c 'import sys; print("_".join(map(str, sys.version_info[:2])))')
|
|
if test -f src/frozendict/c_src/$version_str/frozendictobject.c; then
|
|
export CIBUILDWHEEL=1
|
|
export FROZENDICT_PURE_PY=0
|
|
else
|
|
export CIBUILDWHEEL=0
|
|
export FROZENDICT_PURE_PY=1
|
|
fi
|
|
'';
|
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
|
|
|
pythonImportsCheck = [ "frozendict" ];
|
|
|
|
meta = {
|
|
description = "Module for immutable dictionary";
|
|
homepage = "https://github.com/Marco-Sulla/python-frozendict";
|
|
changelog = "https://github.com/Marco-Sulla/python-frozendict/releases/tag/v${version}";
|
|
license = lib.licenses.lgpl3Only;
|
|
maintainers = with lib.maintainers; [ pbsds ];
|
|
};
|
|
}
|