-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
164 lines (153 loc) · 6.32 KB
/
Copy pathpyproject.toml
File metadata and controls
164 lines (153 loc) · 6.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
[project]
name = "dial"
version = "0.1.6"
authors = [
{ name = "Stephen DeWitt", email = "dewittsj@ornl.gov" },
{ name = "Lance Drane", email = "dranelt@ornl.gov" },
{ name = "David Joy", email = "davidjoy022@gmail.com" },
{ name = "Jacob Sweet", email = "jsweet@gatech.edu" },
{ name = "Ankit Shrivastava", email = "shrivastavaa@ornl.gov" },
{ name = "Konstantin Pieper", email = "pieperk@ornl.gov" },
{ name = "Viktor Reshniak", email = "reshniakv@ornl.gov" },
]
description = "Dial (Distributed INTERSECT Active Learning): An INTERSECT service that provides Bayesian optimization and active learning"
readme = "README.md"
requires-python = ">=3.10"
keywords = ["active learning"]
license = { text = "BSD-3-Clause" }
classifiers = ["Programming Language :: Python :: 3"]
# TODO move some dependencies into optional dependencies
dependencies = [
"intersect_sdk>=0.9.3,<0.10.0",
"numpy",
"scikit-learn>=1.4.0,<2.0.0", # TODO consider making an optional dependency group
"scipy>=1.12.0,<2.0.0",
"gpax>=0.1.8", # TODO consider making an optional dependency group
"numpyro<0.20.1", # depend on older numpyro for gpax (numpyro.contrib.module: random_haiku_module)
"pymongo>=4.12.1", # TODO - this is only needed for dial_service, dial_dataclass can use a simple fixture for ObjectID representation which allows it to skip this dependency
"sable @ git+https://code.ornl.gov/sable/sable.git", # TODO this references the internal repo, transition to public version
]
[project.urls]
Homepage = "https://github.com/INTERSECT-DIAL/dial/"
Changelog = "https://github.com/INTERSECT-DIAL/dial/blob/main/CHANGELOG.md"
Documentation = "https://intersect-dial.readthedocs.io/en/latest/"
Issues = "https://github.com/INTERSECT-DIAL/dial/issues"
[project.optional-dependencies]
docs = ["sphinx>=5.3.0", "furo>=2023.3.27"]
[dependency-groups]
dev = [
"pre-commit>=3.3.1",
"mypy>=1.10.0",
"ruff==0.9.4",
"pytest>=7.3.2",
"pytest-cov>=4.1.0",
"httpretty>=1.1.4",
"statsmodels>=0.14.4",
"matplotlib>=3.8.2,<4.0.0",
]
# TODO - consider swapping to scikit-build-core backend if we need C/C++ extensions
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/dial_dataclass", "src/dial_service"]
[tool.hatch.metadata]
# TODO - remove when Sable is published to PyPI
allow-direct-references = true
#[tool.pdm.scripts]
# add --cov-fail-under=<NUMBER> when ready to require a minimum coverage amount
#test-all = "pytest tests/ --cov=src/ --cov-report=html:reports/htmlcov/ --cov-report=xml:reports/coverage_report.xml --junitxml=reports/junit.xml"
#test-unit = "pytest tests/unit/"
[tool.ruff]
line-length = 100
format = { quote-style = 'single' }
namespace-packages = ["scripts/", "tests/"]
[tool.ruff.lint]
isort = { known-first-party = ['src'] }
pydocstyle = { convention = 'google' }
flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'double' }
mccabe = { max-complexity = 20 }
pylint = { max-args = 10, max-branches = 20, max-returns = 10, max-statements = 75 }
# pyflakes and the relevant pycodestyle rules are already configured
extend-select = [
'C90', # mccabe complexity
'I', # isort
'N', # pep8-naming
#'D', # pydocstyle - disabled for now
'UP', # pyupgrade
'YTT', # flake8-2020
#'ANN', # flake8-annotations - disabled for now
'ASYNC', # flake8-async
'S', # flake8-bandit
'BLE', # flake8-blind-except
'B', # flake8-bugbear
'A', # flake8-builtins
'COM', # flake8-commas
'C4', # flake8-comprehensions
'DTZ', # flake8-datetimez
'T10', # flake8-debugger
'EM', # flake8-error-message
'FA', # flake8-future-annotations
'ISC', # flake8-implicit-string-concat
'ICN', # flake8-import-conventions
'G', # flake8-logging-format
'INP', # flake8-no-pep420
'PIE', # flake8-PIE
'T20', # flake8-T20
'PYI', # flake8-pyi
'PT', # flake8-pytest-style
'Q', # flake8-quotes
'RSE', # flake8-raise
'RET', # flake8-return
'SLF', # flake8-self
'SLOT', # flake8-slots
'SIM', # flake8-simplify
'TCH', # flake8-type-checking
'ARG', # flake8-unused-arguments
'PTH', # flake8-use-pathlib
'PGH', # pygrep-hooks
'PL', # pylint
'TRY', # tryceratops
'FLY', # flynt
'RUF', # RUFF additional rules
]
# If you're seeking to disable a rule, first consider whether the rule is overbearing, or if it should only be turned off for your usecase.
ignore = [
'COM812', # formatter, handled by Ruff format
'ISC001', # formatter, handled by Ruff format
'SIM105', # "with contextlib.suppress():" is slower than try-except-pass
'ANN401', # allow explicit "Any" typing, use with care
'PLR2004', # allow "magic numbers"
# TODO - should not ignore below in long term, but will for now
'N802', # do not require snake_casing function names
'N803', # do not require snake_casing function/method arguments
'N806', # allow uppercase in function names
'N812', # allow lowercase imports to be aliased to non-lowercase names
'RET504', # allow "unnecessary assignment to variable" before return statements
]
[tool.ruff.lint.extend-per-file-ignores]
'__init__.py' = ['F401'] # __init__.py commonly has unused imports
'docs/*' = [
'D', # the documentation folder does not need documentation
'INP001', # docs are not a namespace package
]
'scripts/*' = [
'T20', # allow print/pprint statements in scripts
'N999', # allow scripts to have non-pep8-compliant names, i.e. "2d_rosenbrock"
]
'tests/*' = [
'S101', # allow assert statements in tests
'S106', # don't care about credentials in tests
'S311', # don't care about cryptographic security in tests
'SLF001', # allow private member access in tests
'ANN', # tests in general don't need types, unless they are runtime types.
'ARG', # allow unused parameters in tests
'D', # ignore documentation in tests
'FA100', # tests frequently use runtime typing annotations
'T201', # allow print statements in tests
]
[tool.mypy]
#strict = true
ignore_missing_imports = true # don't require typing for library stubs if they don't exist
disallow_untyped_decorators = false # this is needed for library decorator compatibility, i.e. "retrying"
plugins = ["pydantic.mypy"]