tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
python311Packages.filedate: init at 3.0
Cody Hiar
2 years ago
2ec7c081
95269ee8
+61
2 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
filedate
default.nix
top-level
python-packages.nix
+59
pkgs/development/python-modules/filedate/default.nix
reviewed
···
1
1
+
{
2
2
+
lib,
3
3
+
buildPythonPackage,
4
4
+
fetchFromGitHub,
5
5
+
pytestCheckHook,
6
6
+
python-dateutil,
7
7
+
setuptools,
8
8
+
}:
9
9
+
buildPythonPackage rec {
10
10
+
pname = "filedate";
11
11
+
version = "3.0";
12
12
+
pyproject = true;
13
13
+
14
14
+
src = fetchFromGitHub {
15
15
+
owner = "kubinka0505";
16
16
+
repo = "filedate";
17
17
+
rev = version;
18
18
+
hash = "sha256-HvuGP+QlUlfAUfFmaVVvtPHGdrbWVxghQipnqTTvAQc=";
19
19
+
};
20
20
+
21
21
+
sourceRoot = "${src.name}/Files";
22
22
+
23
23
+
# The repo stores everything in "src" and uses setup.py to move "src" ->
24
24
+
# "filedate" before calling setup() and then tries to rename "filedate" back
25
25
+
# to "src" after.
26
26
+
postPatch = ''
27
27
+
mv src filedate
28
28
+
substituteInPlace setup.py \
29
29
+
--replace-fail "__title__ = os.path.basename(os.path.dirname(os.path.dirname(__file__)))" '__title__ = "filedate"'
30
30
+
substituteInPlace setup.py \
31
31
+
--replace-fail "cleanup = True" "cleanup = False"
32
32
+
33
33
+
# Disable renaming "filedate" dir back to "src"
34
34
+
substituteInPlace setup.py \
35
35
+
--replace-fail "if os.path.exists(__title__):" ""
36
36
+
substituteInPlace setup.py \
37
37
+
--replace-fail " os.rename(__title__, directory)" ""
38
38
+
'';
39
39
+
40
40
+
build-system = [ setuptools ];
41
41
+
42
42
+
dependencies = [ python-dateutil ];
43
43
+
44
44
+
pythonImportsCheck = [ "filedate" ];
45
45
+
46
46
+
nativeCheckInputs = [ pytestCheckHook ];
47
47
+
48
48
+
pytestFlagsArray = [ "tests/unit.py" ];
49
49
+
50
50
+
disabledTests = [ "test_created" ];
51
51
+
52
52
+
meta = {
53
53
+
description = "Simple, convenient and cross-platform file date changing library";
54
54
+
homepage = "https://github.com/kubinka0505/filedate";
55
55
+
changelog = "https://github.com/kubinka0505/filedate/blob/${src.rev}/Documents/ChangeLog.md";
56
56
+
license = lib.licenses.gpl3Only;
57
57
+
maintainers = with lib.maintainers; [ thornycrackers ];
58
58
+
};
59
59
+
}
+2
pkgs/top-level/python-packages.nix
reviewed
···
4183
4183
4184
4184
filecheck = callPackage ../development/python-modules/filecheck { };
4185
4185
4186
4186
+
filedate = callPackage ../development/python-modules/filedate { };
4187
4187
+
4186
4188
filedepot = callPackage ../development/python-modules/filedepot { };
4187
4189
4188
4190
filelock = callPackage ../development/python-modules/filelock { };