• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# How to generate this file (useful when switching to Python 3.10):
2# Create a Windows instance with Python installed and SSH into it
3# (RDP also works, but these examples use SSH).
4# Then, locate the Python installation directory:
5#
6#     cd /c/Python39/
7#
8# The `include` directory contains all files that need to be used in the
9# `python_include` genrule below. The following command gives you what you
10# should insert in `outs` (modulo formatting, `buildifier` or similar tools
11# should help there):
12#
13#     find include -type f | sed -e 's;^include;"python_include;' -e 's;$;",;'
14#
15# Copy the output of above into `outs`, sort, remove duplicates. After this
16# step, you no longer need the Windows image.
17#
18# Then, on the current client, run the following command (Warning: long, make
19# sure you copy it fully), to generate the `cmd` for the genrule:
20#
21#     for i in `egrep '^ *\"python_include' BUILD.oss | tr -d '",'`; do echo -n 'cp -f "c:/Python39/include/'${i/python_include\//}'"' '"$(@D)'/$i'" && '; done | sed 's/ && $//'; echo
22#
23# Paste the output of this command into `cmd`.
24#
25# Note: If you change `numpy`, you will need to do similar steps as above but
26# for the numpy related genrules.
27
28# Point both runtimes to the same python binary to ensure we always
29# use the python binary specified by ./configure.py script.
30load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
31
32licenses(["restricted"])
33
34package(default_visibility = ["//visibility:public"])
35
36py_runtime(
37    name = "py3_runtime",
38    interpreter_path = "c:/Python39/python.exe",
39    python_version = "PY3",
40)
41
42py_runtime_pair(
43    name = "py_runtime_pair",
44    py3_runtime = ":py3_runtime",
45)
46
47toolchain(
48    name = "py_toolchain",
49    toolchain = ":py_runtime_pair",
50    toolchain_type = "@bazel_tools//tools/python:toolchain_type",
51)
52
53# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
54# See https://docs.python.org/3/extending/windows.html
55cc_import(
56    name = "python_lib",
57    interface_library = select({
58        ":windows": ":python_import_lib",
59        # A placeholder for Unix platforms which makes --no_build happy.
60        "//conditions:default": "not-existing.lib",
61    }),
62    system_provided = 1,
63)
64
65cc_library(
66    name = "python_headers",
67    hdrs = [":python_include"],
68    includes = ["python_include"],
69    deps = select({
70        ":windows": [":python_lib"],
71        "//conditions:default": [],
72    }),
73)
74
75cc_library(
76    name = "numpy_headers",
77    hdrs = [":numpy_include"],
78    includes = ["numpy_include"],
79)
80
81config_setting(
82    name = "windows",
83    values = {"cpu": "x64_windows"},
84    visibility = ["//visibility:public"],
85)
86
87genrule(
88    name = "python_include",
89    outs = [
90        "python_include/Python-ast.h",
91        "python_include/Python.h",
92        "python_include/abstract.h",
93        "python_include/asdl.h",
94        "python_include/ast.h",
95        "python_include/bitset.h",
96        "python_include/bltinmodule.h",
97        "python_include/boolobject.h",
98        "python_include/bytearrayobject.h",
99        "python_include/bytesobject.h",
100        "python_include/cellobject.h",
101        "python_include/ceval.h",
102        "python_include/classobject.h",
103        "python_include/code.h",
104        "python_include/codecs.h",
105        "python_include/compile.h",
106        "python_include/complexobject.h",
107        "python_include/context.h",
108        "python_include/cpython/abstract.h",
109        "python_include/cpython/bytearrayobject.h",
110        "python_include/cpython/bytesobject.h",
111        "python_include/cpython/ceval.h",
112        "python_include/cpython/code.h",
113        "python_include/cpython/dictobject.h",
114        "python_include/cpython/fileobject.h",
115        "python_include/cpython/fileutils.h",
116        "python_include/cpython/frameobject.h",
117        "python_include/cpython/import.h",
118        "python_include/cpython/initconfig.h",
119        "python_include/cpython/interpreteridobject.h",
120        "python_include/cpython/listobject.h",
121        "python_include/cpython/methodobject.h",
122        "python_include/cpython/object.h",
123        "python_include/cpython/objimpl.h",
124        "python_include/cpython/pyerrors.h",
125        "python_include/cpython/pylifecycle.h",
126        "python_include/cpython/pymem.h",
127        "python_include/cpython/pystate.h",
128        "python_include/cpython/sysmodule.h",
129        "python_include/cpython/traceback.h",
130        "python_include/cpython/tupleobject.h",
131        "python_include/cpython/unicodeobject.h",
132        "python_include/datetime.h",
133        "python_include/descrobject.h",
134        "python_include/dictobject.h",
135        "python_include/dynamic_annotations.h",
136        "python_include/enumobject.h",
137        "python_include/errcode.h",
138        "python_include/eval.h",
139        "python_include/exports.h",
140        "python_include/fileobject.h",
141        "python_include/fileutils.h",
142        "python_include/floatobject.h",
143        "python_include/frameobject.h",
144        "python_include/funcobject.h",
145        "python_include/genericaliasobject.h",
146        "python_include/genobject.h",
147        "python_include/graminit.h",
148        "python_include/grammar.h",
149        "python_include/import.h",
150        "python_include/internal/pegen_interface.h",
151        "python_include/internal/pycore_abstract.h",
152        "python_include/internal/pycore_accu.h",
153        "python_include/internal/pycore_atomic.h",
154        "python_include/internal/pycore_bytes_methods.h",
155        "python_include/internal/pycore_byteswap.h",
156        "python_include/internal/pycore_call.h",
157        "python_include/internal/pycore_ceval.h",
158        "python_include/internal/pycore_code.h",
159        "python_include/internal/pycore_condvar.h",
160        "python_include/internal/pycore_context.h",
161        "python_include/internal/pycore_dtoa.h",
162        "python_include/internal/pycore_fileutils.h",
163        "python_include/internal/pycore_gc.h",
164        "python_include/internal/pycore_getopt.h",
165        "python_include/internal/pycore_gil.h",
166        "python_include/internal/pycore_hamt.h",
167        "python_include/internal/pycore_hashtable.h",
168        "python_include/internal/pycore_import.h",
169        "python_include/internal/pycore_initconfig.h",
170        "python_include/internal/pycore_interp.h",
171        "python_include/internal/pycore_object.h",
172        "python_include/internal/pycore_pathconfig.h",
173        "python_include/internal/pycore_pyerrors.h",
174        "python_include/internal/pycore_pyhash.h",
175        "python_include/internal/pycore_pylifecycle.h",
176        "python_include/internal/pycore_pymem.h",
177        "python_include/internal/pycore_pystate.h",
178        "python_include/internal/pycore_runtime.h",
179        "python_include/internal/pycore_sysmodule.h",
180        "python_include/internal/pycore_traceback.h",
181        "python_include/internal/pycore_tupleobject.h",
182        "python_include/internal/pycore_warnings.h",
183        "python_include/interpreteridobject.h",
184        "python_include/intrcheck.h",
185        "python_include/iterobject.h",
186        "python_include/listobject.h",
187        "python_include/longintrepr.h",
188        "python_include/longobject.h",
189        "python_include/marshal.h",
190        "python_include/memoryobject.h",
191        "python_include/methodobject.h",
192        "python_include/modsupport.h",
193        "python_include/moduleobject.h",
194        "python_include/namespaceobject.h",
195        "python_include/node.h",
196        "python_include/object.h",
197        "python_include/objimpl.h",
198        "python_include/odictobject.h",
199        "python_include/opcode.h",
200        "python_include/osdefs.h",
201        "python_include/osmodule.h",
202        "python_include/parsetok.h",
203        "python_include/patchlevel.h",
204        "python_include/picklebufobject.h",
205        "python_include/py_curses.h",
206        "python_include/pyarena.h",
207        "python_include/pycapsule.h",
208        "python_include/pyconfig.h",
209        "python_include/pyctype.h",
210        "python_include/pydebug.h",
211        "python_include/pydtrace.h",
212        "python_include/pyerrors.h",
213        "python_include/pyexpat.h",
214        "python_include/pyfpe.h",
215        "python_include/pyframe.h",
216        "python_include/pyhash.h",
217        "python_include/pylifecycle.h",
218        "python_include/pymacconfig.h",
219        "python_include/pymacro.h",
220        "python_include/pymath.h",
221        "python_include/pymem.h",
222        "python_include/pyport.h",
223        "python_include/pystate.h",
224        "python_include/pystrcmp.h",
225        "python_include/pystrhex.h",
226        "python_include/pystrtod.h",
227        "python_include/pythonrun.h",
228        "python_include/pythread.h",
229        "python_include/pytime.h",
230        "python_include/rangeobject.h",
231        "python_include/setobject.h",
232        "python_include/sliceobject.h",
233        "python_include/structmember.h",
234        "python_include/structseq.h",
235        "python_include/symtable.h",
236        "python_include/sysmodule.h",
237        "python_include/token.h",
238        "python_include/traceback.h",
239        "python_include/tracemalloc.h",
240        "python_include/tupleobject.h",
241        "python_include/typeslots.h",
242        "python_include/ucnhash.h",
243        "python_include/unicodeobject.h",
244        "python_include/warnings.h",
245        "python_include/weakrefobject.h",
246    ],
247    cmd = """
248cp -f "c:/Python39/include/Python-ast.h" "$(@D)/python_include/Python-ast.h" && cp -f "c:/Python39/include/Python.h" "$(@D)/python_include/Python.h" && cp -f "c:/Python39/include/abstract.h" "$(@D)/python_include/abstract.h" && cp -f "c:/Python39/include/asdl.h" "$(@D)/python_include/asdl.h" && cp -f "c:/Python39/include/ast.h" "$(@D)/python_include/ast.h" && cp -f "c:/Python39/include/bitset.h" "$(@D)/python_include/bitset.h" && cp -f "c:/Python39/include/bltinmodule.h" "$(@D)/python_include/bltinmodule.h" && cp -f "c:/Python39/include/boolobject.h" "$(@D)/python_include/boolobject.h" && cp -f "c:/Python39/include/bytearrayobject.h" "$(@D)/python_include/bytearrayobject.h" && cp -f "c:/Python39/include/bytesobject.h" "$(@D)/python_include/bytesobject.h" && cp -f "c:/Python39/include/cellobject.h" "$(@D)/python_include/cellobject.h" && cp -f "c:/Python39/include/ceval.h" "$(@D)/python_include/ceval.h" && cp -f "c:/Python39/include/classobject.h" "$(@D)/python_include/classobject.h" && cp -f "c:/Python39/include/code.h" "$(@D)/python_include/code.h" && cp -f "c:/Python39/include/codecs.h" "$(@D)/python_include/codecs.h" && cp -f "c:/Python39/include/compile.h" "$(@D)/python_include/compile.h" && cp -f "c:/Python39/include/complexobject.h" "$(@D)/python_include/complexobject.h" && cp -f "c:/Python39/include/context.h" "$(@D)/python_include/context.h" && cp -f "c:/Python39/include/cpython/abstract.h" "$(@D)/python_include/cpython/abstract.h" && cp -f "c:/Python39/include/cpython/bytearrayobject.h" "$(@D)/python_include/cpython/bytearrayobject.h" && cp -f "c:/Python39/include/cpython/bytesobject.h" "$(@D)/python_include/cpython/bytesobject.h" && cp -f "c:/Python39/include/cpython/ceval.h" "$(@D)/python_include/cpython/ceval.h" && cp -f "c:/Python39/include/cpython/code.h" "$(@D)/python_include/cpython/code.h" && cp -f "c:/Python39/include/cpython/dictobject.h" "$(@D)/python_include/cpython/dictobject.h" && cp -f "c:/Python39/include/cpython/fileobject.h" "$(@D)/python_include/cpython/fileobject.h" && cp -f "c:/Python39/include/cpython/fileutils.h" "$(@D)/python_include/cpython/fileutils.h" && cp -f "c:/Python39/include/cpython/frameobject.h" "$(@D)/python_include/cpython/frameobject.h" && cp -f "c:/Python39/include/cpython/import.h" "$(@D)/python_include/cpython/import.h" && cp -f "c:/Python39/include/cpython/initconfig.h" "$(@D)/python_include/cpython/initconfig.h" && cp -f "c:/Python39/include/cpython/interpreteridobject.h" "$(@D)/python_include/cpython/interpreteridobject.h" && cp -f "c:/Python39/include/cpython/listobject.h" "$(@D)/python_include/cpython/listobject.h" && cp -f "c:/Python39/include/cpython/methodobject.h" "$(@D)/python_include/cpython/methodobject.h" && cp -f "c:/Python39/include/cpython/object.h" "$(@D)/python_include/cpython/object.h" && cp -f "c:/Python39/include/cpython/objimpl.h" "$(@D)/python_include/cpython/objimpl.h" && cp -f "c:/Python39/include/cpython/pyerrors.h" "$(@D)/python_include/cpython/pyerrors.h" && cp -f "c:/Python39/include/cpython/pylifecycle.h" "$(@D)/python_include/cpython/pylifecycle.h" && cp -f "c:/Python39/include/cpython/pymem.h" "$(@D)/python_include/cpython/pymem.h" && cp -f "c:/Python39/include/cpython/pystate.h" "$(@D)/python_include/cpython/pystate.h" && cp -f "c:/Python39/include/cpython/sysmodule.h" "$(@D)/python_include/cpython/sysmodule.h" && cp -f "c:/Python39/include/cpython/traceback.h" "$(@D)/python_include/cpython/traceback.h" && cp -f "c:/Python39/include/cpython/tupleobject.h" "$(@D)/python_include/cpython/tupleobject.h" && cp -f "c:/Python39/include/cpython/unicodeobject.h" "$(@D)/python_include/cpython/unicodeobject.h" && cp -f "c:/Python39/include/datetime.h" "$(@D)/python_include/datetime.h" && cp -f "c:/Python39/include/descrobject.h" "$(@D)/python_include/descrobject.h" && cp -f "c:/Python39/include/dictobject.h" "$(@D)/python_include/dictobject.h" && cp -f "c:/Python39/include/dynamic_annotations.h" "$(@D)/python_include/dynamic_annotations.h" && cp -f "c:/Python39/include/enumobject.h" "$(@D)/python_include/enumobject.h" && cp -f "c:/Python39/include/errcode.h" "$(@D)/python_include/errcode.h" && cp -f "c:/Python39/include/eval.h" "$(@D)/python_include/eval.h" && cp -f "c:/Python39/include/exports.h" "$(@D)/python_include/exports.h" && cp -f "c:/Python39/include/fileobject.h" "$(@D)/python_include/fileobject.h" && cp -f "c:/Python39/include/fileutils.h" "$(@D)/python_include/fileutils.h" && cp -f "c:/Python39/include/floatobject.h" "$(@D)/python_include/floatobject.h" && cp -f "c:/Python39/include/frameobject.h" "$(@D)/python_include/frameobject.h" && cp -f "c:/Python39/include/funcobject.h" "$(@D)/python_include/funcobject.h" && cp -f "c:/Python39/include/genericaliasobject.h" "$(@D)/python_include/genericaliasobject.h" && cp -f "c:/Python39/include/genobject.h" "$(@D)/python_include/genobject.h" && cp -f "c:/Python39/include/graminit.h" "$(@D)/python_include/graminit.h" && cp -f "c:/Python39/include/grammar.h" "$(@D)/python_include/grammar.h" && cp -f "c:/Python39/include/import.h" "$(@D)/python_include/import.h" && cp -f "c:/Python39/include/internal/pegen_interface.h" "$(@D)/python_include/internal/pegen_interface.h" && cp -f "c:/Python39/include/internal/pycore_abstract.h" "$(@D)/python_include/internal/pycore_abstract.h" && cp -f "c:/Python39/include/internal/pycore_accu.h" "$(@D)/python_include/internal/pycore_accu.h" && cp -f "c:/Python39/include/internal/pycore_atomic.h" "$(@D)/python_include/internal/pycore_atomic.h" && cp -f "c:/Python39/include/internal/pycore_bytes_methods.h" "$(@D)/python_include/internal/pycore_bytes_methods.h" && cp -f "c:/Python39/include/internal/pycore_byteswap.h" "$(@D)/python_include/internal/pycore_byteswap.h" && cp -f "c:/Python39/include/internal/pycore_call.h" "$(@D)/python_include/internal/pycore_call.h" && cp -f "c:/Python39/include/internal/pycore_ceval.h" "$(@D)/python_include/internal/pycore_ceval.h" && cp -f "c:/Python39/include/internal/pycore_code.h" "$(@D)/python_include/internal/pycore_code.h" && cp -f "c:/Python39/include/internal/pycore_condvar.h" "$(@D)/python_include/internal/pycore_condvar.h" && cp -f "c:/Python39/include/internal/pycore_context.h" "$(@D)/python_include/internal/pycore_context.h" && cp -f "c:/Python39/include/internal/pycore_dtoa.h" "$(@D)/python_include/internal/pycore_dtoa.h" && cp -f "c:/Python39/include/internal/pycore_fileutils.h" "$(@D)/python_include/internal/pycore_fileutils.h" && cp -f "c:/Python39/include/internal/pycore_gc.h" "$(@D)/python_include/internal/pycore_gc.h" && cp -f "c:/Python39/include/internal/pycore_getopt.h" "$(@D)/python_include/internal/pycore_getopt.h" && cp -f "c:/Python39/include/internal/pycore_gil.h" "$(@D)/python_include/internal/pycore_gil.h" && cp -f "c:/Python39/include/internal/pycore_hamt.h" "$(@D)/python_include/internal/pycore_hamt.h" && cp -f "c:/Python39/include/internal/pycore_hashtable.h" "$(@D)/python_include/internal/pycore_hashtable.h" && cp -f "c:/Python39/include/internal/pycore_import.h" "$(@D)/python_include/internal/pycore_import.h" && cp -f "c:/Python39/include/internal/pycore_initconfig.h" "$(@D)/python_include/internal/pycore_initconfig.h" && cp -f "c:/Python39/include/internal/pycore_interp.h" "$(@D)/python_include/internal/pycore_interp.h" && cp -f "c:/Python39/include/internal/pycore_object.h" "$(@D)/python_include/internal/pycore_object.h" && cp -f "c:/Python39/include/internal/pycore_pathconfig.h" "$(@D)/python_include/internal/pycore_pathconfig.h" && cp -f "c:/Python39/include/internal/pycore_pyerrors.h" "$(@D)/python_include/internal/pycore_pyerrors.h" && cp -f "c:/Python39/include/internal/pycore_pyhash.h" "$(@D)/python_include/internal/pycore_pyhash.h" && cp -f "c:/Python39/include/internal/pycore_pylifecycle.h" "$(@D)/python_include/internal/pycore_pylifecycle.h" && cp -f "c:/Python39/include/internal/pycore_pymem.h" "$(@D)/python_include/internal/pycore_pymem.h" && cp -f "c:/Python39/include/internal/pycore_pystate.h" "$(@D)/python_include/internal/pycore_pystate.h" && cp -f "c:/Python39/include/internal/pycore_runtime.h" "$(@D)/python_include/internal/pycore_runtime.h" && cp -f "c:/Python39/include/internal/pycore_sysmodule.h" "$(@D)/python_include/internal/pycore_sysmodule.h" && cp -f "c:/Python39/include/internal/pycore_traceback.h" "$(@D)/python_include/internal/pycore_traceback.h" && cp -f "c:/Python39/include/internal/pycore_tupleobject.h" "$(@D)/python_include/internal/pycore_tupleobject.h" && cp -f "c:/Python39/include/internal/pycore_warnings.h" "$(@D)/python_include/internal/pycore_warnings.h" && cp -f "c:/Python39/include/interpreteridobject.h" "$(@D)/python_include/interpreteridobject.h" && cp -f "c:/Python39/include/intrcheck.h" "$(@D)/python_include/intrcheck.h" && cp -f "c:/Python39/include/iterobject.h" "$(@D)/python_include/iterobject.h" && cp -f "c:/Python39/include/listobject.h" "$(@D)/python_include/listobject.h" && cp -f "c:/Python39/include/longintrepr.h" "$(@D)/python_include/longintrepr.h" && cp -f "c:/Python39/include/longobject.h" "$(@D)/python_include/longobject.h" && cp -f "c:/Python39/include/marshal.h" "$(@D)/python_include/marshal.h" && cp -f "c:/Python39/include/memoryobject.h" "$(@D)/python_include/memoryobject.h" && cp -f "c:/Python39/include/methodobject.h" "$(@D)/python_include/methodobject.h" && cp -f "c:/Python39/include/modsupport.h" "$(@D)/python_include/modsupport.h" && cp -f "c:/Python39/include/moduleobject.h" "$(@D)/python_include/moduleobject.h" && cp -f "c:/Python39/include/namespaceobject.h" "$(@D)/python_include/namespaceobject.h" && cp -f "c:/Python39/include/node.h" "$(@D)/python_include/node.h" && cp -f "c:/Python39/include/object.h" "$(@D)/python_include/object.h" && cp -f "c:/Python39/include/objimpl.h" "$(@D)/python_include/objimpl.h" && cp -f "c:/Python39/include/odictobject.h" "$(@D)/python_include/odictobject.h" && cp -f "c:/Python39/include/opcode.h" "$(@D)/python_include/opcode.h" && cp -f "c:/Python39/include/osdefs.h" "$(@D)/python_include/osdefs.h" && cp -f "c:/Python39/include/osmodule.h" "$(@D)/python_include/osmodule.h" && cp -f "c:/Python39/include/parsetok.h" "$(@D)/python_include/parsetok.h" && cp -f "c:/Python39/include/patchlevel.h" "$(@D)/python_include/patchlevel.h" && cp -f "c:/Python39/include/picklebufobject.h" "$(@D)/python_include/picklebufobject.h" && cp -f "c:/Python39/include/py_curses.h" "$(@D)/python_include/py_curses.h" && cp -f "c:/Python39/include/pyarena.h" "$(@D)/python_include/pyarena.h" && cp -f "c:/Python39/include/pycapsule.h" "$(@D)/python_include/pycapsule.h" && cp -f "c:/Python39/include/pyconfig.h" "$(@D)/python_include/pyconfig.h" && cp -f "c:/Python39/include/pyctype.h" "$(@D)/python_include/pyctype.h" && cp -f "c:/Python39/include/pydebug.h" "$(@D)/python_include/pydebug.h" && cp -f "c:/Python39/include/pydtrace.h" "$(@D)/python_include/pydtrace.h" && cp -f "c:/Python39/include/pyerrors.h" "$(@D)/python_include/pyerrors.h" && cp -f "c:/Python39/include/pyexpat.h" "$(@D)/python_include/pyexpat.h" && cp -f "c:/Python39/include/pyfpe.h" "$(@D)/python_include/pyfpe.h" && cp -f "c:/Python39/include/pyframe.h" "$(@D)/python_include/pyframe.h" && cp -f "c:/Python39/include/pyhash.h" "$(@D)/python_include/pyhash.h" && cp -f "c:/Python39/include/pylifecycle.h" "$(@D)/python_include/pylifecycle.h" && cp -f "c:/Python39/include/pymacconfig.h" "$(@D)/python_include/pymacconfig.h" && cp -f "c:/Python39/include/pymacro.h" "$(@D)/python_include/pymacro.h" && cp -f "c:/Python39/include/pymath.h" "$(@D)/python_include/pymath.h" && cp -f "c:/Python39/include/pymem.h" "$(@D)/python_include/pymem.h" && cp -f "c:/Python39/include/pyport.h" "$(@D)/python_include/pyport.h" && cp -f "c:/Python39/include/pystate.h" "$(@D)/python_include/pystate.h" && cp -f "c:/Python39/include/pystrcmp.h" "$(@D)/python_include/pystrcmp.h" && cp -f "c:/Python39/include/pystrhex.h" "$(@D)/python_include/pystrhex.h" && cp -f "c:/Python39/include/pystrtod.h" "$(@D)/python_include/pystrtod.h" && cp -f "c:/Python39/include/pythonrun.h" "$(@D)/python_include/pythonrun.h" && cp -f "c:/Python39/include/pythread.h" "$(@D)/python_include/pythread.h" && cp -f "c:/Python39/include/pytime.h" "$(@D)/python_include/pytime.h" && cp -f "c:/Python39/include/rangeobject.h" "$(@D)/python_include/rangeobject.h" && cp -f "c:/Python39/include/setobject.h" "$(@D)/python_include/setobject.h" && cp -f "c:/Python39/include/sliceobject.h" "$(@D)/python_include/sliceobject.h" && cp -f "c:/Python39/include/structmember.h" "$(@D)/python_include/structmember.h" && cp -f "c:/Python39/include/structseq.h" "$(@D)/python_include/structseq.h" && cp -f "c:/Python39/include/symtable.h" "$(@D)/python_include/symtable.h" && cp -f "c:/Python39/include/sysmodule.h" "$(@D)/python_include/sysmodule.h" && cp -f "c:/Python39/include/token.h" "$(@D)/python_include/token.h" && cp -f "c:/Python39/include/traceback.h" "$(@D)/python_include/traceback.h" && cp -f "c:/Python39/include/tracemalloc.h" "$(@D)/python_include/tracemalloc.h" && cp -f "c:/Python39/include/tupleobject.h" "$(@D)/python_include/tupleobject.h" && cp -f "c:/Python39/include/typeslots.h" "$(@D)/python_include/typeslots.h" && cp -f "c:/Python39/include/ucnhash.h" "$(@D)/python_include/ucnhash.h" && cp -f "c:/Python39/include/unicodeobject.h" "$(@D)/python_include/unicodeobject.h" && cp -f "c:/Python39/include/warnings.h" "$(@D)/python_include/warnings.h" && cp -f "c:/Python39/include/weakrefobject.h" "$(@D)/python_include/weakrefobject.h"
249   """,
250)
251
252genrule(
253    name = "numpy_include",
254    outs = [
255        "numpy_include/numpy/__multiarray_api.h",
256        "numpy_include/numpy/__ufunc_api.h",
257        "numpy_include/numpy/_neighborhood_iterator_imp.h",
258        "numpy_include/numpy/_numpyconfig.h",
259        "numpy_include/numpy/arrayobject.h",
260        "numpy_include/numpy/arrayscalars.h",
261        "numpy_include/numpy/halffloat.h",
262        "numpy_include/numpy/multiarray_api.txt",
263        "numpy_include/numpy/ndarrayobject.h",
264        "numpy_include/numpy/ndarraytypes.h",
265        "numpy_include/numpy/noprefix.h",
266        "numpy_include/numpy/npy_1_7_deprecated_api.h",
267        "numpy_include/numpy/npy_3kcompat.h",
268        "numpy_include/numpy/npy_common.h",
269        "numpy_include/numpy/npy_cpu.h",
270        "numpy_include/numpy/npy_endian.h",
271        "numpy_include/numpy/npy_interrupt.h",
272        "numpy_include/numpy/npy_math.h",
273        "numpy_include/numpy/npy_no_deprecated_api.h",
274        "numpy_include/numpy/npy_os.h",
275        "numpy_include/numpy/numpyconfig.h",
276        "numpy_include/numpy/old_defines.h",
277        "numpy_include/numpy/oldnumeric.h",
278        "numpy_include/numpy/random/bitgen.h",
279        "numpy_include/numpy/random/distributions.h",
280        "numpy_include/numpy/ufunc_api.txt",
281        "numpy_include/numpy/ufuncobject.h",
282        "numpy_include/numpy/utils.h",
283    ],
284    cmd = """
285cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/__multiarray_api.h" "$(@D)/numpy_include/numpy/__multiarray_api.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/__ufunc_api.h" "$(@D)/numpy_include/numpy/__ufunc_api.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/_neighborhood_iterator_imp.h" "$(@D)/numpy_include/numpy/_neighborhood_iterator_imp.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/_numpyconfig.h" "$(@D)/numpy_include/numpy/_numpyconfig.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/arrayobject.h" "$(@D)/numpy_include/numpy/arrayobject.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/arrayscalars.h" "$(@D)/numpy_include/numpy/arrayscalars.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/halffloat.h" "$(@D)/numpy_include/numpy/halffloat.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/multiarray_api.txt" "$(@D)/numpy_include/numpy/multiarray_api.txt" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/ndarrayobject.h" "$(@D)/numpy_include/numpy/ndarrayobject.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/ndarraytypes.h" "$(@D)/numpy_include/numpy/ndarraytypes.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/noprefix.h" "$(@D)/numpy_include/numpy/noprefix.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h" "$(@D)/numpy_include/numpy/npy_1_7_deprecated_api.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_3kcompat.h" "$(@D)/numpy_include/numpy/npy_3kcompat.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_common.h" "$(@D)/numpy_include/numpy/npy_common.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_cpu.h" "$(@D)/numpy_include/numpy/npy_cpu.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_endian.h" "$(@D)/numpy_include/numpy/npy_endian.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_interrupt.h" "$(@D)/numpy_include/numpy/npy_interrupt.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_math.h" "$(@D)/numpy_include/numpy/npy_math.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_no_deprecated_api.h" "$(@D)/numpy_include/numpy/npy_no_deprecated_api.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/npy_os.h" "$(@D)/numpy_include/numpy/npy_os.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/numpyconfig.h" "$(@D)/numpy_include/numpy/numpyconfig.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/old_defines.h" "$(@D)/numpy_include/numpy/old_defines.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/oldnumeric.h" "$(@D)/numpy_include/numpy/oldnumeric.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/random/bitgen.h" "$(@D)/numpy_include/numpy/random/bitgen.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/random/distributions.h" "$(@D)/numpy_include/numpy/random/distributions.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/ufunc_api.txt" "$(@D)/numpy_include/numpy/ufunc_api.txt" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/ufuncobject.h" "$(@D)/numpy_include/numpy/ufuncobject.h" && cp -f "c:/Python39/lib/site-packages/numpy/core/include/numpy/utils.h" "$(@D)/numpy_include/numpy/utils.h"
286   """,
287)
288
289genrule(
290    name = "python_import_lib",
291    outs = [
292        "python39.lib",
293    ],
294    cmd = """
295cp -f "c:/Python39/libs/python39.lib" "$(@D)/python39.lib"
296   """,
297)
298