nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 google-api-core,
7 google-auth,
8 grpcio,
9 grpcio-status,
10 mock,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "google-cloud-core";
16 version = "2.5.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "googleapis";
21 repo = "python-cloud-core";
22 tag = "v${version}";
23 hash = "sha256-mB0gHxyK+g+e5I/3TRVAyQzPu005ug7fTvRNxciJ9LQ=";
24 };
25
26 build-system = [ setuptools ];
27
28 dependencies = [
29 google-auth
30 google-api-core
31 ];
32
33 optional-dependencies = {
34 grpc = [
35 grpcio
36 grpcio-status
37 ];
38 };
39
40 nativeCheckInputs = [
41 mock
42 pytestCheckHook
43 ]
44 ++ optional-dependencies.grpc;
45
46 # prevent google directory from shadowing google imports
47 preCheck = ''
48 rm -r google
49 '';
50
51 pythonImportsCheck = [ "google.cloud" ];
52
53 meta = {
54 description = "API Client library for Google Cloud: Core Helpers";
55 homepage = "https://github.com/googleapis/python-cloud-core";
56 changelog = "https://github.com/googleapis/python-cloud-core/blob/${src.tag}/CHANGELOG.md";
57 license = lib.licenses.asl20;
58 maintainers = [ ];
59 };
60}