• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2019 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
16//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
17//     DEPENDING ON IT IN YOUR PROJECT. ***
18package {
19    // See: http://go/android-license-faq
20    // A large-scale-change added 'default_applicable_licenses' to import
21    // all of the 'license_kinds' from "external_python_cpython3_license"
22    // to get the below license kinds:
23    //   SPDX-license-identifier-Apache-2.0
24    //   SPDX-license-identifier-BSD
25    //   SPDX-license-identifier-GPL
26    //   SPDX-license-identifier-MIT
27    //   SPDX-license-identifier-PSF-2.0
28    //   SPDX-license-identifier-Unicode-DFS
29    //   SPDX-license-identifier-Zlib
30    //   legacy_by_exception_only (by exception only)
31    //   legacy_notice
32    //   legacy_unencumbered
33    default_applicable_licenses: ["external_python_cpython3_license"],
34}
35
36filegroup {
37    name: "py3-stdlib-srcs",
38    visibility: ["//visibility:private"],
39    srcs: [
40        "*.py",
41        "asyncio/**/*.py",
42        "collections/**/*.py",
43        "concurrent/**/*.py",
44        "csv/**/*.py",
45        "ctypes/**/*.py",
46        "dbm/**/*.py",
47        "email/**/*.py",
48        "encodings/**/*.py",
49        "html/**/*.py",
50        "http/**/*.py",
51        "importlib/**/*.py",
52        "json/**/*.py",
53        "logging/**/*.py",
54        "multiprocessing/**/*.py",
55        "pathlib/**/*.py",
56        "pydoc_data/**/*.py",
57        "re/**/*.py",
58        "sqlite3/**/*.py",
59        "sysconfig/**/*.py",
60        "tomllib/**/*.py",
61        "unittest/**/*.py",
62        "urllib/**/*.py",
63        "wsgiref/**/*.py",
64        "xml/**/*.py",
65        "xmlrpc/**/*.py",
66        "zipfile/**/*.py",
67        "zoneinfo/**/*.py",
68        "_pyrepl/**/*.py",
69    ],
70    exclude_srcs: [
71        "__phello__.foo.py",
72    ],
73}
74
75python_library {
76    name: "py3-stdlib",
77    is_internal: true,
78    pkg_path: "python3.13",
79    host_supported: true,
80    srcs: [":py3-stdlib-srcs"],
81}
82
83// Used by prebuilts/build-tools/build-prebuilts.sh to update
84// prebuilts/build-tools/common/py3-stdlib
85genrule {
86    name: "py3-stdlib-zip",
87    visibility: ["//visibility:private"],
88    tools: ["soong_zip"],
89    cmd: "echo $(in) >$(genDir)/list && " +
90        "$(location soong_zip) -o $(out) -C external/python/cpython3/Lib -l $(genDir)/list",
91    srcs: [":py3-stdlib-srcs"],
92    out: ["py3-stdlib.zip"],
93}
94