Skip to content

Commit

Permalink
apacheGH-43532: [Python] Remove usage of deprecated pkg_resources in …
Browse files Browse the repository at this point in the history
…setup.py (apache#43602)

### Rationale for this change
Closes apache#43532.

### What changes are included in this PR?
Remove deprecated `pkg_resources.resource_filename('numpy', 'core/include')`, replace with `numpy.get_include()`

### Are these changes tested?
Test by CI.

### Are there any user-facing changes?
No

* GitHub Issue: apache#43532

Authored-by: Tai Le Manh <manhtai.lmt@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
tlm365 authored Aug 8, 2024
1 parent e54ad41 commit 3420c0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
# Get correct EXT_SUFFIX on Windows (https://bugs.python.org/issue39825)
from distutils import sysconfig

import pkg_resources
from setuptools import setup, Extension, Distribution, find_namespace_packages

from Cython.Distutils import build_ext as _build_ext
Expand Down Expand Up @@ -106,7 +105,8 @@ class build_ext(_build_ext):
_found_names = ()

def build_extensions(self):
numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
import numpy
numpy_incl = numpy.get_include()

self.extensions = [ext for ext in self.extensions
if ext.name != '__dummy__']
Expand Down

0 comments on commit 3420c0d

Please sign in to comment.