nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 zope-i18nmessageid,
7 zope-interface,
8 unittestCheckHook,
9 zope-component,
10 zope-configuration,
11 zope-security,
12}:
13
14buildPythonPackage rec {
15 pname = "zope-size";
16 version = "6.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "zopefoundation";
21 repo = "zope.size";
22 tag = version;
23 hash = "sha256-jjI9NvfxnIWZrqDEpZ6FDlhDWZoqEUBliiyh+5PxOAg=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace-fail "setuptools ==" "setuptools >="
29 '';
30
31 build-system = [ setuptools ];
32
33 dependencies = [
34 zope-i18nmessageid
35 zope-interface
36 ];
37
38 optional-dependencies = {
39 zcml = [
40 zope-component
41 zope-configuration
42 zope-security
43 ]
44 ++ zope-component.optional-dependencies.zcml
45 ++ zope-security.optional-dependencies.zcml;
46 };
47
48 pythonImportsCheck = [ "zope.size" ];
49
50 nativeCheckInputs = [
51 unittestCheckHook
52 ]
53 ++ lib.concatAttrValues optional-dependencies;
54
55 unittestFlagsArray = [ "src/zope/size" ];
56
57 pythonNamespaces = [ "zope" ];
58
59 meta = {
60 homepage = "https://github.com/zopefoundation/zope.size";
61 description = "Interfaces and simple adapter that give the size of an object";
62 changelog = "https://github.com/zopefoundation/zope.size/blob/${version}/CHANGES.rst";
63 license = lib.licenses.zpl21;
64 maintainers = [ ];
65 };
66}