Skip to content

Commit bfa1492

Browse files
committedDec 17, 2020
Enable setuptools build process
1 parent 9e63df8 commit bfa1492

File tree

4 files changed

+21
-48
lines changed

4 files changed

+21
-48
lines changed
 

‎econml/grf/setup.py

-28
This file was deleted.

‎pyproject.toml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[build-system]
2+
requires = [
3+
"setuptools",
4+
"wheel",
5+
"pytest-runner",
6+
"Cython",
7+
"sphinx < 3.2",
8+
"sphinx_rtd_theme",
9+
"numpy == 1.19.3",
10+
"scipy"
11+
]
12+
build-backend = "setuptools.build_meta"

‎setup.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ setup_requires =
3636
pytest-runner
3737
sphinx < 3.2
3838
sphinx_rtd_theme
39+
Cython
3940
install_requires =
4041
numpy
4142
scipy != 1.4.0

‎setup.py

+8-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
1-
import sys
2-
import os
1+
from setuptools import setup, find_packages
2+
from setuptools.extension import Extension
3+
from Cython.Build import cythonize
4+
import numpy as np
35

46

5-
def configuration(parent_package='', top_path=None):
6-
from numpy.distutils.misc_util import Configuration
7-
import numpy
8-
9-
libraries = []
10-
if os.name == 'posix':
11-
libraries.append('m')
12-
13-
config = Configuration(None, parent_package, top_path)
14-
15-
config.add_subpackage('econml')
16-
17-
return config
18-
19-
20-
if __name__ == '__main__':
21-
from numpy.distutils.core import setup
22-
setup(**configuration(top_path='').todict())
7+
# configuration is all pulled from setup.cfg
8+
setup(ext_modules=cythonize([Extension("*", ["econml/grf/*.pyx"],
9+
include_dirs=[np.get_include()])],
10+
language_level="3"))

0 commit comments

Comments
 (0)