python312Packages.pendulum: init at 3.0.0b1

Adds the new pendulum beta early, since it comes with support for
Python 3.12, while keeping Python<3.12 on 2.x until 3.0 gets its final
release.
This commit is contained in:
Martin Weinelt
2023-12-20 20:46:08 +01:00
parent 8742c0cd2e
commit 3d9c94eeb7
2 changed files with 83 additions and 1 deletions
@@ -0,0 +1,79 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, isPyPy
# build-system
, poetry-core
, rustPlatform
# dependencies
, backports-zoneinfo
, importlib-resources
, python-dateutil
, time-machine
, tzdata
# tests
, pytestCheckHook
, pytz
}:
buildPythonPackage rec {
pname = "pendulum";
version = "3.0.0b1";
pyproject = true;
src = fetchFromGitHub {
owner = "sdispater";
repo = "pendulum";
rev = "refs/tags/${version}";
hash = "sha256-11W22RpoYUcL9Nya32HRX4Jdo4L9XP2Zftevc+7eFzw=";
};
cargoRoot = "rust";
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sourceRoot = "source/rust";
name = "${pname}-${version}";
hash = "sha256-qyyPR4a+IHrRSZzOZaW+DXGpOTyFcEVu/+Mt5QlQFqw=";
};
nativeBuildInputs = [
poetry-core
rustPlatform.maturinBuildHook
rustPlatform.cargoSetupHook
];
propagatedBuildInputs = [
python-dateutil
tzdata
] ++ lib.optional (!isPyPy) [
time-machine
] ++ lib.optionals (pythonOlder "3.9") [
backports-zoneinfo
importlib-resources
];
pythonImportsCheck = [
"pendulum"
];
nativeCheckInputs = [
pytestCheckHook
pytz
];
disabledTestPaths = [
"tests/benchmarks"
];
meta = with lib; {
description = "Python datetimes made easy";
homepage = "https://github.com/sdispater/pendulum";
changelog = "https://github.com/sdispater/pendulum/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
}
+4 -1
View File
@@ -9071,7 +9071,10 @@ self: super: with self; {
pem = callPackage ../development/python-modules/pem { };
pendulum = callPackage ../development/python-modules/pendulum { };
pendulum = if pythonAtLeast "3.12" then
callPackage ../development/python-modules/pendulum/3.nix { }
else
callPackage ../development/python-modules/pendulum { };
pep440 = callPackage ../development/python-modules/pep440 { };