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:
@@ -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; [ ];
|
||||
};
|
||||
}
|
||||
@@ -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 { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user