Browse Source

Intermediate changes

robot-piglet 1 year ago
parent
commit
303fba2f20

+ 5 - 0
contrib/python/numpy/include/numpy/core/feature_detection_misc.h

@@ -0,0 +1,5 @@
+#ifdef USE_PYTHON3
+#include <contrib/python/numpy/py3/numpy/core/feature_detection_misc.h>
+#else
+#error #include <contrib/python/numpy/py2/numpy/core/feature_detection_misc.h>
+#endif

+ 1 - 6
contrib/python/numpy/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: numpy
-Version: 1.26.3
+Version: 1.26.4
 Summary: Fundamental package for array computing in Python
 Home-page: https://numpy.org
 Author: Travis E. Oliphant et al.
@@ -70,11 +70,6 @@ License: Copyright (c) 2005-2023, NumPy Developers.
         License: Apache 2.0
           For license text, see vendored-meson/meson/COPYING
         
-        Name: meson-python
-        Files: vendored-meson/meson-python/*
-        License: MIT
-          For license text, see vendored-meson/meson-python/LICENSE
-        
         Name: spin
         Files: .spin/cmds.py
         License: BSD-3

+ 0 - 5
contrib/python/numpy/py3/LICENSES_bundled.txt

@@ -30,11 +30,6 @@ Files: vendored-meson/meson/*
 License: Apache 2.0
   For license text, see vendored-meson/meson/COPYING
 
-Name: meson-python
-Files: vendored-meson/meson-python/*
-License: MIT
-  For license text, see vendored-meson/meson-python/LICENSE
-
 Name: spin
 Files: .spin/cmds.py
 License: BSD-3

+ 14 - 8
contrib/python/numpy/py3/numpy/__config__.py.in

@@ -32,21 +32,27 @@ CONFIG = _cleanup(
         "Compilers": {
             "c": {
                 "name": "@C_COMP@",
-                "linker": "@C_COMP_LINKER_ID@",
+                "linker": r"@C_COMP_LINKER_ID@",
                 "version": "@C_COMP_VERSION@",
-                "commands": "@C_COMP_CMD_ARRAY@",
+                "commands": r"@C_COMP_CMD_ARRAY@",
+                "args": r"@C_COMP_ARGS@",
+                "linker args": r"@C_COMP_LINK_ARGS@",
             },
             "cython": {
                 "name": "@CYTHON_COMP@",
-                "linker": "@CYTHON_COMP_LINKER_ID@",
+                "linker": r"@CYTHON_COMP_LINKER_ID@",
                 "version": "@CYTHON_COMP_VERSION@",
-                "commands": "@CYTHON_COMP_CMD_ARRAY@",
+                "commands": r"@CYTHON_COMP_CMD_ARRAY@",
+                "args": r"@CYTHON_COMP_ARGS@",
+                "linker args": r"@CYTHON_COMP_LINK_ARGS@",
             },
             "c++": {
                 "name": "@CPP_COMP@",
-                "linker": "@CPP_COMP_LINKER_ID@",
+                "linker": r"@CPP_COMP_LINKER_ID@",
                 "version": "@CPP_COMP_VERSION@",
-                "commands": "@CPP_COMP_CMD_ARRAY@",
+                "commands": r"@CPP_COMP_CMD_ARRAY@",
+                "args": r"@CPP_COMP_ARGS@",
+                "linker args": r"@CPP_COMP_LINK_ARGS@",
             },
         },
         "Machine Information": {
@@ -72,7 +78,7 @@ CONFIG = _cleanup(
                 "detection method": "@BLAS_TYPE_NAME@",
                 "include directory": r"@BLAS_INCLUDEDIR@",
                 "lib directory": r"@BLAS_LIBDIR@",
-                "openblas configuration": "@BLAS_OPENBLAS_CONFIG@",
+                "openblas configuration": r"@BLAS_OPENBLAS_CONFIG@",
                 "pc file directory": r"@BLAS_PCFILEDIR@",
             },
             "lapack": {
@@ -82,7 +88,7 @@ CONFIG = _cleanup(
                 "detection method": "@LAPACK_TYPE_NAME@",
                 "include directory": r"@LAPACK_INCLUDEDIR@",
                 "lib directory": r"@LAPACK_LIBDIR@",
-                "openblas configuration": "@LAPACK_OPENBLAS_CONFIG@",
+                "openblas configuration": r"@LAPACK_OPENBLAS_CONFIG@",
                 "pc file directory": r"@LAPACK_PCFILEDIR@",
             },
         },

+ 1 - 1
contrib/python/numpy/py3/numpy/array_api/__init__.py

@@ -127,7 +127,7 @@ __all__ = ["__array_api_version__"]
 
 from ._constants import e, inf, nan, pi, newaxis
 
-__all__ += ["e", "inf", "nan", "pi"]
+__all__ += ["e", "inf", "nan", "pi", "newaxis"]
 
 from ._creation_functions import (
     asarray,

+ 5 - 1
contrib/python/numpy/py3/numpy/array_api/linalg.py

@@ -9,6 +9,7 @@ from ._dtypes import (
     complex128
 )
 from ._manipulation_functions import reshape
+from ._elementwise_functions import conj
 from ._array_object import Array
 
 from ..core.numeric import normalize_axis_tuple
@@ -53,7 +54,10 @@ def cholesky(x: Array, /, *, upper: bool = False) -> Array:
         raise TypeError('Only floating-point dtypes are allowed in cholesky')
     L = np.linalg.cholesky(x._array)
     if upper:
-        return Array._new(L).mT
+        U = Array._new(L).mT
+        if U.dtype in [complex64, complex128]:
+            U = conj(U)
+        return U
     return Array._new(L)
 
 # Note: cross is the numpy top-level namespace, not np.linalg

+ 0 - 9
contrib/python/numpy/py3/numpy/core/code_generators/genapi.py

@@ -304,15 +304,6 @@ def find_functions(filename, tag='API'):
     fo.close()
     return functions
 
-def should_rebuild(targets, source_files):
-    from distutils.dep_util import newer_group
-    for t in targets:
-        if not os.path.exists(t):
-            return True
-    sources = API_FILES + list(source_files) + [__file__]
-    if newer_group(sources, targets[0], missing='newer'):
-        return True
-    return False
 
 def write_file(filename, data):
     """

+ 1 - 6
contrib/python/numpy/py3/numpy/core/code_generators/generate_numpy_api.py

@@ -148,12 +148,7 @@ def generate_api(output_dir, force=False):
     targets = (h_file, c_file)
 
     sources = numpy_api.multiarray_api
-
-    if (not force and not genapi.should_rebuild(targets, [numpy_api.__file__, __file__])):
-        return targets
-    else:
-        do_generate_api(targets, sources)
-
+    do_generate_api(targets, sources)
     return targets
 
 def do_generate_api(targets, sources):

+ 1 - 6
contrib/python/numpy/py3/numpy/core/code_generators/generate_ufunc_api.py

@@ -125,12 +125,7 @@ def generate_api(output_dir, force=False):
     targets = (h_file, c_file)
 
     sources = ['ufunc_api_order.txt']
-
-    if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
-        return targets
-    else:
-        do_generate_api(targets, sources)
-
+    do_generate_api(targets, sources)
     return targets
 
 def do_generate_api(targets, sources):

+ 3 - 0
contrib/python/numpy/py3/numpy/core/feature_detection_stdio.h

@@ -1,6 +1,9 @@
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <fcntl.h>
 
+#if 0 /* Only for setup_common.py, not the C compiler */
 off_t ftello(FILE *stream);
 int fseeko(FILE *stream, off_t offset, int whence);
 int fallocate(int, int, off_t, off_t);
+#endif

Some files were not shown because too many files changed in this diff