diff options
| author | shadchin <[email protected]> | 2026-01-14 19:52:47 +0300 |
|---|---|---|
| committer | shadchin <[email protected]> | 2026-01-14 20:30:18 +0300 |
| commit | 078fd8aa66d488d1339cb64a5a3918e786b4baae (patch) | |
| tree | 8f88c448cb861883216c644dae3d0fc3bdfbd993 /contrib/python/numpy/py3 | |
| parent | d980d7a650f4a3cfe8d1b7f030847b03d5c511e4 (diff) | |
Fix `__name__` for builtin modules
Такой же подход есть у загрузки so-расширений, но для builtin его из коробки нет, так как builtin в upstream используется только для стандартной библиотеки, а там нет подпакетов, там только модули и у них нет проблемы с именем.
До патча:
```ipython
In [1]: import osgeo._gdal
In [2]: osgeo._gdal.__name__
Out[2]: '_gdal' # <- Потерялось имя пакета, должно быть `osgeo._gdal`
```
После патча:
```ipython
In [1]: import osgeo._gdal
In [2]: osgeo._gdal.__name__
Out[2]: 'osgeo._gdal'
```
commit_hash:fee95110a58cae8395a46598bf8f0b80e42b029a
Diffstat (limited to 'contrib/python/numpy/py3')
| -rw-r--r-- | contrib/python/numpy/py3/numpy/tests/test_public_api.py | 10 | ||||
| -rw-r--r-- | contrib/python/numpy/py3/patches/04-fix-tests.patch | 22 |
2 files changed, 5 insertions, 27 deletions
diff --git a/contrib/python/numpy/py3/numpy/tests/test_public_api.py b/contrib/python/numpy/py3/numpy/tests/test_public_api.py index 5a90650fd81..e1e4460c4fb 100644 --- a/contrib/python/numpy/py3/numpy/tests/test_public_api.py +++ b/contrib/python/numpy/py3/numpy/tests/test_public_api.py @@ -34,16 +34,16 @@ def test_numpy_namespace(): # None of these objects are publicly documented to be part of the main # NumPy namespace (some are useful though, others need to be cleaned up) undocumented = { - '_add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc', - 'add_docstring': '_multiarray_umath.add_docstring', + '_add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc', + 'add_docstring': 'numpy.core._multiarray_umath.add_docstring', 'add_newdoc': 'numpy.core.function_base.add_newdoc', - 'add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc', + 'add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc', 'byte_bounds': 'numpy.lib.utils.byte_bounds', - 'compare_chararrays': '_multiarray_umath.compare_chararrays', + 'compare_chararrays': 'numpy.core._multiarray_umath.compare_chararrays', 'deprecate': 'numpy.lib.utils.deprecate', 'deprecate_with_doc': 'numpy.lib.utils.deprecate_with_doc', 'disp': 'numpy.lib.function_base.disp', - 'fastCopyAndTranspose': '_multiarray_umath.fastCopyAndTranspose', + 'fastCopyAndTranspose': 'numpy.core._multiarray_umath.fastCopyAndTranspose', 'get_array_wrap': 'numpy.lib.shape_base.get_array_wrap', 'get_include': 'numpy.lib.utils.get_include', 'recfromcsv': 'numpy.lib.npyio.recfromcsv', diff --git a/contrib/python/numpy/py3/patches/04-fix-tests.patch b/contrib/python/numpy/py3/patches/04-fix-tests.patch index d13669b9ade..26a495365df 100644 --- a/contrib/python/numpy/py3/patches/04-fix-tests.patch +++ b/contrib/python/numpy/py3/patches/04-fix-tests.patch @@ -129,28 +129,6 @@ + data_dir = yc.source_path(os.path.join(os.path.dirname(__file__), 'data')) --- contrib/python/numpy/py3/numpy/tests/test_public_api.py (index) +++ contrib/python/numpy/py3/numpy/tests/test_public_api.py (working tree) -@@ -34,16 +34,16 @@ def test_numpy_namespace(): - # None of these objects are publicly documented to be part of the main - # NumPy namespace (some are useful though, others need to be cleaned up) - undocumented = { -- '_add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc', -- 'add_docstring': 'numpy.core._multiarray_umath.add_docstring', -+ '_add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc', -+ 'add_docstring': '_multiarray_umath.add_docstring', - 'add_newdoc': 'numpy.core.function_base.add_newdoc', -- 'add_newdoc_ufunc': 'numpy.core._multiarray_umath._add_newdoc_ufunc', -+ 'add_newdoc_ufunc': '_multiarray_umath._add_newdoc_ufunc', - 'byte_bounds': 'numpy.lib.utils.byte_bounds', -- 'compare_chararrays': 'numpy.core._multiarray_umath.compare_chararrays', -+ 'compare_chararrays': '_multiarray_umath.compare_chararrays', - 'deprecate': 'numpy.lib.utils.deprecate', - 'deprecate_with_doc': 'numpy.lib.utils.deprecate_with_doc', - 'disp': 'numpy.lib.function_base.disp', -- 'fastCopyAndTranspose': 'numpy.core._multiarray_umath.fastCopyAndTranspose', -+ 'fastCopyAndTranspose': '_multiarray_umath.fastCopyAndTranspose', - 'get_array_wrap': 'numpy.lib.shape_base.get_array_wrap', - 'get_include': 'numpy.lib.utils.get_include', - 'recfromcsv': 'numpy.lib.npyio.recfromcsv', @@ -61,6 +61,7 @@ def test_numpy_namespace(): assert bad_results == allowlist |
