1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 httpx,
6 pydantic,
7 typing-extensions,
8 anyio,
9 distro,
10 sniffio,
11 pythonOlder,
12 hatchling,
13 hatch-fancy-pypi-readme,
14}:
15
16buildPythonPackage rec {
17 pname = "cloudflare";
18 version = "4.3.1";
19 pyproject = true;
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-seHGvuuNmPY7/gocuodPxOIuAAvMSQVE+VbGibO1slg=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail 'hatchling==1.26.3' 'hatchling>=1.26.3'
31 '';
32
33 build-system = [
34 hatchling
35 hatch-fancy-pypi-readme
36 ];
37
38 dependencies = [
39 httpx
40 pydantic
41 typing-extensions
42 anyio
43 distro
44 sniffio
45 ];
46
47 # tests require networking
48 doCheck = false;
49
50 pythonImportsCheck = [ "cloudflare" ];
51
52 meta = {
53 description = "Official Python library for the Cloudflare API";
54 homepage = "https://github.com/cloudflare/cloudflare-python";
55 changelog = "https://github.com/cloudflare/cloudflare-python/blob/v${version}/CHANGELOG.md";
56 maintainers = with lib.maintainers; [
57 marie
58 jemand771
59 ];
60 license = lib.licenses.asl20;
61 };
62}