Files
André Schröder b112b109af python3Packages.icalendar: fix build failure for python3.12
Error message:

```
Executing pythonRuntimeDepsCheck
Checking runtime dependencies for icalendar-7.2.0-py3-none-any.whl
  - typing-extensions not installed
```

MWE flake.nix:

```
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/0bb7ec54c8483066ec9d7720e780a5caa71f8612";

  outputs = { nixpkgs, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs { inherit system; };
    in {
      packages.${system} = {
        python312 = pkgs.python312Packages.icalendar;
        python312-fixed = pkgs.python312Packages.icalendar.overridePythonAttrs (old: {
          dependencies = old.dependencies ++ [ pkgs.python312Packages.typing-extensions ];
        });
        python313 = pkgs.python313Packages.icalendar;
        python314 = pkgs.python314Packages.icalendar;
      };
    };
}
```

Build it:

```
for package in python312 python312-fixed python313 python314; do
  if nix build --no-link ".#$package" >/dev/null 2>&1; then
    echo "$package: success"
  else
    echo "$package: failure"
  fi
done
```

Which prints:

```
python312: failure
python312-fixed: success
python313: success
python314: success
```
2026-07-10 19:13:23 +02:00

69 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
replaceVars,
pythonOlder,
hatch-vcs,
hatchling,
python-dateutil,
typing-extensions,
tzdata,
hypothesis,
pyprojectVersionPatchHook,
pytestCheckHook,
}:
buildPythonPackage rec {
version = "7.2.0";
pname = "icalendar";
pyproject = true;
src = fetchFromGitHub {
owner = "collective";
repo = "icalendar";
tag = "v${version}";
hash = "sha256-0NKNbWigZ3BOfKBM8Q+XrOdoFBOF5Lu4XujJcYCMuMw=";
};
nativeBuildInputs = [
pyprojectVersionPatchHook
];
build-system = [
hatch-vcs
hatchling
];
dependencies = [
python-dateutil
tzdata
]
++ lib.optionals (pythonOlder "3.13") [
# typing.TypeIs arrived in Python 3.13.
typing-extensions
];
nativeCheckInputs = [
hypothesis
pytestCheckHook
];
disabledTests = [
# AssertionError: assert {'Atlantic/Jan_Mayen'} == {'Arctic/Longyearbyen'}
"test_dateutil_timezone_is_matched_with_tzname"
"test_docstring_of_python_file"
];
enabledTestPaths = [ "src/icalendar" ];
meta = {
changelog = "https://github.com/collective/icalendar/blob/${src.tag}/CHANGES.rst";
description = "Parser/generator of iCalendar files";
mainProgram = "icalendar";
homepage = "https://github.com/collective/icalendar";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ olcai ];
};
}