Skip to content

Commit a1ea6cb

Browse files
author
Gabriel Leclerc
committed
Try to fix installation
1 parent 3db2ed8 commit a1ea6cb

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include cpp_extensions/*

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel", "numpy<2"]
3+
build-backend = "setuptools.build_meta"

setup.py

+3-17
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
1818
"""
19-
from numpy import get_include as get_numpy_include
19+
import numpy
2020
from platform import system as get_os_name
2121
from setuptools import Extension, find_packages, setup
2222
from setuptools.command.build_ext import build_ext as _build_ext
@@ -28,25 +28,15 @@
2828
os_compile_flags = []
2929

3030

31-
# Required for the automatic installation of numpy
32-
class build_ext(_build_ext):
33-
def finalize_options(self):
34-
_build_ext.finalize_options(self)
35-
# Prevent numpy from thinking it is still in its setup process:
36-
__builtins__.__NUMPY_SETUP__ = False
37-
import numpy
38-
39-
self.include_dirs.append(numpy.get_include())
40-
41-
4231
solver_module = Extension(
4332
"pyscm._scm_utility",
4433
language="c++",
4534
sources=["cpp_extensions/utility_python_bindings.cpp", "cpp_extensions/solver.cpp"],
4635
extra_compile_args=["-std=c++0x"] + os_compile_flags,
36+
include_dirs=[numpy.get_include()]
4737
)
4838

49-
dependencies = ["numpy", "scipy", "scikit-learn", "six"]
39+
dependencies = ["numpy<2", "scikit-learn", "six"]
5040

5141
with open("README.md", "r") as f:
5242
long_description = f.read()
@@ -55,8 +45,6 @@ def finalize_options(self):
5545
name="pyscm-ml",
5646
version="1.1.1",
5747
packages=find_packages(),
58-
cmdclass={"build_ext": build_ext},
59-
setup_requires=dependencies,
6048
install_requires=dependencies,
6149
author="Alexandre Drouin",
6250
author_email="[email protected]",
@@ -77,6 +65,4 @@ def finalize_options(self):
7765
"Topic :: Scientific/Engineering :: Artificial Intelligence",
7866
],
7967
ext_modules=[solver_module],
80-
test_suite="nose.collector",
81-
tests_require=["nose"],
8268
)

0 commit comments

Comments
 (0)