|
| 1 | +[build-system] |
| 2 | +requires = ["setuptools>=77.0", "wheel"] |
| 3 | +build-backend = "setuptools.build_meta" |
| 4 | + |
| 5 | +[project] |
| 6 | +name = "error-parity" |
| 7 | +description = "Achieve error-rate parity between protected groups for any predictor" |
| 8 | +license = "MIT" |
| 9 | +license-files = ["LICENSE"] |
| 10 | +authors = [ |
| 11 | + { name = "AndreFCruz" }, |
| 12 | +] |
| 13 | + |
| 14 | +# Keywords to be used by PyPI search |
| 15 | +keywords = ["ml", "optimization", "fairness", "error-parity", "equal-odds"] |
| 16 | + |
| 17 | +# PyPI classifiers, see https://pypi.org/classifiers/ |
| 18 | +classifiers = [ |
| 19 | + "Development Status :: 3 - Alpha", |
| 20 | + "Intended Audience :: Science/Research", |
| 21 | + "Topic :: Scientific/Engineering :: Artificial Intelligence", |
| 22 | + "Programming Language :: Python :: 3", |
| 23 | + "Programming Language :: Python :: 3.9", |
| 24 | + "Programming Language :: Python :: 3.10", |
| 25 | + "Programming Language :: Python :: 3.11", |
| 26 | + "Programming Language :: Python :: 3.12", |
| 27 | +] |
| 28 | + |
| 29 | +requires-python = ">=3.9" |
| 30 | + |
| 31 | +# These are defined below dynamically: |
| 32 | +dynamic = [ |
| 33 | + "version", |
| 34 | + "readme", |
| 35 | + "dependencies", |
| 36 | + "optional-dependencies", |
| 37 | +] |
| 38 | + |
| 39 | + |
| 40 | +[tool.setuptools.packages.find] |
| 41 | +include = ["error_parity*"] |
| 42 | +exclude = ["tests*"] |
| 43 | + |
| 44 | +[tool.setuptools.dynamic] |
| 45 | +version = { attr = "error_parity._version.__version__" } |
| 46 | +readme = { file = "README.md", content-type = "text/markdown" } |
| 47 | + |
| 48 | +# Main package dependencies |
| 49 | +dependencies = {file = "requirements/main.txt"} |
| 50 | + |
| 51 | +# Optional dependencies |
| 52 | +[tool.setuptools.dynamic.optional-dependencies] |
| 53 | +test = {file = "requirements/test.txt"} |
| 54 | +dev = {file = "requirements/dev.txt"} |
| 55 | +docs = {file = "requirements/docs.txt"} |
| 56 | +all = {file = [ |
| 57 | + "requirements/dev.txt", |
| 58 | + "requirements/test.txt", |
| 59 | + "requirements/docs.txt", |
| 60 | +]} |
| 61 | + |
| 62 | +[project.urls] |
| 63 | +homepage = "https://github.com/socialfoundations/error-parity" |
| 64 | + |
| 65 | +# flake8 |
| 66 | +[tool.flake8] |
| 67 | +max-complexity = 10 |
| 68 | +max-line-length = 120 |
| 69 | + |
| 70 | +per-file-ignores = """ |
| 71 | +# imported but unused |
| 72 | +**/__init__.py: F401 |
| 73 | +""" |
| 74 | + |
| 75 | +exclude = [ |
| 76 | + "docs/", |
| 77 | + ".tox/", |
| 78 | + "build/", |
| 79 | + "dist/", |
| 80 | +] |
| 81 | + |
| 82 | +[tool.pytest.ini_options] |
| 83 | +minversion = "8.0" |
| 84 | +testpaths = [ |
| 85 | + "tests", |
| 86 | +] |
| 87 | + |
| 88 | +# isort |
| 89 | +[tool.isort] |
| 90 | +profile = "hug" |
| 91 | +force_single_line = false |
| 92 | +src_paths = ["error_parity", "tests"] |
| 93 | + |
| 94 | +# Coverage |
| 95 | +[tool.coverage.run] |
| 96 | +branch = true |
| 97 | +source = ["error_parity"] |
| 98 | +omit = ["error_parity/_version.py", "tests"] |
| 99 | + |
| 100 | +[tool.coverage.report] |
| 101 | +show_missing = true |
| 102 | + |
| 103 | +# MyPy |
| 104 | +[tool.mypy] |
| 105 | +ignore_missing_imports = true |
| 106 | +no_implicit_optional = false |
| 107 | +strict_optional = false |
| 108 | +exclude = [ |
| 109 | + "build", |
| 110 | + "doc", |
| 111 | + "tests", |
| 112 | + "notebooks", |
| 113 | +] |
| 114 | +python_version = "3.11" |
| 115 | + |
| 116 | +# Tox |
| 117 | +[tool.tox] |
| 118 | +legacy_tox_ini = """ |
| 119 | +[tox] |
| 120 | +env_list = |
| 121 | + py39 |
| 122 | + py310 |
| 123 | + py311 |
| 124 | + py312 |
| 125 | + lint |
| 126 | + type |
| 127 | +
|
| 128 | +[testenv] |
| 129 | +description = run unit tests |
| 130 | +deps = |
| 131 | + pytest>=8 |
| 132 | + coverage>=7 |
| 133 | +commands = |
| 134 | + coverage erase |
| 135 | + coverage run -m pytest {posargs:tests} |
| 136 | + coverage report -m |
| 137 | +
|
| 138 | +[testenv:type] |
| 139 | +description = run type checks |
| 140 | +basepython = python3.11 |
| 141 | +deps = |
| 142 | + mypy>=1.0 |
| 143 | +commands = mypy {posargs:error_parity} |
| 144 | +
|
| 145 | +[testenv:lint] |
| 146 | +description = run linters |
| 147 | +skip_install = true |
| 148 | +deps = |
| 149 | + flake8>=7.0 |
| 150 | + flake8-pyproject |
| 151 | +commands = flake8 {posargs:error_parity tests} |
| 152 | +""" |
0 commit comments