-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
244 lines (231 loc) · 8.57 KB
/
pyproject.toml
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[project]
name = "plangym"
dynamic = ["version"]
description = "Plangym is an interface to use gymnasium for planning problems. It extends the standard interface to allow setting and recovering the environment states."
authors = [{ name = "Guillem Duran Ballester", email = "[email protected]" }]
maintainers = [{ name = "Guillem Duran Ballester", email = "[email protected]" }]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.10"
packages = [{ include = "plangym", from = "src" }]
include = ["tests/**/*", "tests/**/.*"]
homepage = "https://github.com/FragileTech/plangym"
repository = "https://github.com/FragileTech/plangym"
documentation = "https://github.com/FragileTech/plangym"
keywords = ["RL", "gymnasium", "planning", "plangym"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries",
]
dependencies = [
"numpy",
"pillow",
"fragile-gym",
"opencv-python>=4.10.0.84",
"pyglet==1.5.11",
"pyvirtualdisplay>=3.0",
"imageio>=2.35.1",
"flogging>=0.0.22",
]
[project.optional-dependencies]
atari = ["ale-py", "gymnasium[accept-rom-license,atari]>=0.29.1, == 0.*"]
nes = [
"fragile-gym[accept-rom-license]",
"fragile-nes-py>=10.0.1", # Requires clang, build-essential
"fragile-gym-super-mario-bros>=7.4.1",
]
classic-control = ["gymnasium[classic_control]>=0.29.1, == 0.*", "pygame>=2.6.0"]
ray = ["ray>=2.35.0"]
dm_control = ["mujoco>=3.2.2", "dm-control>=1.0.22"]
retro = [
"stable-retro==0.9.2; sys_platform != 'darwin'",
"stable-retro==0.9.1; sys_platform == 'darwin'"
]
jupyter = ["jupyterlab>=3.2.0"]
box_2d = ["box2d-py==2.3.5"]
test = [
"psutil>=5.8.0",
"pytest>=6.2.5",
"pytest-cov>=3.0.0",
"pytest-xdist>=2.4.0",
"pytest-rerunfailures>=10.2",
"pyvirtualdisplay>=1.3.2",
"tomli>=1.2.3",
"hypothesis>=6.24.6"
]
docs = [
"sphinx",
"linkify-it-py",
"myst-parser",
"myst-nb",
"ruyaml",
"sphinx-autoapi",
"pydata-sphinx-theme",
"sphinx-autodoc2",
"sphinxcontrib-mermaid",
"sphinx_book_theme",
"sphinx_rtd_theme",
"jupyter-cache",
"sphinx-copybutton",
"sphinx-togglebutton",
"sphinxext-opengraph",
"sphinxcontrib-bibtex",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.version]
path = "src/plangym/version.py"
[tool.rye]
dev-dependencies = ["ruff"]
#excluded-dependencies = ["gym"]
universal = true
[tool.rye.scripts]
style = { chain = ["ruff check --fix-only --unsafe-fixes tests src", "ruff format tests src"] }
check = { chain = ["ruff check --diff tests src", "ruff format --diff tests src"]} #,"mypy src tests" ] }
test = { chain = ["test:doctest", "test:parallel", "test:singlecore"] }
codecov = { chain = ["codecov:singlecore", "codecov:parallel"] }
import-roms = { cmd = "python3 src/plangym/scripts/import_retro_roms.py" }
"test:parallel" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info tests", env-file = ".multicore.env" }
"test:singlecore" = { cmd = "pytest -s -o log_cli=true -o log_cli_level=info tests/control/test_classic_control.py", env-file = ".onecore.env" }
"test:doctest" = { cmd = "pytest --doctest-modules -n 0 -s -o log_cli=true -o log_cli_level=info src", env-file = ".multicore.env" }
"codecov:parallel" = { chain = ["codecov:parallel_1", "codecov:parallel_2", "codecov:parallel_3", "codecov:vectorization"] }
"codecov:parallel_1" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml:coverage_parallel_1.xml --cov-config=pyproject.toml tests/test_core.py tests/test_registry.py tests/test_utils.py", env-file = ".multicore.env" }
"codecov:parallel_2" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml:coverage_parallel_2.xml --cov-config=pyproject.toml tests/videogames", env-file = ".multicore.env" }
"codecov:parallel_3" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml:coverage_parallel_3.xml --cov-config=pyproject.toml tests/control", env-file = ".multicore.env" }
"codecov:vectorization" = { cmd = "pytest -n 0 -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml:coverage_vectorization.xml --cov-config=pyproject.toml tests/vectorization", env-file = ".multicore.env" }
"codecov:singlecore" = { cmd = "pytest --doctest-modules -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml --cov-config=pyproject.toml tests/control/test_classic_control.py", env-file = ".onecore.env" }
docs = {chain = ["build-docs", "serve-docs"]}
build-docs = { cmd = "sphinx-build -b html docs/source docs/build"}
serve-docs = { cmd = "python3 -m http.server --directory docs/build" }
[tool.ruff]
# Assume Python 3.10
target-version = "py310"
preview = true
include = ["*.py", "*.pyi", "**/pyproject.toml"]#, "*.ipynb"]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".idea",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"output",
"venv",
"experimental",
".pytest_cache",
"**/.ipynb_checkpoints/**",
"**/proto/**",
"data",
"config",
]
# Same as Black.
line-length = 99
[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
select = [
"ARG", "C4", "D", "E", "EM", "F", "FBT",
"FLY", "FIX", "FURB", "N", "NPY",
"INP", "ISC", "PERF", "PIE", "PL",
"PTH", "RET", "RUF", "S", "T10",
"TD", "T20", "UP", "YTT", "W",
]
ignore = [
"D100", "D211", "D213", "D104", "D203", "D301", "D407", "S101",
"FBT001", "FBT002", "FIX002", "ISC001", "PLR0913", "RUF012", "TD003",
"PTH123", "PLR6301", "PLR0917", "S311", "S403", "PLR0914", "PLR0915", "S608",
"EM102", "PTH111", "FIX004", "UP035", "PLW2901", "S318", "S408", 'S405',
'E902', "TD001", "TD002", "FIX001",
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = ["I"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
"cli.py" = ["PLC0415", "D205", "D400", "D415"]
"core.py" = ["ARG002", "PLR0904"]
"_old_core.py" = ["ALL"]
"lunar_lander.py" = ["PLR2004", "FBT003", "N806"]
"api_tests.py" = ["D", "ARG002", "PLW1508", "FBT003", "PLR2004"]
"montezuma.py" = ["PLR2004", "S101", "ARG002", "TD002"]
"registry.py" = ["PLC0415", "PLR0911"]
"**/docs/**" = ["INP001", "PTH100"]
"**/super_mario_gym/**" = ["ALL"]
"**/{tests,docs,tools}/*" = [
"E402", "F401", "F811", "D", "S101", "PLR2004", "S105",
"PLW1514", "PTH123", "PTH107", "N811", "PLC0415", "ARG002",
]
# Enable reformatting of code snippets in docstrings.
[tool.ruff.format]
docstring-code-line-length = 80
docstring-code-format = true
indent-style = "space"
line-ending = "auto"
preview = true
quote-style = "double"
[tool.mypy]
exclude = ["experimental.*", "deprecated.*"]
ignore_missing_imports = true
# isort orders and lints imports
[tool.isort]
profile = "black"
line_length = 99
multi_line_output = 3
order_by_type = false
force_alphabetical_sort_within_sections = true
force_sort_within_sections = true
combine_as_imports = true
include_trailing_comma = true
color_output = true
lines_after_imports = 2
honor_noqa = true
skip = ["venv", ".venv"]
skip_glob = ["*.pyx"]
[tool.pylint.master]
ignore = 'tests'
load-plugins =' pylint.extensions.docparams'
[tool.pylint.messages_control]
disable = 'all,'
enable = """,
missing-param-doc,
differing-param-doc,
differing-type-doc,
missing-return-doc,
"""
[tool.pytest.ini_options]
# To disable a specific warning --> action:message:category:module:line
filterwarnings = ["ignore::UserWarning", 'ignore::DeprecationWarning']
addopts = "--ignore=scripts --doctest-continue-on-failure"
# Code coverage config
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_lines =["no cover",
'raise NotImplementedError',
'if __name__ == "__main__":']
ignore_errors = true
omit = ["tests/*", "src/plangym/scripts/*"]