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