evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / filedate / default.nix
blob5317169caa68c30788a373fba3b61ac795de0e1f
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   pytestCheckHook,
6   python-dateutil,
7   setuptools,
8 }:
9 buildPythonPackage rec {
10   pname = "filedate";
11   version = "3.0";
12   pyproject = true;
14   src = fetchFromGitHub {
15     owner = "kubinka0505";
16     repo = "filedate";
17     rev = version;
18     hash = "sha256-HvuGP+QlUlfAUfFmaVVvtPHGdrbWVxghQipnqTTvAQc=";
19   };
21   sourceRoot = "${src.name}/Files";
23   # The repo stores everything in "src" and uses setup.py to move "src" ->
24   # "filedate" before calling setup() and then tries to rename "filedate" back
25   # to "src" after.
26   postPatch = ''
27     mv src filedate
28     substituteInPlace setup.py \
29       --replace-fail "__title__ = os.path.basename(os.path.dirname(os.path.dirname(__file__)))" '__title__ = "filedate"'
30     substituteInPlace setup.py \
31       --replace-fail "cleanup = True" "cleanup = False"
33     # Disable renaming "filedate" dir back to "src"
34     substituteInPlace setup.py \
35       --replace-fail "if os.path.exists(__title__):" ""
36     substituteInPlace setup.py \
37       --replace-fail "  os.rename(__title__, directory)" ""
38   '';
40   build-system = [ setuptools ];
42   dependencies = [ python-dateutil ];
44   pythonImportsCheck = [ "filedate" ];
46   nativeCheckInputs = [ pytestCheckHook ];
48   pytestFlagsArray = [ "tests/unit.py" ];
50   disabledTests = [ "test_created" ];
52   meta = {
53     description = "Simple, convenient and cross-platform file date changing library";
54     homepage = "https://github.com/kubinka0505/filedate";
55     changelog = "https://github.com/kubinka0505/filedate/blob/${src.rev}/Documents/ChangeLog.md";
56     license = lib.licenses.gpl3Only;
57     maintainers = with lib.maintainers; [ thornycrackers ];
58   };