python311Packages.pendulum_3: 3.0.0b1 -> 3.0.0

https://github.com/sdispater/pendulum/releases/tag/3.0.0

Fixes the build on darwin and expose as a separate attribute for now.
This commit is contained in:
Martin Weinelt
2024-01-06 16:08:36 +01:00
parent 4fb3b0394b
commit e4711c5cc1
2 changed files with 26 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
@@ -8,6 +9,9 @@
, poetry-core
, rustPlatform
# native dependencies
, iconv
# dependencies
, backports-zoneinfo
, importlib-resources
@@ -22,22 +26,31 @@
buildPythonPackage rec {
pname = "pendulum";
version = "3.0.0b1";
version = "3.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "sdispater";
repo = "pendulum";
rev = "refs/tags/${version}";
hash = "sha256-11W22RpoYUcL9Nya32HRX4Jdo4L9XP2Zftevc+7eFzw=";
hash = "sha256-v0kp8dklvDeC7zdTDOpIbpuj13aGub+oCaYz2ytkEpI=";
};
postPatch = ''
substituteInPlace rust/Cargo.lock \
--replace "3.0.0-beta-1" "3.0.0"
'';
cargoRoot = "rust";
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sourceRoot = "source/rust";
name = "${pname}-${version}";
hash = "sha256-qyyPR4a+IHrRSZzOZaW+DXGpOTyFcEVu/+Mt5QlQFqw=";
hash = "sha256-6fw0KgnPIMfdseWcunsGjvjVB+lJNoG3pLDqkORPJ0I=";
postPatch = ''
substituteInPlace Cargo.lock \
--replace "3.0.0-beta-1" "3.0.0"
'';
};
nativeBuildInputs = [
@@ -46,6 +59,10 @@ buildPythonPackage rec {
rustPlatform.cargoSetupHook
];
buildInputs = lib.optionals stdenv.isDarwin [
iconv
];
propagatedBuildInputs = [
python-dateutil
tzdata
@@ -67,6 +84,9 @@ buildPythonPackage rec {
disabledTestPaths = [
"tests/benchmarks"
] ++ lib.optionals stdenv.isDarwin [
# PermissionError: [Errno 1] Operation not permitted: '/etc/localtime'
"tests/testing/test_time_travel.py"
];
meta = with lib; {

View File

@@ -9104,7 +9104,9 @@ self: super: with self; {
pendulum = if pythonAtLeast "3.12" then
callPackage ../development/python-modules/pendulum/3.nix { }
else
callPackage ../development/python-modules/pendulum { };
pendulum_3;
pendulum_3 = callPackage ../development/python-modules/pendulum { };
pep440 = callPackage ../development/python-modules/pep440 { };