Skip to content

Commit 019efdb

Browse files
committed
Enable setuptools build process
1 parent 9e63df8 commit 019efdb

File tree

6 files changed

+29
-98
lines changed

6 files changed

+29
-98
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ jobs:
194194
steps:
195195
- template: azure-pipelines-steps.yml
196196
parameters:
197+
package: '-e .'
197198
body:
198-
- script: 'python setup.py pytest'
199+
- script: 'pip install pytest pytest-cov pytest-xdist && pytest'
199200
displayName: 'Unit tests'
200201
env:
201202
PYTEST_ADDOPTS: '-m "not (notebook or automl)"'

econml/grf/setup.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

econml/tree/setup.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[build-system]
2+
requires = [
3+
"setuptools",
4+
"wheel",
5+
"Cython",
6+
"numpy == 1.19.3",
7+
"scipy"
8+
]
9+
build-backend = "setuptools.build_meta"
10+
11+
[tool.pytest.ini_options]
12+
addopts = "--junitxml=junit/test-results.xml -n auto --strict-markers --cov-config=setup.cfg --cov=econml --cov-report=xml"
13+
markers = [
14+
"slow",
15+
"notebook",
16+
"automl"
17+
]

setup.cfg

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ classifiers =
3232

3333
[options]
3434
packages = find_namespace:
35-
setup_requires =
36-
pytest-runner
37-
sphinx < 3.2
38-
sphinx_rtd_theme
35+
3936
install_requires =
4037
numpy
4138
scipy != 1.4.0
@@ -77,13 +74,6 @@ include =
7774
; include all CSV files as data
7875
* = *.csv
7976

80-
[tool:pytest]
81-
addopts = --junitxml=junit/test-results.xml -n auto --strict --cov-config=setup.cfg --cov=econml --cov-report=xml
82-
markers =
83-
slow
84-
notebook
85-
automl
86-
8777
; coverage configuration
8878
[coverage:run]
8979
omit = econml/tests/*

setup.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
import sys
2-
import os
1+
from setuptools import setup
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("*", ["**/*.pyx"],
9+
include_dirs=[np.get_include()])],
10+
language_level="3"),
11+
zip_safe=False)

0 commit comments

Comments
 (0)