The source hash changes because they use `$Format:%d$` in their code, and GitHub can substitute this with different things in different times, see https://github.com/NixOS/nixpkgs/issues/84312. In this case, the diff looks like this: ``` diff -ur /nix/store/v2yfg05q83i154bdi2s96g21zi079rgi-source/msgspec/_version.py /nix/store/94zddrfms1ikx61i0plxnqdd3gavfdzr-source/msgspec/_version.py --- /nix/store/v2yfg05q83i154bdi2s96g21zi079rgi-source/msgspec/_version.py 1970-01-01 00:00:01.000000000 +0000 +++ /nix/store/94zddrfms1ikx61i0plxnqdd3gavfdzr-source/msgspec/_version.py 1970-01-01 00:00:01.000000000 +0000 @@ -24,7 +24,7 @@ # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = " (HEAD -> main, tag: 0.19.0)" + git_refnames = " (tag: 0.19.0)" git_full = "dd965dce22e5278d4935bea923441ecde31b5325" git_date = "2024-12-27 11:06:58 -0600" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} ``` Fix the hash and add a comment explaining the situation.
42 lines
1.0 KiB
Nix
42 lines
1.0 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
pythonOlder,
|
|
setuptools,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "msgspec";
|
|
version = "0.19.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jcrist";
|
|
repo = "msgspec";
|
|
tag = version;
|
|
# Note that this hash changes after some time after release because they
|
|
# use `$Format:%d$` in msgspec/_version.py, and GitHub produces different
|
|
# tarballs depending on whether tagged commit is the last commit, see
|
|
# https://github.com/NixOS/nixpkgs/issues/84312
|
|
hash = "sha256-CajdPNAkssriY/sie5gR+4k31b3Wd7WzqcsFmrlSoPY=";
|
|
};
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
# Requires libasan to be accessible
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "msgspec" ];
|
|
|
|
meta = with lib; {
|
|
description = "Module to handle JSON/MessagePack";
|
|
homepage = "https://github.com/jcrist/msgspec";
|
|
changelog = "https://github.com/jcrist/msgspec/releases/tag/${version}";
|
|
license = licenses.bsd3;
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|