EconML/pyproject.toml

168 строки
4.9 KiB
TOML

[project]
name = "econml"
requires-python = ">=3.8"
authors = [{ name = "PyWhy contributors" }]
description = "This package contains several methods for calculating Conditional Average Treatment Effects"
readme = "README.md"
keywords = ["treatment-effect"]
license = { text = "MIT" }
dynamic = ["version"]
classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux"
]
dependencies = [
"numpy<2",
"scipy > 1.4.0",
"scikit-learn >= 1.0, < 1.6",
"sparse",
"joblib >= 0.13.0",
"statsmodels >= 0.10",
"pandas > 1.0",
"shap >= 0.38.1, < 0.44.0",
"lightgbm",
"packaging"
]
[project.urls]
"Homepage" = "https://github.com/py-why/EconML"
"Bug Tracker" = "https://github.com/py-why/EconML/Issues"
"Source Code" = "https://github.com/py-why/EconML"
"Documentation" = "https://econml.azurewebsites.net/"
[project.optional-dependencies]
automl = [
# Disabled due to incompatibility with scikit-learn
# azureml-sdk[explain,automl] == 1.0.83
"azure-cli"
]
tf = [
# This extra is not currently compatible with python 3.9 or above because of tensorflow breaking changes
"keras < 2.4; python_version < '3.9'",
"tensorflow > 1.10, < 2.3; python_version < '3.9'",
# Version capped due to tensorflow incompatibility
"protobuf < 4; python_version < '3.9'",
# Version capped due to tensorflow incompatibility
"numpy < 1.24; python_version < '3.9'"
]
plt = [
"graphviz",
"matplotlib"
]
dowhy = [
# when updating this, also update the version check in dowhy.py
"dowhy < 0.12; python_version > '3.8'",
# Version capped due to scipy incompatibility - can't import dowhy 0.11.1 with scipy 1.4.1
"dowhy < 0.11; python_version <= '3.8'"
]
ray = [
"ray > 2.2.0"
]
all = [
# Disabled due to incompatibility with scikit-learn
# azureml-sdk[explain,automl] == 1.0.83
"azure-cli",
# This extra is not currently compatible with python 3.9 or above because of tensorflow breaking changes
"keras < 2.4; python_version < '3.9'",
"tensorflow > 1.10, < 2.3; python_version < '3.9'",
# Version capped due to tensorflow incompatibility
"protobuf < 4; python_version < '3.9'",
# Version capped due to tensorflow incompatibility
"numpy < 1.24; python_version < '3.9'",
"graphviz",
"matplotlib",
"dowhy < 0.12; python_version > '3.8'",
# Version capped due to scipy incompatibility - can't import dowhy 0.11.1 with scipy 1.4.1
"dowhy < 0.11; python_version <= '3.8'",
"ray > 2.2.0"
]
[build-system]
requires = [
"setuptools",
"wheel",
"oldest-supported-numpy",
"scipy",
"cython<3" # Our native code has several incompatibilities with Cython 3
]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["econml", "econml.*"]
exclude = ["econml.tests"]
[tool.setuptools.package-data]
# include all CSV files as data
"*" = ["*.csv", "*.jbl"]
[tool.pytest.ini_options]
testpaths = ["econml/tests"]
addopts = "--junitxml=junit/test-results.xml -n auto --strict-markers --cov-config=pyproject.toml --cov --import-mode=importlib"
markers = [
"slow",
"notebook",
"automl",
"dml",
"serial",
"cate_api",
"treatment_featurization",
"ray"
]
[tool.coverage.run]
branch = true
# need to explicitly add support for multiprocessing for OrthoForest
concurrency = [
"thread",
"multiprocessing"
]
source = ["econml"]
omit = ["econml/tests/*"]
relative_files = true
[tool.coverage.report]
exclude_lines = [
"raise NotImplementedError\\(\"(Abstract method|Defer to inference)\"\\)"
]
[tool.ruff]
line-length = 120
extend-include = ["*.ipynb"]
extend-exclude = ["prototypes", "monte_carlo_tests"]
[tool.ruff.format]
docstring-code-format = true
quote-style = "preserve"
[tool.ruff.lint]
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D301", # Use r""" if any backslashes in a docstring,
"SIM108", # Use ternary instead of if-else (looks ugly for some of our long expressions)
"SIM300", # Yoda condition detected (these are often easier to understand in array expressions)
]
select = [
"D", # Docstring
"W", # Pycodestyle warnings
"E", # All Pycodestyle erros, not just the default ones
"F", # All pyflakes rules
"SIM", # Simplifification
]
extend-per-file-ignores = { "econml/tests" = ["D"] } # ignore docstring rules for tests
[tool.ruff.lint.pydocstyle]
convention = "numpy"