1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 gitUpdater,
6 setuptools,
7 setuptools-scm,
8 fs,
9 pytestCheckHook,
10 pytest-mock,
11}:
12
13buildPythonPackage rec {
14 pname = "pyfatfs";
15 version = "1.1.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "nathanhi";
20 repo = "pyfatfs";
21 tag = "v${version}";
22 hash = "sha256-26b4EV3WERUqJ10VkYov3PDFhSBcfxCF79P8Eg5xpoM=";
23 };
24
25 build-system = [
26 setuptools
27 setuptools-scm
28 ];
29
30 dependencies = [ fs ];
31
32 postPatch = ''
33 substituteInPlace ./pyproject.toml \
34 --replace-fail 'setuptools ~= 67.8' setuptools \
35 --replace-fail '"setuptools_scm[toml] ~= 7.1"' ""
36 '';
37
38 nativeCheckInputs = [
39 pytestCheckHook
40 pytest-mock
41 ];
42
43 env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
44
45 passthru.updateScript = gitUpdater { rev-prefix = "v"; };
46
47 meta = {
48 description = "Python based FAT12/FAT16/FAT32 implementation with VFAT support";
49 homepage = "https://github.com/nathanhi/pyfatfs";
50 license = lib.licenses.mit;
51 platforms = lib.platforms.all;
52 maintainers = with lib.maintainers; [ vlaci ];
53 };
54}