mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-03 10:44:18 +00:00
python311Packages.filedate: init at 3.0
This commit is contained in:
parent
95269ee8db
commit
2ec7c081df
59
pkgs/development/python-modules/filedate/default.nix
Normal file
59
pkgs/development/python-modules/filedate/default.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
pytestCheckHook,
|
||||
python-dateutil,
|
||||
setuptools,
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
pname = "filedate";
|
||||
version = "3.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kubinka0505";
|
||||
repo = "filedate";
|
||||
rev = version;
|
||||
hash = "sha256-HvuGP+QlUlfAUfFmaVVvtPHGdrbWVxghQipnqTTvAQc=";
|
||||
};
|
||||
|
||||
sourceRoot = "${src.name}/Files";
|
||||
|
||||
# The repo stores everything in "src" and uses setup.py to move "src" ->
|
||||
# "filedate" before calling setup() and then tries to rename "filedate" back
|
||||
# to "src" after.
|
||||
postPatch = ''
|
||||
mv src filedate
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail "__title__ = os.path.basename(os.path.dirname(os.path.dirname(__file__)))" '__title__ = "filedate"'
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail "cleanup = True" "cleanup = False"
|
||||
|
||||
# Disable renaming "filedate" dir back to "src"
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail "if os.path.exists(__title__):" ""
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail " os.rename(__title__, directory)" ""
|
||||
'';
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies = [ python-dateutil ];
|
||||
|
||||
pythonImportsCheck = [ "filedate" ];
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
pytestFlagsArray = [ "tests/unit.py" ];
|
||||
|
||||
disabledTests = [ "test_created" ];
|
||||
|
||||
meta = {
|
||||
description = "Simple, convenient and cross-platform file date changing library";
|
||||
homepage = "https://github.com/kubinka0505/filedate";
|
||||
changelog = "https://github.com/kubinka0505/filedate/blob/${src.rev}/Documents/ChangeLog.md";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ thornycrackers ];
|
||||
};
|
||||
}
|
@ -4183,6 +4183,8 @@ self: super: with self; {
|
||||
|
||||
filecheck = callPackage ../development/python-modules/filecheck { };
|
||||
|
||||
filedate = callPackage ../development/python-modules/filedate { };
|
||||
|
||||
filedepot = callPackage ../development/python-modules/filedepot { };
|
||||
|
||||
filelock = callPackage ../development/python-modules/filelock { };
|
||||
|
Loading…
Reference in New Issue
Block a user