| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -261,7 +261,7 @@ jobs: | |||
| 261 | 261 | # Preinstall build requirements to enable no-build-isolation builds. | |
| 262 | 262 | python -m pip install --upgrade $PRE \ | |
| 263 | 263 | 'contourpy>=1.0.1' cycler fonttools kiwisolver importlib_resources \ | |
| 264 | - numpy packaging pillow 'pyparsing!=3.1.0' python-dateutil setuptools-scm \ | ||
| 264 | + packaging pillow 'pyparsing!=3.1.0' python-dateutil setuptools-scm \ | ||
| 265 | 265 | 'meson-python>=0.13.1' 'pybind11>=2.6' \ | |
| 266 | 266 | -r requirements/testing/all.txt \ | |
| 267 | 267 | ${{ matrix.extra-requirements }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,6 @@ requires-python = ">=3.10" | |||
| 47 | 47 | # Should be a copy of the build dependencies below. | |
| 48 | 48 | dev = [ | |
| 49 | 49 | "meson-python>=0.13.1", | |
| 50 | - "numpy>=1.25", | ||
| 51 | 50 | "pybind11>=2.6,!=2.13.3", | |
| 52 | 51 | "setuptools_scm>=7", | |
| 53 | 52 | # Not required by us but setuptools_scm without a version, cso _if_ | |
@@ -74,18 +73,6 @@ requires = [ | |||
| 74 | 73 | "meson-python>=0.13.1", | |
| 75 | 74 | "pybind11>=2.6,!=2.13.3", | |
| 76 | 75 | "setuptools_scm>=7", | |
| 77 | - | ||
| 78 | - # Comments on numpy build requirement range: | ||
| 79 | - # | ||
| 80 | - # 1. >=2.0.x is the numpy requirement for wheel builds for distribution | ||
| 81 | - # on PyPI - building against 2.x yields wheels that are also | ||
| 82 | - # ABI-compatible with numpy 1.x at runtime. | ||
| 83 | - # 2. Note that building against numpy 1.x works fine too - users and | ||
| 84 | - # redistributors can do this by installing the numpy version they like | ||
| 85 | - # and disabling build isolation. | ||
| 86 | - # 3. The <2.3 upper bound is for matching the numpy deprecation policy, | ||
| 87 | - # it should not be loosened. | ||
| 88 | - "numpy>=2.0.0rc1,<2.3", | ||
| 89 | 76 | ] | |
| 90 | 77 | ||
| 91 | 78 | [tool.meson-python.args] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,3 @@ | |||
| 1 | 1 | pybind11!=2.13.3 | |
| 2 | 2 | meson-python | |
| 3 | - numpy<2.1.0 | ||
| 4 | 3 | setuptools-scm | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,6 @@ contourpy>=1.0.1 | |||
| 18 | 18 | cycler>=0.10 | |
| 19 | 19 | fonttools>=4.22.0 | |
| 20 | 20 | kiwisolver>=1.3.1 | |
| 21 | - numpy>=1.19 | ||
| 22 | 21 | packaging>=20.0 | |
| 23 | 22 | pillow>=8 | |
| 24 | 23 | pyparsing>=2.3.1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,6 @@ | |||
| 2 | 2 | #include <pybind11/numpy.h> | |
| 3 | 3 | #include <pybind11/stl.h> | |
| 4 | 4 | #include "mplutils.h" | |
| 5 | - #include "numpy_cpp.h" | ||
| 6 | 5 | #include "py_converters.h" | |
| 7 | 6 | #include "_backend_agg.h" | |
| 8 | 7 | ||
@@ -188,14 +187,6 @@ PyRendererAgg_draw_gouraud_triangles(RendererAgg *self, | |||
| 188 | 187 | ||
| 189 | 188 | PYBIND11_MODULE(_backend_agg, m) | |
| 190 | 189 | { | |
| 191 | - auto ia = [m]() -> const void* { | ||
| 192 | - import_array(); | ||
| 193 | - return &m; | ||
| 194 | - }; | ||
| 195 | - if (ia() == NULL) { | ||
| 196 | - throw py::error_already_set(); | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | 190 | py::class_<RendererAgg>(m, "RendererAgg", py::buffer_protocol()) | |
| 200 | 191 | .def(py::init<unsigned int, unsigned int, double>(), | |
| 201 | 192 | "width"_a, "height"_a, "dpi"_a) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | 19 | #include "path_converters.h" | |
| 20 | 20 | #include "_backend_agg_basic_types.h" | |
| 21 | - #include "numpy_cpp.h" | ||
| 22 | 21 | ||
| 23 | 22 | const size_t NUM_VERTICES[] = { 1, 1, 1, 2, 3 }; | |
| 24 | 23 | ||
@@ -1004,15 +1003,15 @@ void convert_path_to_polygons(PathIterator &path, | |||
| 1004 | 1003 | ||
| 1005 | 1004 | template <class VertexSource> | |
| 1006 | 1005 | void | |
| 1007 | - __cleanup_path(VertexSource &source, std::vector<double> &vertices, std::vector<npy_uint8> &codes) | ||
| 1006 | + __cleanup_path(VertexSource &source, std::vector<double> &vertices, std::vector<uint8_t> &codes) | ||
| 1008 | 1007 | { | |
| 1009 | 1008 | unsigned code; | |
| 1010 | 1009 | double x, y; | |
| 1011 | 1010 | do { | |
| 1012 | 1011 | code = source.vertex(&x, &y); | |
| 1013 | 1012 | vertices.push_back(x); | |
| 1014 | 1013 | vertices.push_back(y); | |
| 1015 | - codes.push_back((npy_uint8)code); | ||
| 1014 | + codes.push_back(static_cast<uint8_t>(code)); | ||
| 1016 | 1015 | } while (code != agg::path_cmd_stop); | |
| 1017 | 1016 | } | |
| 1018 | 1017 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,8 +7,6 @@ | |||
| 7 | 7 | #include <string> | |
| 8 | 8 | #include <vector> | |
| 9 | 9 | ||
| 10 | - #include "numpy_cpp.h" | ||
| 11 | - | ||
| 12 | 10 | #include "_path.h" | |
| 13 | 11 | ||
| 14 | 12 | #include "_backend_agg_basic_types.h" | |
@@ -266,7 +264,7 @@ Py_cleanup_path(mpl::PathIterator path, agg::trans_affine trans, bool remove_nan | |||
| 266 | 264 | bool do_clip = (clip_rect.x1 < clip_rect.x2 && clip_rect.y1 < clip_rect.y2); | |
| 267 | 265 | ||
| 268 | 266 | std::vector<double> vertices; | |
| 269 | - std::vector<npy_uint8> codes; | ||
| 267 | + std::vector<uint8_t> codes; | ||
| 270 | 268 | ||
| 271 | 269 | cleanup_path(path, trans, remove_nans, do_clip, clip_rect, snap_mode, stroke_width, | |
| 272 | 270 | *simplify, return_curves, sketch, vertices, codes); | |
@@ -374,14 +372,6 @@ Py_is_sorted_and_has_non_nan(py::object obj) | |||
| 374 | 372 | ||
| 375 | 373 | PYBIND11_MODULE(_path, m) | |
| 376 | 374 | { | |
| 377 | - auto ia = [m]() -> const void* { | ||
| 378 | - import_array(); | ||
| 379 | - return &m; | ||
| 380 | - }; | ||
| 381 | - if (ia() == NULL) { | ||
| 382 | - throw py::error_already_set(); | ||
| 383 | - } | ||
| 384 | - | ||
| 385 | 375 | m.def("point_in_path", &Py_point_in_path, | |
| 386 | 376 | "x"_a, "y"_a, "radius"_a, "path"_a, "trans"_a); | |
| 387 | 377 | m.def("points_in_path", &Py_points_in_path, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ | |||
| 4 | 4 | #include <pybind11/stl.h> | |
| 5 | 5 | ||
| 6 | 6 | #include "ft2font.h" | |
| 7 | - #include "numpy/arrayobject.h" | ||
| 8 | 7 | ||
| 9 | 8 | #include <set> | |
| 10 | 9 | #include <sstream> | |
@@ -955,14 +954,6 @@ PyFT2Font_fname(PyFT2Font *self) | |||
| 955 | 954 | ||
| 956 | 955 | PYBIND11_MODULE(ft2font, m) | |
| 957 | 956 | { | |
| 958 | - auto ia = [m]() -> const void* { | ||
| 959 | - import_array(); | ||
| 960 | - return &m; | ||
| 961 | - }; | ||
| 962 | - if (ia() == NULL) { | ||
| 963 | - throw py::error_already_set(); | ||
| 964 | - } | ||
| 965 | - | ||
| 966 | 957 | if (FT_Init_FreeType(&_ft2Library)) { // initialize library | |
| 967 | 958 | throw std::runtime_error("Could not initialize the freetype2 library"); | |
| 968 | 959 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,42 +1,3 @@ | |||
| 1 | - # NumPy include directory - needed in all submodules | ||
| 2 | - # The try-except is needed because when things are split across drives on Windows, there | ||
| 3 | - # is no relative path and an exception gets raised. There may be other such cases, so add | ||
| 4 | - # a catch-all and switch to an absolute path. Relative paths are needed when for example | ||
| 5 | - # a virtualenv is placed inside the source tree; Meson rejects absolute paths to places | ||
| 6 | - # inside the source tree. | ||
| 7 | - # For cross-compilation it is often not possible to run the Python interpreter in order | ||
| 8 | - # to retrieve numpy's include directory. It can be specified in the cross file instead: | ||
| 9 | - # | ||
| 10 | - # [properties] | ||
| 11 | - # numpy-include-dir = /abspath/to/host-pythons/site-packages/numpy/core/include | ||
| 12 | - # | ||
| 13 | - # This uses the path as is, and avoids running the interpreter. | ||
| 14 | - incdir_numpy = meson.get_external_property('numpy-include-dir', 'not-given') | ||
| 15 | - if incdir_numpy == 'not-given' | ||
| 16 | - incdir_numpy = run_command(py3, | ||
| 17 | - [ | ||
| 18 | - '-c', | ||
| 19 | - '''import os | ||
| 20 | - import numpy as np | ||
| 21 | - try: | ||
| 22 | - incdir = os.path.relpath(np.get_include()) | ||
| 23 | - except Exception: | ||
| 24 | - incdir = np.get_include() | ||
| 25 | - print(incdir)''' | ||
| 26 | - ], | ||
| 27 | - check: true | ||
| 28 | - ).stdout().strip() | ||
| 29 | - endif | ||
| 30 | - numpy_dep = declare_dependency( | ||
| 31 | - compile_args: [ | ||
| 32 | - '-DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION', | ||
| 33 | - # Allow NumPy's printf format specifiers in C++. | ||
| 34 | - '-D__STDC_FORMAT_MACROS=1', | ||
| 35 | - ], | ||
| 36 | - include_directories: include_directories(incdir_numpy), | ||
| 37 | - dependencies: py3_dep, | ||
| 38 | - ) | ||
| 39 | - | ||
| 40 | 1 | # For cross-compilation it is often not possible to run the Python interpreter in order | |
| 41 | 2 | # to retrieve the platform-specific /dev/null. It can be specified in the cross file | |
| 42 | 3 | # instead: | |
@@ -76,7 +37,7 @@ extension_data = { | |||
| 76 | 37 | '_backend_agg.cpp', | |
| 77 | 38 | '_backend_agg_wrapper.cpp', | |
| 78 | 39 | ), | |
| 79 | - 'dependencies': [agg_dep, numpy_dep, freetype_dep, pybind11_dep], | ||
| 40 | + 'dependencies': [agg_dep, freetype_dep, pybind11_dep], | ||
| 80 | 41 | }, | |
| 81 | 42 | '_c_internal_utils': { | |
| 82 | 43 | 'subdir': 'matplotlib', | |
@@ -92,7 +53,7 @@ extension_data = { | |||
| 92 | 53 | 'ft2font_wrapper.cpp', | |
| 93 | 54 | ), | |
| 94 | 55 | 'dependencies': [ | |
| 95 | - freetype_dep, pybind11_dep, numpy_dep, agg_dep.partial_dependency(includes: true), | ||
| 56 | + freetype_dep, pybind11_dep, agg_dep.partial_dependency(includes: true), | ||
| 96 | 57 | ], | |
| 97 | 58 | 'cpp_args': [ | |
| 98 | 59 | '-DFREETYPE_BUILD_TYPE="@0@"'.format( | |
@@ -117,7 +78,7 @@ extension_data = { | |||
| 117 | 78 | 'sources': files( | |
| 118 | 79 | '_path_wrapper.cpp', | |
| 119 | 80 | ), | |
| 120 | - 'dependencies': [numpy_dep, agg_dep, pybind11_dep], | ||
| 81 | + 'dependencies': [agg_dep, pybind11_dep], | ||
| 121 | 82 | }, | |
| 122 | 83 | '_qhull': { | |
| 123 | 84 | 'subdir': 'matplotlib', | |
@@ -157,16 +118,7 @@ extension_data = { | |||
| 157 | 118 | } | |
| 158 | 119 | ||
| 159 | 120 | foreach ext, kwargs : extension_data | |
| 160 | - # Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each extension. | ||
| 161 | - unique_array_api = '-DPY_ARRAY_UNIQUE_SYMBOL=MPL_@0@_ARRAY_API'.format(ext.replace('.', '_')) | ||
| 162 | - additions = { | ||
| 163 | - 'c_args': [unique_array_api] + kwargs.get('c_args', []), | ||
| 164 | - 'cpp_args': [unique_array_api] + kwargs.get('cpp_args', []), | ||
| 165 | - } | ||
| 166 | - py3.extension_module( | ||
| 167 | - ext, | ||
| 168 | - install: true, | ||
| 169 | - kwargs: kwargs + additions) | ||
| 121 | + py3.extension_module(ext, install: true, kwargs: kwargs) | ||
| 170 | 122 | endforeach | |
| 171 | 123 | ||
| 172 | 124 | if get_option('macosx') and host_machine.system() == 'darwin' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments