summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/zope-deferredimport/default.nix
blob: 0fbd5e147763706aaaf42ba8ec4085c33b797949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  zope-proxy,
  unittestCheckHook,
}:

buildPythonPackage rec {
  pname = "zope-deferredimport";
  version = "6.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "zopefoundation";
    repo = "zope.deferredimport";
    tag = version;
    hash = "sha256-7Q8+Cew5987+CjUOxqpwMFXWdw+/B28tOEXRYC0SRyI=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "setuptools ==" "setuptools >="
  '';

  build-system = [ setuptools ];

  dependencies = [ zope-proxy ];

  pythonImportsCheck = [ "zope.deferredimport" ];

  nativeCheckInputs = [ unittestCheckHook ];

  unittestFlagsArray = [ "src/zope/deferredimport" ];

  pythonNamespaces = [ "zope" ];

  meta = {
    description = "Allows you to perform imports names that will only be resolved when used in the code";
    homepage = "https://github.com/zopefoundation/zope.deferredimport";
    changelog = "https://github.com/zopefoundation/zope.deferredimport/blob/${version}/CHANGES.rst";
    license = lib.licenses.zpl21;
  };
}